Variables and triggers

  • If you're asking a question make sure to set the thread type to be a question!

Etasus

L420: High Member
Jul 24, 2016
463
251
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:

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
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.
ded179d22ccd76bc51398fa894ba02d7.png

When one of your variables happen, select the math_counter and add 1. Do this for both of the variables/entities.
114072172e5936fa8611df400bc982a1.png

Have the math_counter setup so that OnHitMax something happens.
70adf3cea531d47310c9b41d96e804b2.png


diagram to help:
5224e5110918c8721843ec045230aeb2.png
 
Last edited:

Etasus

L420: High Member
Jul 24, 2016
463
251
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.
ded179d22ccd76bc51398fa894ba02d7.png

When one of your variables happen, select the math_counter and add 1. Do this for both of the variables/entities.
114072172e5936fa8611df400bc982a1.png

Have the math_counter setup so that OnHitMax something happens.
70adf3cea531d47310c9b41d96e804b2.png


diagram to help:
5224e5110918c8721843ec045230aeb2.png
THANK YOU SO MUCH! THIS IS SAID NOWHERE ON THE DEVELOPMENT WIKI!:D:jimijam::engieyay::chord:
 

Narpas

Takes way to long to make and update maps
aa
Jun 11, 2015
433
436
Or, you could use a logic_relay; have one output enable the relay, and the other to trigger it.
 

sooshey

:3c
aa
Jan 7, 2015
514
410
@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.
true. My method works for numbers other than 2 though.
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.
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
@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.
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.
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.
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:
19da676066518a0d6cbcbd3bc5f7e869.png

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:
831535c44af09bd7f11beb3e4359f41b.png

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:
3bb9599bb8542c51935d2eae46f3cebd.png

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.
 
Last edited: