We have already had a look at a basic trigger. A single event.
in the trigger's properties, you'll come across a list of targets and messages. something like:
the simplest way to approach this is by just filling in the fields:
- target1: door_27
- message1: trigger
- target2: door_28
- message2: triggerclose
- target3: keyframer_truck
- message3: pause
but you are only scratching the surface here. there is another way to enter commands, which is by nullifying the target field and entering a message string into the message field. the same example as above, using this method, would turn out like this:
message1: msg door_27 trigger; msg door_28 triggerclose; msg keyframer_truck pause;
When you put [NULL] in the target field, the engine knows to ignore that field and just execute the string in the message field.(you can also write 'bogus' or sdf, or whatever, as long as you don't put the name of an actual object in the map. you must put something other than blank space here though
the syntax is "msg [target] [message]"
where target is the name of the object to receive the message, and message is what you are telling the object to do. keep in mind you can click the little button next to the message field to look at the whole message if it starts getting too long to fit in the 1-line text box. there is a limit to the length, though, so watch out. if you are sending a multipart message to a target, that message must be in parentheses.
for example: msg AI_predatorkiller (active 1)
succesive messages in the same text field must be seperated with a semicolon. for example,;
msg AI_killer (active 1); msg Plants_Group (animloop wind); msg Glass_Wall destroy; msg Door_9 lock;
with this approach you can do much more. here's one additional command:
delay X (message);
when this message is processed, the engine will wait X number of seconds before processing the message within the parentheses. for example,
delay 4.0 (msg AI_killer (ag attack; trg player );
when this message is processed the engine will wait 4 seconds, then tell AI_Bob to add 'attack' to his list of goals and target the player. there are more commands, including loops, random trigger, and identifiable delays and loops, but i'm not sure if they were included in the AvP2 TRIGGER NOTES docs.
Triggers can get fairly complex?
This is just skimming the surface. Triggers define interaction in a map. Good trigger design make a game enjoyable. Partially its anticipating what the player will do, and what experience they will have, but it is also, setting a balance. The third Trigger tutorial will build on these concepts and the information in the docs.