E-mail: EZkeel
Accompanied files : Triggers.UNR
Contents
1)
Basic_Principles
2)
Ordinary_Trigger
3)
Biofear and Fearspot
4)
Code Trigger and Elevator Trigger
5)
Counter
6)
Dispatcher
7)
Distance View Trigger
8)
Fade View Trigger
9)
Fatness Trigger
10)
Jumper
and Kicker
11)
Music
Event
12)
Round
Robin
13)
Special
Event
14)
Stochastic_Trigger
15)
Translator
Event
16) Team
Trigger
17) Timed
Trigger
18) Zone
Trigger
19) Triggered
Death
20) Triggered
Texture
21) Movers
20) Pawns
Introduction
During a level, several
things should happen to a player to make the game interesting and not just
a scenic stroll around a new world. Doors, sudden alien ambushes, moving
spacecraft, puzzles and all manner of different scripted events need to
use some form of trigger.
In brief, a trigger is an "actor" (one of the classes from the "ActorClassBrowser"), or a brush which primarily uses two things: "Events" and "Tags". The event is what you want to happen and the "Tag" is what you want it to happen to. For example, in a level, you might push a button that opens a door.The button would have an "event" called "opendoor", and the door itself would have a "Tag" called "opendoor". So when ever the button is pushed it sees the event is called "opendoor" and looks for any tag that matches that and executes that item's command. It is also possible to have several items that all have the same tag.When that tag name is called on, all of them will respond. I don’t know what all of the triggers do and how they work, but I can share what I do know.
That is the basic principle
of the trigger.
This is the first one you need to know about and is simple to grasp. All the other trigger functions use these properties, but with other functions added. (Make sure you select the Trigger which has the 3 other subclasses and not the main one).
To get an ordinary trigger to do something click on the trigger and bring up the properties box (F4). Under the property called "Events" you find two fields, "Event" and "Tag". Under the field called "Event" type in the name of the Tag for the item(s) you want to effect. (If in doubt see the example map).
By default, this trigger
will operate when a player runs into it, but altering the properties can
change this. Go to "Objects" and
then click on "Initial State"
and you will see the follwing options:
Other Trigger Turns Off:
This trigger remains active
until a different trigger acts on its "tag" and switches it off.
Other Trigger Turns On:
As above but another trigger
causes this one to become active.
Other Trigger Toggles:
The trigger will be switched
on and off like a light switch each time another trigger acts on it.
The above options tell Unreal how the trigger is operated, but you can also tell it who or what can act on it. Click on "Trigger Type" in the options property and you will see another list of options appear as follows:
Player Proximity:
This is the default setting
and the trigger can only be activated by the player.
Pawn Proximity:
Any pawn, such as the player,
A Skaarj, or even a rabbit can set this trigger off.
Class Proximity:
This broadens it even further.
Any class can activate it.
Any Proximity:
Speaks for itself. If anything
comes near it (apart from another brush I think) it will be triggered.
Shoot:
The trigger will only activate
when a projectile hits it.
I'm not sure what the difference
is between these two triggers but they appear to do the same thing! These
triggers creates an area which other pawns are scared of and so will avoid.
4) Code trigger and Elevator Trigger
The code trigger has something
to do with Elevator triggers apparently, though I’m not sure what!
The elevator trigger is
a very useful trigger to be used with an "Elevator Mover". In
this trigger you
can tell the elevator mover
to move directly to any one of its keyframes.
see also the tutorial on
MOVERS
This is a very useful trigger. Each time it is triggered, it will increment its count by one until it reaches the number specified by you in the "NumToCount" field. When it has finished counting it will then trigger of another event (in its "Event" field). This is very useful for puzzles.
For Example:
You can have 5 triggers
set up so that their "Event" property is linked to the "Tag" property of
your counter. These triggers can then be set off in any order, but the
counter will not trigger off anything else until the other 5 triggers have
been activated.
If you want the player to
know what’s happening set the "bShowMessage" field to "true" and then use
the "CompleteMessage" and "CountMessage" to say whatever you want. (%I
is the current number that the counter has reached).
In my opinion this is the
most useful form of trigger. There will be times when you need to script
a particular event, and you will need several things to happen in sequence,
or all at the same time. The example on the left will give you an example
of how this works. In the "OutEvents" properties, you can type in your
various events, and the dispatcher will run through each of these in order.
In the "OutDelays" you can tell the dispatcher at want point in time to
introduce each event. In this example an explosion occurs followed by an
earthquake and a rumbling noise 1 second later. 4 seconds after that debris
is triggered to fall. 2 seconds later all the lights go out and 6 seconds
after that screams can be heard. Take a look at the sample map if you need
to experiment with it.
When this is triggered, it
will alert all pawns within its specified radius. You can change the radius
of your trigger by adjusting its "collision" properties. By default this
will be 40 but you can increase this if you like. If you want to see how
far the scope of the radius extends in your top view 2D grid all you need
to do is right click in a blank part of the window's menu (perhaps next
to the little icon that looks like a joystick) and select "actors" and
the choose "radii view". You should see a red circle around the trigger
showing how far its reach extends.
This is probably used most
for assault maps when the game is complete but could be very useful for
SP levels too. When triggered it will fade the screen out slowly to blackness.
You can specify the amount of time it takes to do this by adjusting the
figure in its "FadeSeconds" field under the "FadeViewTrigger" section of
the trigger's properties.
9)
Fatness Trigger
I suspect this has something
to do with altering the "fatness" of a particular actor in its display
property.
(e.g. The Nali fatness reduces
in size when it teleports away in single player). However, I have never
been able to get this to
work!
10)
Jumper and Kicker
Again, I'm not certain what
the difference is between these two triggers but they appear to have the
same function. When a pawn hits this trigger, it will jump (duh?). (Useful
for getting monsters to jump off ledges).
11)
Music Event See tutorial on MUSIC
This trigger has a long list
of "OutEvents" each of which can contain a different Event. Everytime the
RoundRobin is triggered it will activate the next Event in its sequence.
If the "bLoop" field is set to "true", it will do Event 0 after the last
specified Event and continue to cycle in this way. If "bLoop" is set to
"false" (by default), it will finish at the last specified EventAt this
point if there is a Tag specified in its normal Event field it will activate
that one.
This is a very useful trigger and can be used for a variety of different effects. Other triggers operate this trigger rather than the player walking in to it, so you will need to give it a "Tag" name (e.g. "effect"). Set up an ordinary trigger as listed in section 2 and call the "event" of that trigger "effect".
To use it, place this trigger
in your world and bring up its properties. Click on "Object" and then on
"Initial state".
You will see a variety of
options which you can use. Here's what they do:
PlayerPath
Player path is used for
"interpolation" which is used for flybys (like the Unreal opening sequence)
or cut scenes. This will be covered in a future tutorial.
PlayAmbientSoundEffect
For triggered sounds that
you want to stay permanently on (e.g. turning on a piece of machinery)
choose this option.
All you then need to do
is choose your ambient sound and place it in the "Sound" field uner the
"SpecialEvent" section (not the usual sound section)
PlayersPlaySoundEffect
For one-shot triggered sounds
that sound as if they come from the player (e.g. speech) you need to choose
this option. The sound will always eminate from the player rather than
from the trigger. All you need to do then is choose your one-shot sound
and place it in the "Sound" field uner the "SpecialEvent" section (not
the usual sound section)
PlaySoundEffect
For one-shot triggered sounds
(e.g. a distant explosion) you need to choose this option. All you need
to do then is choose your one-shot sound and place it in the "Sound" field
uner the "SpecialEvent" section (not the usual sound section)
KillInstigator
Choosing this option will
cause whoever triggers the special event to die instantly. This is good
for laser beam forcefields and similar things.
DamageInstigator
Similar to the KillInstigator
option but just wounds whoever triggers it by the amount specified in the
damge field.
DisplayMessage
Using this will display
a message in white text in the corner of your screen. Just write your message
in the message field.
Changing "bBroadcast" to
true will cause the message to bleep and display it in blue text in the
centre of the screen to all players.
NOTE: If you're not familiar
with how to use sounds then See the tutorial on SOUNDS.
This will enable you to perform
random events at random times. Just add the events that you want in the
event fields. It works
in exactly the same way
as the "DynamicAmbientSound" actor which you can read about in the SOUNDS
tutorial.
This is the particular trigger
you need to give the player a message during a single player game. These
are triggered as soon as a player walks over them. Make sure they’ve been
given a translator device at the beginning of your level. Once you’ve added
this trigger to your world, bring up its properties and click on "translator
event" and you will see some more options appear where you can type in
a message.
This is used for team games. When triggered it will trigger all pawns in the game apart from the pawns in the team number specified by the trigger.
I used to use a Dispoatcher for this function as events can be timed using that trigger. The "Timed trigger" does simplify matters though and has one other useful function. When triggered, it will wait for the amount of seconds specified in the "DelaySeconds" field before it triggers something else (specified in its own event field). The extra useful function that a Dispatcher can't do is loop itself. If bRepeating is set to true, the timed event will be triggered after the same amount of time again and again.
Used to trigger an event
when a zone is entered. See the tutorial on ZONES
to find out what they are if you don't know.
19)
Triggered Death
When a pawn (including your
player) hits this trigger, they die immediately.
Useful for electrical force
fields, rocket thrusters and that sort of thing.
Useful for those moving banners
that you see in Death match levels. I'll be submitting a specific tutorial
for this in the future.
21) Using a mover as a trigger.
In the same way any trigger can activate something else with its "Event" property, a mover can do exactly the same thing. Just put the "tag" name of the item or trigger you want to activate in the "Event" property of your mover, and when your mover finishes its moves it will activate the other item.
See the tutorial on MOVERS for details.
22) Using a pawn as a trigger.
This will be useful mostly for SP levels. There are several ways a pawn can activate a trigger. See the tutorial on Creatures over at Unreal Technology for more details, but in short, here they are.
a) Use alarm points to guide your monster to the trigger you want to be activated and set the triggers "Triigertype" attribute to TT_PawnProximity. Or you can also set the event field of any of the alarm points your pawn reaches.
b) The monster’s "Event" field can be used as a trigger when it dies.
c) The "PlayerFirstHateEvent"
can be used as a trigger when a monster first becomes aware of a player.
EZkeel
(Simon West-Bulford)