Example of a teleporter with effects that occur on entering.
If you've got any questions, leave them in the comments or contact me by other means.
Features
On entering, the teleporter:
- Plays a sound.
- Activates a fade effect.
- Telefrags anything in a volume around the destination.
Notes
- The scientist can be used to test the telefrag feature.
- The delays in the multi_managers may have to be tweaked for multiplayer to take latency into account.
- The teleport in this example wasn't designed to work for monsters or pushables.
Included map sources
How to add an effect?
In case you don't know how to make the teleport do something new, like adding a sprite flash at the destination point, you should read this.
There are two triggers on top of the teleport pad: a
trigger_teleport
- the wider one, and a
trigger_multiple
- the taller one. If you look at the properties of the
trigger_multiple
, its
Target
field is set to
tele_event
.
You may and should replace the names of these entities in your maps to longer, more specific ones, especially if you're using several instances of this teleporter. It will help you avoid name clashes.
All you need to do is give the entity you want to be triggered whenever the teleport is entered the same name as the one in the
trigger_multiple
's
Target
field.
You're free to also remove the existing effects. But be careful - one of the default multi_manager
's is used to trigger the teleport's multisource. You must not delete it nor the multisource, or the setup will not work properly.
For example, to add a sprite effect that flashes at the destination, you'll need:
- A
multi_manager
. - An
env_sprite
.
First, you need to set up the
env_sprite
:
- Place the
env_sprite
at the destination spot. - Open its properties.
- Give it a name and pick a sprite to use.
- Make sure you've set the
FX Amount
to a well-visible level and Render Mode
to the desired mode.
Next, you'll have to configure your
multi_manager
:
- Give it a name.
- If you're using a Hammer-like editor, turn SmartEdit off.
- Add new field using one of the buttons on the right.
- Set the name of the field to the name of your
env_sprite
. Set the value to 0
. - Add another field, with the same name as the previous. Set the value to a delay in seconds - this will determine how long your sprite flash will last. I'd go with a value of
0.1
or 0.2
. - Turn SmartEdit back on.
Compile and run your map, then test the setup out. In case it doesn't work, double-check - you may have done something wrong along the way. If nothing helps, leave a comment or contact me by other means.