trigger_changetarget
In this tutorial I will explain what does this entity does, how to use it, and demonstrate some of its many uses. You should know how to use multi_managers as we are going to use them a lot. The trigger_changetarget simply changes entities' targets and it is easily configured.
How to use the trigger_changetarget
This section is going to show how to change a teleport's destination. Changing any object's target is exactly the same as changing a teleports destination (eg. a path_corner/path_track's target is the next stop target and that's the way to change a func_train/func_tracktrain's path).
1) Create your trigger_teleport. I called it tele1.
2) Give the teleport a destination. I called the info_teleport_destination des1. Copy the destination and place it somewhere else in the map. I called the second destination des2. The trigger_teleport must target the first destination and not the second one.
3) Create your trigger_changetarget give it a name, in my case tct1. Make it target the trigger_teleport tele1 and in the 'new target' field write the name of the second destination des2. The target value is which entity's target is going to be changed and the new target value is which entity will be the targeted entity's new target.
4) Make a button/trigger(by that I mean a target_button/func_button/func_rot_button/trigger_once/trigger_multiple) that will target that trigger_changetarget.
When you will activate the trigger_changetarget it will change tele1's target to des2 but it can't be changed back to des1. In the next section I will show you how to make this process repeatable.

How to make the process repeatable
1) Create a multi_manger, I called it mm1. Make the multi_manger target tct1.
2) Create another trigger_changetarget and name it differently then the first one; I called it tct2. Make tct2 target the trigger_teleport ,tele1, and in the new target value write the name of the first info_teleport_destination des1.
3) Target tct2 with a second multi_manager, I called it mm2.
4) Name the button/trigger, I called it tele_button.
5) Create another trigger_changetarget, I called it tct3, make it target the button/trigger and make it change the button/trigger's target to the second multi_manager, mm2. Target tct3 with mm1.
6) Create another trigger_changetarget, I called it tct4, make it target the button/trigger and make it change the button/trigger's target to the first multi_manager mm1. Target tct4 with mm2.
7) Make the button/trigger target mm1 instead of tct1 (you can't use trigger_once if you want it to be repeatable).
We have a button/trigger that targets a multi_manager. This multi_manager targets a trigger_changetarget that changes the teleport's destination, and another trigger_changetarget that changes the button/trigger's target to a second multi_manager. The second multi_manager targets a trigger_changetarget that changes the teleport's destination back to the original one, and another trigger_changetarget that changes the button/trigger's target to the first multi_manager. This way you can make things that aren't repeatable, if you just target them, repeatable. For example make the multi_managers target env_renders instead of the trigger_changetargets (which changes the teleporter's destination) and you can make an object invisible and the other env_render will make it visible again.
To add more destinations Just make the trigger_changetarget that changes the button's target back to the first one change the button's target to a third multimanager. That multimanager will target also two trigger_changetargets, one will change the teleport's destenation and the second will change the button's target to the first or a forth one... and so on!
Disabling Objects With multisources
multisources can be used to disable any object with a master value. If you disable a button or a func_door/func_door_rotating it will sound it locked sound if you try using it. The entity won't move at all and the texture will change when it's disabled(If the entity is using a togglible texture).
1) Create your door.
2) Create a multisource. In the door's master value write the name of that multisource.
3) Create a button/trigger that will target the multisource.
Easy, isn't it? When the multisource is off you wont be able to open the door. The only problem is that if you going to target the multisource with more then one object you'll have to activate all the objects only then it will be triggered. There are two ways to fix this:
First Way
1) Make all the object that you want to target that multisource target a trigger_relay and make it target that multisource. You can set the trigger state if you want, off means it will only turn things off, on means it can only turn things on and toggle means it can only toggle things between on and off.
This way we made only one object trigger that multisource while all the other objects trigger it. If you will use a multimanager you can make the multimanager target many multisources at once.
Second Way
1) Create an env_global, name it, I called it dr_global, and make all the objects target it. In the global state to set value write anything that you want but make sure no other global has this global state, I wrote door_global. The trigger mode value has four options that
you can choose from:
- Off: the global will only toggle things off.
- On: the global will only toggle things on.
- Toggle: the global will toggle things from off to on or on and the opposite.
- Dead: for use with monsters.
The initial state value means that if the set initial state flag is ticked the global will start in the state you chose.
In the multisource's global state master value write the env_global's global state, door_global.
When the global is on the multisource will be on too and the opposite. There is one advantages for this method. The global can control entities across levels! Giving more multisources the same global state master makes the global control them all.
Disabling Objects With A trigger_changetarget
You can also disable a few objects with the trigger_changetarget, like buttons and triggers.
1) Create a button/trigger, name it, I called it lswitch, and give it a target, I targeted a light entity called light with it.
2) Create a trigger_changetarget, name it, I called it ltct1. Target the button with ltct1 and don't give it a new target.
3) Create another button/trigger and make it target the trigger_changetarget. Cause I wanted this button to shut down the power I also added a trigger_relay that it's trigger state is off and made it target the lights so every time I turn off the power the lights will turn off.
The trigger_changetarget changes the button's target to nothing so it wont activate a thing, buttons will act normally (move, make the normal sound, the texture will change). Use this method if you want to disable buttons and triggers. (not doors, trains, only stuff that trigger other things) Exceptions are: trigger_once for the trigger still works it just does nothing so after the first time it's triggered it won't be triggered again; trigger_teleport and the trigger_camera will not work either.
In the example map I made it repeatable, thats why you'll find two trigger_relays in there. One turning on and the other off.
Making multi-level elevators
I will show you how to make these now. Elevators that have more then two stops.
1) Create your elevator. Make it a simple 2 stop elevator- the first path target the second one and the second one targets the first.
2) Create another path that will be the third stop, don't target it with any path but make it target the second one.
3) Create two trigger_changetargets, make them both target the second path. Make one change the path's target to the lower path(I'll call this trigger tctlow) and the other will change the path's target to the higher
Path.(I'll call this trigger tcthigh)
4) Create two multi_managers. One will target tctlow and after a short time will target the elevator.(I'll call the multi_manager mmlow) The other one will target tcthigh and after a short time it will target the elevator.(this multi_manager I'll call mmhigh)
5)Create two buttons in the middle floor. The one that will make the elevator move up will target mmhigh and the other will target mmlow.
One of the buttons target a multimanager that targets the elevator(usually a func_train) and a trigger_changetarget. That trigger changes the path's target to a different path. The other button targets another multimanager that activates the elevator and another trigger_changetarget.
That trigger changes the path's target back. If you're in the middle but the elevator isn't just press one of the buttons. It will be activated, the fact that the path's target changes only matters if it moves from there. Make sure you tick the 'wait for retrigger' flag in the path's flags, or else it wont stop in that path.
If you don't understand anything here - check the example map, I did in there everything done in here, step by step... except for the last section (sorry for that)!
Example map http://twhl.co.za/mapvault_map.php?id=3480&dl=1