Counting people in an area

Discussion in 'Mapping Questions & Discussion' started by DeOntwerper, Apr 11, 2015.

  1. DeOntwerper

    DeOntwerper L1: Registered

    Messages:
    46
    Positive Ratings:
    1
    Heya there,

    I am just wondering if it would be possible to count the number of people in an area and to determine which team they are on.

    Is this possible at all with brushes?
     
  2. Egan

    aa Egan

    Messages:
    1,302
    Positive Ratings:
    1,478
    Yeah this is possible with brushes using a trigger_multiple, also using a math_counter and filter entities for both teams (filter_activator_tfteam).

    You can use a team-filtered trigger_multiple to:
    OnStartTouch - blue_math_counter - Add - 1
    OnEndTouch - blue_math_counter - Subtract - 1

    This alone would allow you to track the two team's players in each trigger with a math_counter. If you want to activate things on certain numbers of players you can do so with a logic_case:

    From the math_counter:
    OutValue - logic_case - InValue - (no parameter override)

    In a logic_case you would set up the case values to represent scenarios of values that you would pass into it. For instance you may want something to happen at zero, or at 5, or at 10, or anything in between:

    [​IMG]

    From the outputs of the logic_case then you could do whatever you need to do, like change the message keyvalue of a game_text and then display it on-screen for each case, etc. If you reach the end of a logic_case's 16 cases you can use multiple logic_cases with the same name and then continue the numbers off on the others (like one LC holds the first 16, and a second LC with the same name* holds 17-32).
     
  3. DeOntwerper

    DeOntwerper L1: Registered

    Messages:
    46
    Positive Ratings:
    1
    Would EndTouch be activated if a client was killed within the trigger?
     
  4. Beetle

    Beetle L9: Fashionable Member

    Messages:
    627
    Positive Ratings:
    141
  5. DeOntwerper

    DeOntwerper L1: Registered

    Messages:
    46
    Positive Ratings:
    1
    I will test this out when I have some time in the week :)

    Thank you for your help.