Hammer - Teleport only the !activator player


I have a problem I can’t solve alone…
I want to create a teleporter (it’s in a moving vehicle), which teleports the player ~50 units above. I tried to do the normal trigger_teleport setup, but it teleports everyone who is inside the trigger. I tried to use the “AddOutput origin X Y Z” method, but I can only use predefined coordinates, and the vehicle is moving…

I would appreciate any help!

[editline]30th September 2014[/editline]

An ugly solution would be to not teleport the player, but an entity which is teleportable (like a prop_dynamic). When the player presses the button, he gets parented to the prop_dynamic, and as the prop_dynamic gets teleported the player gets too (Or doesn’t?). Anyways, I don’t want to use a solution like this… But if there is no other way…

you really don’t want to parent players to other objects. source doesn’t like that.

so as I understand it, you want only the player who presses a button in a vehicle to be teleported?

you could set it up something like this:

OnPressed !activator AddOutput targetname teleportdude

the trigger_teleport should be filtered to a filter_activator_name with Filter Name = teleportdude

once the player has been teleported, name him something else so that if he enters the trigger volume again, he isn’t immediately teleported. (as a general practice, it’s a good idea to lock the button during the brief period that all this is happening, so another player doesn’t interfere)

also keep in mind that targetnames of players are persistent between rounds in games like CS:S, so you should use a logic_auto which resets custom targetnames that you may have applied to people during the previous round. this is just to be extra sure that you won’t get any unexpected behaviour, but I’m paranoid like that.

Thanks, it’s working! I didn’t know changing targetnames was possible in the game!

edited out because i am stupid