Here's a good example of why using a trigger generator rocks (any trigger generator!); say we are making some rooms and want to connect them together with two locations. Each location is placed at an entrance/exit of both rooms. Lets name the locations A and B. Lets assume the player has just one hero unit.
When a hero walks onto A we want to move the hero to B. When the hero walks onto B we want to move the hero to A. If either of these triggers occurred we want to keep it from happening again until the hero is not at location A or B (this prevents the hero from jumping from A to B infinitely).
This kind of doorway is very tedious to construct by-hand and takes time. Each doorway needs to be tested to make sure the triggers have no bugs. Instead we can write a function in Lua that LIT turns into triggers. We can test this function once and re-use every time we have a new pair of locations to act as a doorway.
Here's some Lua code I wrote for LIT:
-- create the deathcounter variable with LIT
local roomDC = Deaths( )
roomDC:SetUnit( "Terran Physics Lab" )
roomDC:SetPlayer( 8 )
-- function that generates triggers to connect two locations
-- together to act as a doorway for a "hero unit" called LINK
function ConnectRooms( a, b )
-- move from a to b
p8:Conditions( )
roomDC:SetCount( 0 )
roomDC:Exactly( )
BringExactly( 1, LINK, a, 1 )
p8:Actions( )
roomDC:SetCount( 1 )
roomDC:SetTo( )
MoveUnit( 1, LINK, 1, a, b )
Preserve( )
-- move from b to a
p8:Conditions( )
roomDC:SetCount( 0 )
roomDC:Exactly( )
BringExactly( 1, LINK, b, 1 )
p8:Actions( )
roomDC:SetCount( 1 )
roomDC:SetTo( )
MoveUnit( 1, LINK, 1, b, a )
Preserve( )
-- turn off the DC when not present at a or b
p8:Conditions( )
BringExactly( 1, LINK, a, 0 )
BringExactly( 1, LINK, b, 0 )
roomDC:SetCount( 1 )
roomDC:Exactly( )
p8:Actions( )
roomDC:SetCount( 1 )
roomDC:SetTo( )
Preserve( )
end
ConnectRooms( "link's house a", "link's house b" )
Now each time I need to connect two locations together I use this line:
ConnectRooms( "link's house a", "link's house b" )
If I would like to connect many different rooms together, we can do something like this:
ConnectRooms( "link's house a", "link's house b" )
ConnectRooms( "castle front door a", "castle front door b" )
ConnectRooms( "cave a", "cave b" )
ConnectRooms( "triforce door a", "triforce door b" )
Proof:
None.