UnrealEd 2.0 Mapping Basics - Triggers
Now we're going
to create a door - to
do that we will create a Mover and we will use a Trigger to activate
it.
After creating
another mover and
setting up its movement using the previously explained method we will
have to change some properities. Since we want a door (you can
of course add two movers that open in
opposite directions or even more complex doors with several pieces
that slide in different directions) we have to make it open before
a player touches it (otherwise it will
break the flow), so we have to change the InitialState to either
TriggerControl or TriggerOpenTimed.
Now we have to
add another actor, a
Trigger. You can find it in the Actor Browser under the Triggers
category. It's better to add in in the middle of the door (at floor
level), or in
the middle of the
doorframe if we have more movers.
A Trigger is an
object that generates
an Event (activates something) when something (generally a player)
enters in its radius. We will set up the door to open when a
player enters
in the Trigger's radius.
We can change
the Trigger's radius
altering the parameters CollisionHeight and CollisionRadius in its
Actor properities, under Collision (pretty much self-explaining). You
can check the
radius in the viewports
with the Actor > Radii View mentioned before.
Let's also give
an Event to the
Trigger, which is basically what will happen when a player will step
inside the TriggerRadius. To do so you just have to write something
(for example
"MyLittlePrettyDoor")
instead of None in the Event field under Events.
Now we have to
link the Trigger to our
door(s), so enter the Actor Properities of the Mover and write the
name chosen before for the Trigger's Event (in this case
"MyLittlePrettyDoor")
into
the Tag field under Events. A red line will appear between the two
objects, confirming you that they're linked. The red line is visible
only in
the 2D
viewports and in Wireframe mode.
Now when
someone will step in the
Trigger all the objects with the chosen Tag (in this case
"MyLittlePrettyDoor") will be activated. If we had a door
with multiple pieces
(multiple
movers sliding in different
directions) we will of course have to assign the same Tag to all
these Movers. And of course if you plan to have more than one door
in your map you
have to use different
Events, otherwise when you will touch one Trigger all the doors of
the level will open at the same time.
Maybe you're
wondering what's the
difference between TriggerOpenTimed and TriggerControl (the
InitialState of the movers): choosing TriggenOpenTimed will make your
door open, then it will stay open for the
whole StayOpenTime that you set in the Mover properities and then it
will close, ignoring players. With TriggerControl instead the Mover
will ignore the StayOpenTime and
will always stay open while there is a player in the Trigger's
radius.
Usually it's
better to use a
TriggerControl, since a door will almost never close while you're
trying to pass under it (it still can screw up sometimes when there
are
multiple
players in the area).
Try to place
the Trigger carefully - it
should allow players to travel comfortably through the door from
every location without bumping in it. It's also better to always
set a
ReTriggerDelay of 0.1 or less in
the Trigger properities (under Trigger), so if a door will close in
front of a player who was trying to go through it the trigger
will restart
almost immediately
(without ReTriggerDelay the player would have to exit the trigger
radius and re-enter it to activate it).
There are many possible settings for Movers and
Triggers - try to play around with them and you should get the hang of
Movers pretty quickly. The Event and Tag options are available for
every actor, but they act differently (most of the actors do nothing
when triggered). Experimenting is the best way to learn, although it takes time.
18. Conclusion
00. Back
to Start
|