Teleporter for specific classes

Oct 6, 2008
1,948
446
Hi,

I'm looking at doing another game mode and want to have engineers (only) teleport to a tower at either end of the map - can this be done?

I'm also looking at if func_breakable breaks at location A (somewhere on the map) - I want it to respawn at location B (it's original starting point)

Anyone know if this can be done?
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,258
999
Hi, Bug.

Unfortunately there is absolutely no way to filter players by their TF2 class. That data is not given to the logic system. Your only solution is to make a trigger that sends an output to a point_clientcommand to force the player to switch to the class, using the join_class command.

You can respawn entities using the point_template entity. You can teleport entities using the point_teleport entity. The point_teleport should be placed at the destination. Its origin point in the world will be used by the func_breakable when it appears. Likely what you'd do is build your breakable in its original location and teleport it to location A. After it breaks and you respawn it, it will appear at location B, where it was in Hammer.
 

sniperstyx

L1: Registered
Nov 16, 2018
27
3
Unfortunately there is absolutely no way to filter players by their TF2 class.
I've seen a map called "idle_awesomebox" or something similarly named where, for example, going with the heavy class into the teleporter for a sniper arena, it won't let them enter it unless they're a sniper. Same goes with the teleporter for dodgeball (it has a dodgeball arena where soldiers get teleported above the arena so they can shoot rockets at the pyros that get teleported below, on the field).

You can find this version of "idle_awesomebox" in a UGC server (make sure it has teleports near the door from the point between the spawns and the skybox looks like space).

Edit 1: I'll try to make a prefab containing the entities that only allow specific classes to get teleported to certain areas once I decompile the previously mentioned map. When I am certain that the prefab works, I'll attach a .vmf file to this reply.
 

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,258
999
You don't need to decompile anything or make a prefab. There's an entity that lets you filter players by their class. It was added after I made that post in 2015!