I added triggers mission to my system only later. See for exemple the missions
"Challenge 6 - Navigating through N X flags.txt"
"Script Exemple 3 - Pathfinder Test.txt"
in
Kernel Panic.
Oh well here's an exemple:
Trigger1=Name RampStart Period 90 InDisk 6176 5056 32 Bit Move 5920 5056 Echo Trying to climb ramp...;
This create a trigger named RampStart. It is checked every 90 frames (one second and a half). It triggers when there's at least one unit of type "bit" in the disk of position x=6176 z=5056 and radius 32. When it triggers it gives a move order to position x=5920 5056 to that (or those) bits, and it prints " Trying to climb ramp..." to the console.
Or another exemple:
Trigger12=Name KillAll Trigger EndGame Once Stop SelfDestruct Echo Time-Out!;
This create a trigger named killall. This triggers first wait for the trigger named endgame to be true. This trigger can only be triggered once (it removes itself after). It has no period so it's checked every frame. It has no InDisk/InRect so it's map wide. It has no unit type so it's applied to every unit. And so when it triggers it gives to every unit the order to stop and to selfdestruct.
Yet another, from when I ported my mission system to BA:
Trigger3 = Name Five_Mex_and_Solar 5 armmex armsolar;
This trigger when there's at least five units, of type either armmex or armsolar.
You can also use the keywords Team (followed by one or more team numbers), Constructed (optionnaly followed by completion percentage) and Skip (optionnally followed by the number of words to skip).
For more details, you can read the code of the function ReadTrigger in the file \LuaRules\Gadgets\libs\dump_units_lib.lua
In case it's not clear, my triggers return a selection to which is applied the order queue at the end of the trigger. But individual units can also insert a WaitTrigger in their order queue to have them wait for a specific trigger.
I planned to add boolean operators to combine my triggers but have not yet.