UDN
Search public documentation:
ExampleMapsTriggers
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
Triggers Example Map
Document Summary: An example map demonstrating how to use the various types of Triggers. Document Changelog: Last updated by Jason Lentz (DemiurgeStudios?) for creation purposes. Original Author - Jason Lentz (DemiurgeStudios?)Introduction
Triggers are actors in the level that send out "alerts" letting the game know that something has happened. There is a wide variety of types of Triggers and some Triggers are set up in special ways. This document will step you through the process of setting up each of the various types of Triggers. Note that there are two maps to download. The first map - EM_Triggers1.zip - demonstrates the basic triggers you can use and is designed for any 2226 build (such as UDNBuild2226 or CodeDrop2226). The second map - EM_Triggers2.zip - demonstrates TriggerConditions and will require Epic content from the CodeDrop2226 build. For more information on Triggers, see the TriggersTutorial.Example One: Triggers Map
The EM_Triggers1.zip file is a compressed archive that includes all of the triggers that do not require a pawn with some sort of firing weapon. It is designed for any 2226 build (such as UDNBuild2226 or CodeDrop2226).Trigger
This is the most basic trigger which you will most likely be using for most of your events. It is also required for some of the other Triggers to work (as seen in the next example). While this example map does not focus much on the generic Trigger, it is used several times through out the example map. The special Triggers that still require regular Triggers are the following:- MaterialTrigger
- MusicTrigger
- Counter
- ViewShaker
MaterialTrigger

- the textures to cycle through
- a MaterailSwitch material
- a regular Trigger
- a MaterialTrigger
- geometry to apply the MaterailSwitch material to
Setting up the Materials
After gathering the textures you want to cycle through, you will need to add them to a MaterialSwitch material. To create this material open the Texture Browser and select "MaterialSwitch" from the Properties pull down.

Setting up the Triggers
The generic Trigger is what actually activates the MaterialTrigger. Without it, the MaterialTrigger will not be activated. In this example map, the generic Trigger has the following fields changed from its default:Section | Property | Value | Explanation |
---|---|---|---|
Events | Event | MaterialTrigger | This is set to the tag of the MaterialTrigger. |
Trigger | ReTriggerDelay | 2.0 | This keeps it from activating the trigger too quickly. |
Section | Property | Value | Explanation |
---|---|---|---|
Events | Tag | MaterialTrigger | Make sure this matches the Event of the generic Trigger. |
MaterialTrigger | MaterialsToTrigger | select your MaterialSwitch | Select your MaterialSwitch material in the Textures Browser and then hit the "Use" button . |
LineOfSightTrigger
A LineOfSight Trigger will cause an Event to happen once a line of sight can be established between the player and an Actor. Note though that much of the functionality of LineOfSight Triggers appears to be missing. Currently (build 2226) LineOfSight Triggers have the following restraints:- It only works in single player mode
- It only triggers once
- The "line of sight" only works between the player and the LineOfSight Trigger
Section | Property | Value | Explanation |
---|---|---|---|
Events | Event | LOSemitter | This is set to the tag of the particle system that will be triggered. |
LineOfSightTrigger | MaxViewAngle | 180 | This was increased so that it will be triggered from any viewing angle |
SeenActorTag | LineOfSightTrigger | Make sure this is the same as its own Tag (it's the only way I could get it to work). |

MusicTrigger
The MusicTrigger also must be activated by a generic Trigger. A MusicTrigger has the ability to fade in and out an .ogg file. To set up a MusicTrigger you will need the following:- a MusicTrigger
- a generic Trigger (or something that calls out an Event)
- an .ogg file located in the Music folder

Section | Property | Value | Explanation |
---|---|---|---|
Event | Tag | MusicTrigger | This is just left at its default setting. Just make sure that it matches the Event of whatever is calling it. |
MusicTrigger | FadeInTime | 2.0 | The song will fade in over 2 seconds once triggered. |
FadeOutTime | 5.0 | The song will fade in over 5 seconds once triggered. | |
Song | StageMusic | This is the name of the .ogg file minus the extension. It is important to leave off the extension and also to have this .ogg file located in the Music folder of your game. |
Section | Property | Value | Explanation |
---|---|---|---|
Events | Event | MusicTrigger | This must match the MusicTrigger's Tag. |
Trigger | ReTriggerDelay | 5.0 | This is a generous delay that prevents the Trigger from being reactivated too quickly. |
Counter
The Counter Trigger is another trigger that requires additionally generic Tiggers to activate it. A Counter Trigger will wait until it hears so many other trigger activations until it activates its own event. Here you can see the three generic Triggers that all send out an event to the Counter Trigger
Section | Property | Value | Explanation |
---|---|---|---|
Event | Events | Counter | This is the tag of the Counter Trigger. |
Trigger | bTriggerOnlyOnce | True | This ensures that you have to hit each of the three triggers. |
Section | Property | Value | Explanation |
---|---|---|---|
Counter | NumToCount | 3 | This is how many times the Counter is listening for other Trigger activations. |
Events | Event | Done | This sends out an event to the large Mover platform that raises the player up. |
Tag | Counter | Make sure this matches the tag of whatever event you wish to trigger after all three generic triggers have been activated. |


UseTrigger
A UseTrigger is a trigger that allows the player to determine when they want to activate something as long as they are in the collision cylinder of the UseTrigger. In this example map, a UseTrigger is used to activate a Mover causing it to move from one side of the room to the other. All that is need is the UseTrigger and the Mover.
ViewShaker




Example Two: Triggers Map
The EM_Triggers1.zip file is a compressed archive that contains a map which demonstrates TriggerConditions and will require Epic content from the CodeDrop2226 build. As mentioned above, this map (created by Chris Linder) requires Epic content from the CodeDrop2226 build.TriggerCondition
TriggerConditions allow you to control AI with Triggers. In this example there are two rooms each with a Trigger, TriggerCondition, and an Pawn with an AIScript. The room on the left (in which you start) shows a Pawn that will run back and forth between two points only when a player is standing on the Trigger. The second room on the right has a pawn with a behavior that can be toggled on and off. Here is how these Trigger conditions were set up.TriggerCondition 1

- A Pawn (the WarCOGMedic)
- Two PathNodes for the Pawn to travel between
- An AISCript with a series of AIScript Actions
- A TriggerCondition
- A Trigger


TriggerCondition 2
In the second room, the Pawn will continue to run back and forth between the two PathNodes until the player toggles the trigger. When the Trigger is turned on, a TriggerLight is activated and the Pawn will pause and play an animation when it is under that light. The Pawn will continue to run back and forth playing this animation until the Trigger is toggled back, then the TriggerLight will turn off and the Pawn well return to just running back and forth without playing the animation. All that is needed for this is everything listed above and a TriggerLight. Below you can see how the AIScript and TriggerCondition are set up for this example.

