Forcing players on one team?

Discussion in 'Mapping Questions & Discussion' started by Muenster Monster, Apr 28, 2018.

  1. Muenster Monster

    Muenster Monster L1: Registered

    Messages:
    34
    Positive Ratings:
    4
    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.
     
  2. Werewolf

    Werewolf Probably not a real Werewolf

    Messages:
    872
    Positive Ratings:
    278
    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.
     
    • Thanks Thanks x 1
    Last edited: Apr 28, 2018
  3. Muenster Monster

    Muenster Monster L1: Registered

    Messages:
    34
    Positive Ratings:
    4
    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.
     
  4. Werewolf

    Werewolf Probably not a real Werewolf

    Messages:
    872
    Positive Ratings:
    278
    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?
     
  5. Muenster Monster

    Muenster Monster L1: Registered

    Messages:
    34
    Positive Ratings:
    4
    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!
     
  6. ficool2

    ficool2 L4: Comfortable Member

    Messages:
    158
    Positive Ratings:
    159
    jointeam seems to be blocked on multiplayer servers by point_clientcommand though
     
  7. Werewolf

    Werewolf Probably not a real Werewolf

    Messages:
    872
    Positive Ratings:
    278
    It's controlled by a CVAR, 'sv_allow_point_servercommand'

    That need to be set to "always" for it to work.
     
  8. Muenster Monster

    Muenster Monster L1: Registered

    Messages:
    34
    Positive Ratings:
    4
    I already have it set in my autoexec, so everything should be fine
     
Tags: