player count in area

Discussion in 'Mapping Questions & Discussion' started by Pacifist, Jun 21, 2010.

  1. Pacifist

    Pacifist L1: Registered

    Messages:
    12
    Positive Ratings:
    0
    Hi Guys. I have a problem I am trying to work through.

    I have a map, in a area of the map I want to allow only a certain amount of player from a team. Extra players will trigger a hurt that will last till the numbers go down.

    lets say. 3 players

    In this area, 1, 2, and 3 players will be fine.

    if the number goes to 4 or higher, every in that area takes damage until someone dies to reduce it 3 or lower, or leaves the area.

    Can you guys help me out.

    *S*
     
  2. Bermuda Cake

    Bermuda Cake L9: Fashionable Member

    Messages:
    679
    Positive Ratings:
    192
    I think I know how you can count up to four people, but killing only one person might be harder...

    The way I would do it, would be to have a trigger_multiple in your room, as well as a math_counter. You're gonna want to double click on the math_counter, give it a name like player_counter, and then define Case01 as 4.
    Then, go to each trigger_multiple, and have an ouput, OnStartTouchAll, player_counter, Add.

    That'll add one to the counter each time someone stands in it (but it does mean people will be able to trip it more than once if they leave and re-enter). Then, double click on the math_counter, and have an output, OnCase01, and that's where this falls down. There's no way to only kill some people and keep others alive, unfortunately.

    There are work arounds that don't need to kill people, though. You could spawn three people only in the room, and then disable the spawn points after they've spawned, or have a door into the room that only opens three times. People usually find a way around that sort of thing though...
     
  3. Pacifist

    Pacifist L1: Registered

    Messages:
    12
    Positive Ratings:
    0
    Never mind I figured it out.

    Trigger_multiple with filter for red team.
    on start touch math counter add 1
    on end touch math counter subract 1

    math counter
    outvalue to logic-case invalue

    logic case on 0 set hurt damage value 0
    on case on 1 same thing
    on case on 2 same thing
    on case of 3 same
    on case 4 set hurt value to 10

    as soon as one dies the math counter re triggers and resets the case for the logic to turn off the hurt.

    The reason I need this is I am making a map that will allow people to spectate in the "bleachers" while a certain number of players on each team battle in the main area.

    If someone tries to sneak onto the court, the team with the extra player takes damage until one dies or they get the noob off the court.

    LOL i love it.
     
    Last edited: Jun 21, 2010
  4. Dr Forrester

    Dr Forrester L2: Junior Member

    Messages:
    60
    Positive Ratings:
    22
    ah... was wondering what you were going for there...

    was going to suggest the exact same solution you came up with yourself, but got stuck doing server admin stuff.

    Hmmm.... I might just use this for something else...:lol:
     
  5. Pacifist

    Pacifist L1: Registered

    Messages:
    12
    Positive Ratings:
    0
    lol hey forrester. Yeah go ahead and use it.
     
  6. Pacifist

    Pacifist L1: Registered

    Messages:
    12
    Positive Ratings:
    0
    hmmm you know a trigger multiple can be confused. say you get many people at the same time in there, or before it can re trigger. Is there another trigger that can be used that can thse jsut set the value to the math counter instead of add subtract.
     
  7. Prestige

    aa Prestige im not gay anymore

    Messages:
    1,769
    Positive Ratings:
    1,517
    that would make a cool special infected in L4D2 to get you to spread out......
     
  8. Pacifist

    Pacifist L1: Registered

    Messages:
    12
    Positive Ratings:
    0
    well I am going to stick with trigger_mutiple, though I do not like only add , subtract, instead of keeping an accurate account. I was hoping capture area might work, but Its a bit complicated for that.
     
  9. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,516
  10. Exist

    Exist L6: Sharp Member

    Messages:
    306
    Positive Ratings:
    112
  11. Pacifist

    Pacifist L1: Registered

    Messages:
    12
    Positive Ratings:
    0
    thanks guys. The problem with game zone player, is it counts the dead players as well. I can't have corpses being counted, it would slow the flow of people getting on the court. As for trigger multiple, it has a problem with teleporting off, it does not count you as leaving. I found a way to correct that. Kill and respawn the math counter on resets.

    But the problem is fully solved. Thanks for the help. :)