Multiple Buttons
I am 3/4 of the way through creating my second map. However I have come across a problem.
I want to use multiple floor buttons (three of them) for one door. I have followed the tutorial on the developer Valve wiki but cannot seem to get it to work.
I have a math counter near my door with...
Initial value - 0
Min value - 0
Max value - 3
Each of my buttons I have set up an output for unpressed/pressed to subtract/add to the math counte.
Once all the three buttons are pressed, it's fine. However, if I remove a cube to leave one button unpressed, the door stays open.
This is my first time attempting to use math counters by the way.
Rubrica wrote:
The way I'd do this would be by setting each button to toggle the state if a logicmbranch depending on its state, and use a logic branch listeners, with an output of OnAllTRue to open the door, and OnMixed or OnAllFalse to close it.
That made no sense to me. :S
I have never dealt with logic branches at all, and have no idea how to use them.
OnPressed > branch1 > SetValue > 1
OnUnPressed > branch1 > SetValue > 0
Then create an entity of the type logic_branch_listener. In its properties, you can tell it what branches to listen to. It will have a bunch of fields named something like Logic Branch 01. In the first three of those fields type in branch1, branch2 and branch3.
Next give the listener these outputs:
OnAllTrue > door > Open
OnAllFalse > door > Close
OnMixed > door > Close
OnHitMax -> Door -> Open
OnChangedFromMax -> Door -> Close
Will T. wrote:
You can do it easily with outputs on your existing math_counter.OnHitMax -> Door -> Open
OnChangedFromMax -> Door -> Close
Thanks for this. =]
Thanks to all the other solutions as well, much appreciated.
Anyway, I had no idea there was an OnChangedFromMax output either. The way I learned was OnHitMax-->!self-->SetMin-->[max -1].
Actually, looking at it now it turns out there's a new SetHitMinNoFire output with Portal 2. Huh.