WiseTele: Teleporting
This tutorial was originally created by wisemx. It was originally posted on SDKnuts.net.
Introduction
Teleports aren’t difficult to create and with a little imagination you can use them for interesting effects in your maps.
In this project the events are:
- Player starts out on Earth.
- Takes teleport form Earth.
- For 2 seconds is in a starfield.
- Ends up on the Moon.
- Can teleport directly back to Earth.
Creation
The teleport itself is a trigger, and is created like so:
- Create a normal brush textured entirely with
tools/toolstrigger
. - Press Ctrl+T and select
trigger_teleport
from the list. - Your new
trigger_teleport
doesn’t need any properties other than the Remote Destination. - If you will be sending commands to this
trigger_teleport
then give it a name, otherwise don’t name it.
The Remote Destination can be either an info_teleport_destination
or an info_target
. I prefer to use the info_teleport_destination
because it is more obvious when you are creating the map and you can preserve angles with it. Yes, preserve angles, to an extent. If you place the info_teleport_destination
upside down the player will come through the teleporter upside down. The info_teleport_destination
is placed in your map just like an info_player_start
, it even looks the same.
You can add sound events to your teleporters by using a named ambient_generic
. Assign a sound to the ambient_generic
then create an output from the trigger_teleport
.
My Output | Target Entity | Target Input | Parameter | Delay | Only Once | |
---|---|---|---|---|---|---|
OnStartTouch | Sound01 | PlaySound | 0.00 | No |
Also on your ambient_generic
, check the Start silent and Is NOT looped flags. I haven’t used any sounds in this project but I would use custom sounds for any teleporters in an actual map.
In this project I’ve added an env_starfield
for effect. I’ve also created a small, entirely black room outside the map for this env_starfield
. The interior of the 144x144x144 room is textured with halflife/black
. (Porter's note: I would recommend tools/toolsblack
instead. It has no $surfaceprop
, and VRAD won't waste time computing lighting for it.) I’ve placed an info_teleport_destination
in this room and two triggers.
Once the player is on the moon it’s important to stop the starfield at the right time or it will continue to show after the player has teleported. Just a simple matter of timing. The beams for the teleporters are an effect created with an env_beam
. The target for each env_beam
is an info_target
, which is the same entity can can be used in place of the info_teleport_destination
if you choose. Experiment with the properties on the env_beam
, you can achieve just about any effect you need with these.
In this project what I’ve created for the teleporters on the ground is a mixture of brushwork and props. These are the properties for each of the groups in this project.
Earth
The trigger_teleport
taking us to the starfield:
- Start Disabled: No
- Remote Destination: StarsDest
- Flag: Clients
My Output | Target Entity | Target Input | Parameter | Delay | Only Once | |
---|---|---|---|---|---|---|
OnStartTouch | StarsTele | Disable | 0.00 | No | ||
OnStartTouch | Stars01 | TurnOn | 0.00 | No |
The info_teleport_destination
for the Moon teleport:
- Name: DestEarth
Starfield room
The trigger_multiple
which enables the teleport trigger:
- Start Disabled: No
- Flag: Clients
My Output | Target Entity | Target Input | Parameter | Delay | Only Once | |
---|---|---|---|---|---|---|
OnTrigger | StarsTele | Enable | 2.50 | No |
The trigger_teleport
taking us to the Moon:
- Name: StarsTele
- Start Disabled: Yes
- Remote Destination: DestMoon
- Flag: Clients
My Output | Target Entity | Target Input | Parameter | Delay | Only Once | |
---|---|---|---|---|---|---|
OnStartTouch | Stars01 | TurnOff | 2.50 | No |
The info_teleport_destination
for the Earth teleport:
- Name: StarsDest
The env_starfield
effect:
- Name: Stars01
Moon
The trigger_teleport
taking us to Earth:
- Start Disabled: No
- Remote Destination': DestEarth
- Flag: Clients
The info_teleport_destination
for the starfield teleport:
- Name: DestMoon
If you are interested in creating random destinations for your teleports Edit Life has created a tutorial.
Update: I added two additional effects to the sample project below. Once you are on the moon all color will be gone and the gravity will be reduced.