Triggers help involve the player with interaction.
Adding triggers is simple enough, messaging them to do interesting things is the real challenge. First thing you do is start up Dedit. Double click on the Dedit.exe. At this point you just have a map editor. Click, file, and open a world using the WORLDS TAB. Go to World, and click on the menu item ADD an OBJECT,
As you scroll through the list, you will come across Trigger, select it. A trigger object will be placed at the triple mark cursor. This trigger object default to a dimension of 16 16 16 dedit unit. While still highlighted if you click on properties, you can change the dimensions or dims, simply click on the field and change the numbers. Triggers will be invisible in game, they merely define an area where they trigger events when the bounding box of the player, or the bounding box of the AI make contact with that area.
So say you wanted to have a door open when you approach it. First off you have to create the door. (check the other tutorial) What is important is the name of the door. Let's assume you will create a sliding door, and it will be called Door27. Now you place a trigger object directly in front of
the door, with a dimension of 64 64 64. Triggers default to being PLAYER triggerable. The other important thing to set is the "number of activations". If you set this number to "0" there will be infinite triggers.
So far this is the basic set up, now we need to set the target. So in the propeties tab, find the target button and click. You'll see that there are multiple fields for multiple targets, and the developers have already graciously typed TRIGGER into the first one. We'll start with a simple message.
Ignore the other ones for now.
When the players bounding box intersects with the trigger area the door will open. You should place a 5 second delay on the trigger object before it can be activated again. Otherwise the message will keep being sent and cause jittering effects. Always take advantages of the question marks in the properties tab. Right Click and you'll get a description of what that property can do.
Let change it a bit.
Triggers default to being PLAYER triggerable. But in our case now we would probably want AI to be able to open the door as well, so if we look at the properties tab we'll set AI triggerable TRUE as well.
Now when the AI run to the door to chase the player, the door would open. You could also give the AI a script at the door so it looks like he pushed the switch for the door to make it open.
You have additional options. The trigger can be set; LOCKED=TRUE
When you LOCK a trigger, you can then send a UNLOCK message to it once an event happens.
The Trigger Object has various subsets. I'll discuss the EXIT trigger in the Single Player Tutorial. And the Laser trigger is a left over from NOLF's infrared sunglasses that can work but really isn't supported the way it was in nolf, in that you could see them in game with the special sunglasses gadget.