Variables and triggers

Discussion in 'Mapping Questions & Discussion' started by SmallBiscuit, Oct 26, 2016.

  1. SmallBiscuit

    SmallBiscuit L7: Fancy Member

    Messages:
    463
    Positive Ratings:
    242
    I need some help... I am a novice mapper, and I have a really cool idea for the next tf2 maps 72 hour contest... but one thing is tricking me up... how do I make it so that 2 independent variables (In my case, 2 capture points that can be captured independently of each other) can cause 1 output (In my case, a koth timer to start going down) basically, for visualization:

    :cap:Variable 1------_
    ...............................\
    .................................> Output:helpers:(closest thing to a timer i could find...)
    ............................._/
    :cap:Variable 2------

    Thank you for looking at this... I have no idea what I'm doing currently... halp...


    ANSWERED!!!!!
     
    Last edited: Oct 26, 2016
  2. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    37
    If you want 2 variables to make one outcome upon completion, you're going to want to use a math_counter.

    You should set its min to 0 and max to 2. It's initial should be 0 as well.
    [​IMG]
    When one of your variables happen, select the math_counter and add 1. Do this for both of the variables/entities.
    [​IMG]
    Have the math_counter setup so that OnHitMax something happens.
    [​IMG]

    diagram to help:
    [​IMG]
     
    • Thanks Thanks x 1
    • Like Like x 1
    Last edited: Oct 26, 2016
  3. SmallBiscuit

    SmallBiscuit L7: Fancy Member

    Messages:
    463
    Positive Ratings:
    242
    THANK YOU SO MUCH! THIS IS SAID NOWHERE ON THE DEVELOPMENT WIKI!:D:jimijam::engieyay::chord:
     
  4. Narpas

    Narpas L4: Comfortable Member

    Messages:
    172
    Positive Ratings:
    150
    Or, you could use a logic_relay; have one output enable the relay, and the other to trigger it.
     
    • Respectfully Disagree Respectfully Disagree x 2
    • Agree Agree x 1
  5. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    37
    true. My method works for numbers other than 2 though.
     
  6. sooshey

    aa sooshey :3c

    Messages:
    522
    Positive Ratings:
    418
    @Dissonant Harmony I think that would only work if the points had to be captured in a specific order. With 2-point koth like OP wanted, either one of them could be the one to enable or trigger the relay.
    Can't figure out how to mention you lol. I don't think your method would work since koth points can be recaptured and you have to account for losing a point after you've captured it.
     
  7. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    180
    Positive Ratings:
    37
    You could have them both trigger and enable the relay. First it triggers it and then after .1 seconds it enables it. This way either one can go first.
    I was explaining the practical application.
    In this case, it's a bit different. You'd probably want to use a logic_case and have it set to only enable the timer when the counter is at 2. I will edit this post, giving more detail, after this contract.

    this blasted contract...

    Alright, so let's create a logic_case entity, name it, and change our math_counter a bit:
    [​IMG]
    the "output_case" is our logic_case. What this means is that whenever our math_counter's value changes, send that value to that logic_case.
    Now for our logic case:
    [​IMG]
    What that means is that if we ever receive a "2", make it trigger case 02. If we ever get a "1" trigger case 01. We leave the other ones blank since we are only working with 2 numbers here.

    Triggering those cases does nothing for now since we didn't tell the entity what they do. Let's do that:
    [​IMG]
    so now when it hits the max(2) it will enable the timer and when it is no longer on the max value (1) - it will disable it.

    SIDE NOTE: I really wish math_counter had an output that was something like OnNotMinOrMax. It would really make things so much simpler.
     
    • Thanks Thanks x 1
    Last edited: Oct 26, 2016