Select lowest number of players

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

  1. MechaBowser

    MechaBowser L1: Registered

    Messages:
    32
    Positive Ratings:
    0
    Hiii

    i'm making a map where all players are in one room. The room is divided by two different floor textures with two triggers. I'm no expert mapper, but I'm looking for a way to figure out which of the triggers has the least amount of players, and then slay those players inside?

    Any help appreciated, thanks :D
     
  2. megawac

    megawac L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    29
    Make 2 math_counters, 2 trigger_multiples and a logic_compare.

    Now add these properties to each respective entity.
    Code:
    Entity: Trigger_multiple
    Name: blu_multi
    filter: blu_filter
    Output: OnStartTouch: blu_counter: add: 1
    
    Entity: Math_counter
    Name: blu_counter
    Inputs: OnEvent: EventStarter: SetValueNoFire (when you want to check which room has more people)
    Outputs: OutValue: compare : setValue
    
    Red would be the same except its math_counter output would be "OutValue:compare:setCompareValue"
    
    Entity: Logic_compare
    name: Compare
    intial : 0
    compareValue: 0
    Outputs: OnLessthan : anEntity : doSomething (for when blu wins)
    Outputs: OnGreaterthan : anEntity: doSomething(for when red wins)
    
    Think that should work
     
    • Thanks Thanks x 1
    Last edited: Jun 21, 2010
  3. MechaBowser

    MechaBowser L1: Registered

    Messages:
    32
    Positive Ratings:
    0
    major thanks megawac, I'll try it out!! :D

    EDIT: hm, I'm getting this error

    Code:
    !! ERROR: bad input/output link:
    !! math_counter(boss6_redcounter,SetValueNoFire) doesn't match type from trigger_multiple()
    !! ERROR: bad input/output link:
    !! math_counter(boss6_blucounter,SetValueNoFire) doesn't match type from trigger_multiple()
     
    Last edited: Jun 21, 2010
  4. megawac

    megawac L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    29
    Idk what happened to you because both logic_compare and math_counter are integer values.

    I just checked to make sure what I mentioned worked... Seems to http://dl.dropbox.com/u/5593951/Releases/counter_test.vmf.

    Side note to get the logic_compare to compare values turn cheats on and type "ent_fire compare compare" in console, didnt make anything in hammer fire that output. If your standing in your teams trigger it will say the name of your team with your teams color, if not it will say none in gray.

    Edit, deleted the link.
     
    Last edited: Jun 22, 2010
  5. MechaBowser

    MechaBowser L1: Registered

    Messages:
    32
    Positive Ratings:
    0
    ohh I figured it out. The SetValueNoFire isn't really needed :p Instead I just had to call compare when I wanted it to... well, compare!

    Thanks!!
     
  6. MechaBowser

    MechaBowser L1: Registered

    Messages:
    32
    Positive Ratings:
    0
    Alright now I need something a bit more complex :p
    I got it to work with only two triggers... but now I need four

    basically:
    there's 4 areas. I need to select the area with the most players :O
    how would I do that?
     
    Last edited: Jun 21, 2010
  7. megawac

    megawac L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    29
    God this is going to be complex... Ok well here we go...

    Create your 2 of the systems we previously made. Also add a logic_relay for each of the multiples, this will be used to fire the outputs you want at the end of the test. I'm going to name each trigger_multiple/logic_relay duo there short name and system number.

    Now the fun part... for each of the logic_compares add an output "OnGreaterThan:compare1:Toggle" This will disable the first logic_relay and fire any outputs for "OnToggle" which only will be to disable its math_counter. (OnToggle:counter1;Disable).
    Have an OnLessThan to disable the blue's first relay and counter.

    Have a similar structure for the second set of trigger_multiples/counters.

    There should now be 2 math_counters/logic_relays enabled.

    Have those math_counters set the values of yet another logic_compare. Outputs from this logic_compare should be "OnLessThan:relay3(/4):Trigger", (thats 2 outputs) triggering the logic_relay that is still enabled from the second structure. And the same thing for OnGreaterThan.

    Now all you have to do is build this fun system and have the logic_relays fire off whatever. Have fun hope it made sense... did in my head.
     
    • Thanks Thanks x 1
  8. MechaBowser

    MechaBowser L1: Registered

    Messages:
    32
    Positive Ratings:
    0
    Wait, I need 4 trigger_multiple, 4 logic_relay, 4 math_counter and 2 logic_compare?

    I'm sorry you'll have to reword what you said, it made little sense to me D:
     
    Last edited: Jun 22, 2010
  9. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,527
    Question: do you need the count check to be done quickly/rapidly/continuously, or is it only count to check once every now and then? Also, are you going to ask about doing it for even more areas?
     
  10. MechaBowser

    MechaBowser L1: Registered

    Messages:
    32
    Positive Ratings:
    0
    I need a brush to be visible when the most players are on it. I got it to work with the 2 floors!
    Then also after a certain amount of time (handled by a timer thats activated prior) it needs to enable a trigger_hurt for the floor with most people. :D

    and no, this is the only area :p I made it with 2 floors only but it was too random, 4 floors is definitely going to do it.
     
    Last edited: Jun 22, 2010
  11. megawac

    megawac L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    29
    Ok, sorry my post wasnt very clear, heres a test I made seems to have worked. Take a look and if you have any questions pm me.

    Oh and to test the series, launch the map and type "ent_fire event trigger" in console.
     
  12. MechaBowser

    MechaBowser L1: Registered

    Messages:
    32
    Positive Ratings:
    0
    thanks, work like a charm :D