Advanced Triggers
--------------------------------------------------------------------------------
 
Cold Front
cjames@henninger.com

While this process is not difficult, it is very complex. It contains many steps that you will have to follow in order to get your triggers working. I suggest that you download the map provided and follow along. If you can not have a browser open while in unrealed please print out this document. The first step should be to view the map in Unreal. This will allow you to have a sense of what you will be working with. When you start the map up, walk forward a little bit and you should notice a few things, these being: 

An earthquake 

Explosions 

A Screaming sound, and an earthquake sound 

Music 

On/Off lighting sequences 

All of these things were done easily using Triggers. 



Behind the Scenes:
In the map you should have downloaded I duplicated the geometry for you so you can try this yourself, with my setup as a reference. So before you do anything, CNTRL-drag the PlayerStart position (looks like a joystick) over to the empty hallway. The very first thing that you must do is lay down a main Trigger. To do this go to Classes -> Actor -> *Triggers ( If you don't know what Im talking about, come back to this tutorial when you are more experienced with UnrealED). Expand the *Triggers heirarchy and you should see "*Trigger" (no 's') with a white dash next to it. Click *Trigger once so that it is selected (don't open the heirarchy..do NOT add a ZoneTrigger, just *Tigger). Now, somewhere in the empty hallway Right-Click and choose, 'Add Trigger here' from the pop-up menu. You should see a black box icon. This is your trigger, and is what will set off a sequence of events if the player is within a certain radius of it. With open up your Trigger's properties. Expand the 'Collision' menu. Now notice where it says CollisionHeight and CollisionRadius. These are important factors as they decide how close to your Trigger the player has to get before it is set off. For the sake of this tutorial lets change the CollisionRadius to 240.00 to ensure we set it off in the hallway. 

Advanced Users Note: The 'Trigger' menu in properties usually doesnt need to be touched if you want just your player to set off the trigger, but if you want other items to set it off then change the TriggerType from TT_PlayerProximity to any of the other values such as TT_PawnProximity (Nalis, Skaarjs etc can set it off), or TT_Shoot (bullets, or any other projectiles can set it off) or TT_AnyProximity would allow just about anything to set the trigger off. 

Ok, with our CollisionRadius all set. Expand the '+Events' menu in the Properties window. You should see Event and Tag. These are vitally important. Im not going to give you the whys or whatfors, im going to tell you what value you spit in there and let you figure out how the correlate :) Ok for Event: put in 'MyTagName' (sans apostrophes of course). And for Tag: put in 'Trigger' (this value is really insignificant in this tutorial). Ok now, close that Properties window and save. 

The next step is to add your first event (the order that you add events really doesn't matter). This being the sounds that will be triggered. Under Classes->*Triggers highlight '*SpecialEvent'. Now add one of these to the hallway. This icon should look like your Trigger icon,but with an exclamation mark on it. Now open up the Properties of your SpecialEvent. Under the Events menu, set Event: to 'None' and Tag: to 'MyTagName'. I said I would go through all this but, basically the Event parameter is what is sent out when the Triggere is activated, and any items like earthquakes, or MusicEvents that have a Tag that is the same as the Event parameter, are activated! So because we are giving this SpecialEvent's Tag the same name as the Triggers event when ever the Trigger is activated it will activate the SpecialEvent. Get it? Didn't think so... :) 

Anyway...as soon as you entered 'MyTagName' as the Tag name you should notice that a red line now connects your Trigger and SpecialEvent. Now, still in the Properties window, under 'Object', change the InitialState parameter to PlaySoundEffect. Then, under SpecialEvent in the Properties window, change bBroadcast and bPlayerViewRot to False if they are not already. Then where it says Sound, choose the sound you want to play when the trigger is activated ( you should know how to do this), and click Use. I choose one of the screams from the Rikers set. 

Next, click on the SpecialEvent icon (the one with the exclamation point on it) and duplicate it once (another red line should connect the Trigger and this new duplicate). Keepal of the settings the same, except go back into Properties>SpecialEvent>Sound and choose one of the earthquake sounds from the AmbOutside set. 

Save your map. 

What you have now will work. As the player gets activates the trigger, you will hear a scream, and an earthquake sound. Lets not play it in unreal just yet, besides its all dark in your hallway right now anyway :) So lets spice things up some more and add Music! Under Classes->Triggers highlight '*MusicEvent', and place this somewhere in the hallway. The icon should look like a serpent's head. Open up the Properties of the MusicEvent, and make the following changes: Under Events, Event should be 'Trigger' and Tag should be 'MyTagName' (are you beginning to see how the whole tag thing works now?). Under MusicEvent, make sure that bAffectAllPlayers is True and that bSilence is False. If you want your song to keep repeating over and over mane bOnceOnly False. Still under MusicEvent, change Transition to MTRAN_Instant. The Transition parameter sets how the music comes in. A setting of Instant will make the music instantly come on, but you could also choose a slow fade or whatever floats your boat. Ok you should notice that another red line is connected from your Trigger to your MusicEvent icon. 

Now lets add an Earthquake! You can find Earthquake under Classes->*Keypoint->*Earthquake. Add one of these to your hallway. The icon should look like a black box with a key on it. Open up the Properties for the earthquake event, and make the following changes: Under Events, Event should be 'None' and Tag should be 'MyTagName'. Notice that I changed from using 'Trigger' as the event to 'None'. This is to show that the Event is not significant in the actions unless you want to have a chain. For instance say you wanted to have the Trigger activate a MusicEvent, and then you wanted the MusicEvent to activate an earthquake, you would just give. Trigger's Tag as IceTea,its Event as 'Coke'. Then the MusicEvent's parameters would be, Tag: 'Coke', Event: 'Pepsi', and the earthquake's settings would be Tag: Pepsi, Event: None. None becuase its the end of the chain and therefore useless. Not vital if you don't understand this yet. Ok moving on...



Under Earthquake's Properties, expand the Earthquake menu. Let me explain each parameter and you can fill in what you please: 

bThrowPlayer: If this is True then the player will be tossed all around the map during the course of the earthquake. if it is False, then the player's feet will remain planted while the world shakes so just the player's view gets a little shaky. 

duration: Numerical value in seconds of how long the shaking will last. 

magnitude: the ferocity of the earthquake, or in layman's terms, "how shaky that bitch will get" anything more than 3500 is pretty rediculous. 

radius: not exactly sure but most likely how large of a region around the earthquake event icon is affected. 

For the sake of this tutorial set the values to: True, 3.0, 1500.0, 300.0 respectively. (check the values on my side of the map if you are not sure). There should be another red-line connecting the Earthquake event and the Trigger. 



Now lets add some cool explosions. Under Classes->*Effects you should find '*ExplosionChain*' Place one of these in the hallway, a little farther away from the other events so the player doesn't get blown up :) Change the following in its Properties: 

Events->Event: 'None' Tag: 'MyTagName' 

Effects->bOnlyTriggerable: True, and None for both sound effects 

ExplosionChain: Damage 100.0 (this is how much health the player eats when this explosion goes off hear her). Delay time 0.3, Momentum Transfer 100000.0, size 2.0 

Great you should now see a red-line to the Trigger. Now duplicate this ExplosionEvent 2 times. Spread them out a bit like I did. Now we need to make a slight change in each of these 2. Open 1 of the duplicates up and change the ExplosionChain->DelayTime to 0.4 and the size to 1.0. Now open up the other duplicate and change the ExplosionChain->DelayTime to 0.5. 

Now for the tricky part! (heh!) Dispatchers! 

The concept behind a dispatcher is that you can save a lot of red lines on the screen :) I'll tell you what to do and then use what we've done to help me explain what a dispatcher is exactly, but by then it should be obvious. 

Ok, select a Dispatcher from Classes->Triggers->*Dispatcher and place 1 in the hallway. Now under the Dispatcer's Properties set the Events-> Event: to 'MyDispatcher' (again this could be anything), and Tag: to 'MyTagName'. Under Properties->Dispatcher you should see OutDelays, and OutEvents. Click on OutEvents. You have 7 events per dispatcher that you can assign and if you need more just fill one up with 6 events and make the 7th a call to another Dispatcher. Ok from 0 to 7 in OutEvents, fill in the following info: lights1, lights2, lights3, lights4, lights5, onlights1, onlights2, onlights3. Lights1 should be the 0 value and onlights3 should be the 7th. What are all of those values?!? Well, when you light your hallway these will be the Tags for the lights so you can control if the lights are on or off or not! Now, go to OutDelays: and make the values for 0-7 be 1.00. This value is in seconds and represents how long it should pause between excecuting events. like say I wanted there to be a 4 second pause before it executed lights1 and lights2, I would set OutDelays 0 to 4.00. Get it? Good. By changing all the values to 1.0 you are saying you want a 1 second delay between each of the lights turing on. 

Ok, now we need to place lights in the map. I want you to place them in the same areas I did in my side of the map. BUT WAIT! Do NOT place ordinary lights! You MUST go to Classes->*Light->*TriggerLight (now there are two of these, one with a dash, and one with out, it doesnt matter which one you choose, but for the sake of continuity, choose the one with the dash next to it). Now place a bunch of these lights in the same places I did. It's best to make one, put it where it should be near a torch, and then duplicate it and place it where it should be on the torch arcross from it. Before you do any duplicating though, make a master torch to make your duplicates from, and copy the LightColor values I have on my lights and the Lighting values so yours can be that nice firey orange with a wavy effect. You must set these values for all of the torches (or just that one master torch if you are going to be duplicating it): Under Properties: 

Object->InitialState: 'TriggerTurnsOff' (this setting is saying that we want the light to be on, and then be turned off when we activate the trigger). 

TriggerLight->bDelayFullOn: True 

TriggerLight->bInitiallyOn: True (here we are saying we want the light to start off on, this corressponds to the InitialState of the trigger that we set under Object) 

TriggerLight->ChangeTime: 0.0 

TriggerLight->RemainOnTime: 0.0 

Then select those two lights and duplicate a few times and place them on the torches. So you should have 10 TriggerLights each infront of a torch (like on my side of the map). Now select all 10 lights and with them all selected, open up the Properties for the lights and under Events, change Event: to 'None' and Tag: to 'lights'. Look at the map and see that the torches are divided up into 5 pairs. Well, each pair will be controlled by one of the 5 values from our Dispatcher! (Confused yet?!). So select the first two torches (and i mean torches facing each other), and under Properties Events: change Tag: from 'lights' to 'lights1'. Then select the next two torches and change their tag from 'lights' to 'lights2' all the way up until you have a pair with 'lights5' as a Tag. 

Almost done... 

Now make a nother TriggerLight by duplicating one of the torches...This time in properties change a few values as follows: 

Events->Tag: onlights 

Object->InitialState: 'TriggerTurnsOn' 

TriggerLight->bInitiallyOn: False 

Now, in my map, these lights were the red and blue ones that turned on after the map was dark. So duplicate the light you just made 5 more times and place it around the map in the same general area as I placed them on mine (so 3 pairs of lights across from each other). Now like we did before with the torches, we need to set the tags of these 3 pairs to work with the Dispatcher that we setup. So select a pair of the two floor lights you just made and set the tag to 'onlights1' and then with the next pair of floorlights set the tag to 'onlights2', and finally, to the third pair of floor lights set their tag to 'onlights3'. You can now select all 6 of those floor lights and add whatever kind of pulsating effects or colors you want, or you could just copy my settings ;-) 

You should be ready to rock! Rebuild the map, and make sure the PlayerStart joystick icon is on your side of the map. Now play that sucker and pray it worked :) 
