Change Player Class Trigger

Discussion in 'Mapping Questions & Discussion' started by SilverVayne, Jun 28, 2014.

  1. SilverVayne

    SilverVayne L1: Registered

    Messages:
    2
    Positive Ratings:
    0
    I want to make a dodgeball area and boxing area on the same map.
    The Dodgeball Area needs to force players to be pyros while giving them all infinite ammo. It also needs to negate all damage except damage taken by critical rockets.
    The Boxing Area needs to restrict all classes to their melee weapon.
    I am running Source Mod and feel I'll need to use it to accomplish this, but just can't figure it out. Any ideas or known fixes? Thanks!
     
  2. The Asylum

    aa The Asylum

    Messages:
    1,658
    Positive Ratings:
    439
    With regards to forcing all-pyro, what you'd need is a point_clientcommand, set to fire a class change command to Pyro (though I don't know what the exact string is, I'm a HUD using philistine). Make sure your trigger volume for this output is encased in a respawn room brush, as it will force players to respawn

    Now if you're wanting to restrict melee-only weapons in one area of the map and still want players to be able to use any weapon elsewhere on the map at the same time, unfortunately you're going to have to use a plugin, as all mapside weapon stripping affects all players, regardless of who or what triggers the stripper output.
     
    • Thanks Thanks x 1
  3. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,219
    Heh. "Stripper."
     
    • Thanks Thanks x 3
  4. SilverVayne

    SilverVayne L1: Registered

    Messages:
    2
    Positive Ratings:
    0
    Can you elaborate on encasing the trigger volume within a respawn room brush? What it does and why it does it. Also, does it have to be the original respawn room brush or just use a secondary one? What happens if I don't encase it?

    For the melee only, I've found I can use a trigger_multiple to send a command of slot3 to force weapon change to melee. However, if the player doesn't use hud_fastswitch 1, then they will be stuck with their weapon pane open at the top. I plan to use either "hud_fastswitch 1;slot 3" or put a custom texture telling players to enable Fast Weapon Switch from their options so that I'm not changing people's settings without their knowledge. Does this sound plausible? The trigger_multiple will keep the commands going so nobody can switch to anything else, right?
     
  5. The Asylum

    aa The Asylum

    Messages:
    1,658
    Positive Ratings:
    439
    If you have a trigger_multiple send a point_clientcommand a change class output, it will force whoever triggers it to switch classes on the spot. Doing this outside of a respawn room brush assigned to the player's team will cause the player to suicide. You can have multiple respawn room brushes in your map

    It'll also sometimes delay the firing speed (or swing, in this case) of the melee weapon slot, if it starts conflicting with being forced to switch while trying to swing. Believe me as the maintainer of Melee Fort, if there was a way to enforce melee-only rules without interrupting player input and NOT use potentially crash-inducing output strings, I'd be using it already.