Forcing players on one team?

Muenster Monster

L1: Registered
Apr 22, 2018
34
6
Hello, I'm creating a jump map, and I mostly need general help, since I haven't done this before. Right now though, my question is whether or not it's possible to force players on one team in hammer, and if it is, how.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
Yes it is.

Simply place a 'trigger_hurt' over your spawn points, add a 'filter_activator_tfteam' and a 'point_clientcommand' somewhere in the map.
  • Give the 'filter_activator_tfteam' a name like 'Flt_Blue', the team to the one you don't want to use, and filer mode to 'Allow'.
  • Give the point_clientcommand a name. I like simply 'Clientcommand'
  • Set the damage on the 'trigger_hurt' to anything over 450 (enough to insta-kill an overhealed heavy). Then set it's filter to your named 'filter_activator_tfteam'
Then go to your trigger_hurt's 'Outputs' tab, and give it the following outputs:
Code:
OnHurtPlayer > Clientcommand > Command > jointeam red > 0.00
OnHurtPlayer > Clientcommand > Command > join_class soldier > 0.10
What this will do is make a zone that will kill any blue player that enters it. When it kills them, it will make the player join the other team and then a fraction of a second later select the Solider as their class.

ALTERNATIVELY!

You could just use 'trigger_add_tf_player_condition' brushes, with the condition set to number 51 - 'TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED'

This would give all players in the within the brushes the same uber effect the bots in MvM have when still in their spawn area. That is, they will look normal unless shot at at which point their uber will flash for a second. The player them-self will see the uber effect permanently which will help them know when they are protected or not.

This option would allow both teams to share the space without being able to kill each other, though they will still take knockback from thing like airblasts.
 
Last edited:

Muenster Monster

L1: Registered
Apr 22, 2018
34
6
  • Give the 'filter_activator_tfteam' a name like 'Flt_Blue', the team to the one you don't want to use, and filer mode to 'Allow'.
  • Give the point_clientcommand a name. I like simply 'Clientcommand'
  • Set the damage on the 'trigger_hurt' to anything over 450 (enough to insta-kill an overhealed heavy). Then set it's filter to your named 'filter_activator_tfteam'
Then go to your trigger_hurt's 'Outputs' tab, and give it the following outputs:
Code:
OnHurtPlayer > Clientcommand > Command > jointeam red > 0.00
OnHurtPlayer > Clientcommand > Command > join_class soldier > 0.10
Thanks! I'm sure that it should work, but jointeam doesn't appear to be a valid command, resulting in the trigger just killing the soldier. Do you know of any command that forces the player to switch teams? I searched for it but couldn't find it.
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
Thanks! I'm sure that it should work, but jointeam doesn't appear to be a valid command, resulting in the trigger just killing the soldier. Do you know of any command that forces the player to switch teams? I searched for it but couldn't find it.
jointeam is the correct in game command. Any other command you might be thinking of would probably be a sourcemod command such as 'sm_team'

When you say it doesn't appear to be a valid command, what is actually happening? What is it saying in your console?
 

Muenster Monster

L1: Registered
Apr 22, 2018
34
6
Never mind, I'm just stupid and put the filter on the wrong team. I also thought it wasn't a command due to the fact that there were no suggestions for it when I typed it in the console. Everything's working fine now!
 

ficool2

L4: Comfortable Member
Oct 28, 2017
161
232
jointeam seems to be blocked on multiplayer servers by point_clientcommand though