which entity to use for a master switch?

bob+M|M+

L6: Sharp Member
Mar 31, 2008
346
394
I have several func_buttons that last for 3 seconds each. When they are all activated at the same time within those 3 seconds, a master switch will activate. what do I use as the master?? sorry if this is a noob question =P

thanks
bob
 

TheDarkerSideofYourShadow

L10: Glamorous Member
Apr 12, 2008
792
286
No idea if this would actually work, but:

Have each button increment a counter, and decrement it after 3 seconds. After each button is pressed, it triggers a compare between the counter value and however many buttons you have. If they are correct, trigger the event.

Like I said, I haven't tried this at all, I'm just looking at the way I would do something similar in a program.
 

rt3407v06p909

L1: Registered
Apr 16, 2008
30
17
A math_counter would work. When each button is pressed, add one. When each button resets, subtract one. Have the max value be 3. Leave the initial value at zero.

Have the math_counter's OnHitMax do the "Master Switch" behavior.
 

rt3407v06p909

L1: Registered
Apr 16, 2008
30
17
I use a random name & password generator for all the forums I visit, so each one is unique. Just a habit I got into after seeing so much identity theft online.

Put simply, the name means nothing, it's just different than all the other names. ;)
 

rt3407v06p909

L1: Registered
Apr 16, 2008
30
17
No, it should be an asynchronous event, that is, it should fire when the counter hits 3, so you should not have to compare/poll.

I've attached a .VMF and .BSP that demonstrates this technique.
 
Last edited:

Lord Ned

L420: High Member
Feb 11, 2008
421
174
I use a random name & password generator for all the forums I visit, so each one is unique. Just a habit I got into after seeing so much identity theft online.

Put simply, the name means nothing, it's just different than all the other names. ;)

Does this mean you have sticky notes all over the monitor that say "tf2maps.net:rt3407v06p909;19476,passwordhere"?
:w00t:
 

TotalMark

L6: Sharp Member
Feb 13, 2008
331
78
Does this mean you have sticky notes all over the monitor that say "tf2maps.net:rt3407v06p909;19476,passwordhere"?
:w00t:

I've thought about that myself, but I don't have anything important enough to justify the effort.