Please or Register to create posts and topics.

Making a Press Button Both Activate AND Deactivate Something

I'm trying to make it so that a press button (not one of the floor buttons that you place a cube on) will activate an excursion funnel/tractor beam on the first time it's pressed, and that same press button will deactivate the funnel on the next press, and the next press after that will reactivate it, and you get the point. So how do I make the button's outputs switch off like that even if whoever plays the map presses the button millions of times?

Try out Twin Pillars, a Portal 2 map by BOB74j.

logic_branch can do this pretty easily.

prop_button:
OnPress->mylogicbranch->ToggleTest

logic_branch:
OnTrue->mytractorbeam->SetLinearForce(250)
OnFalse->mytractorbeam->SetLinearForce(0)

Sweet, that worked. Thank you for the help! I'm new to Source mapping as you probably already know, so there's still quite a bit that I don't know. But that entity seems like it will prove quite useful in future projects. Once map revisions are back online, I will be sure to re-upload my map Twin Pillars with that change along with some other small improvements.

Try out Twin Pillars, a Portal 2 map by BOB74j.
Omnicoder wrote:
OnTrue->mytractorbeam->SetLinearForce(250)
OnFalse->mytractorbeam->SetLinearForce(0)

I prefer enable / disable :)

-= Check out my maps: workshop, and their .vmf sources: homepage =-
DaMaGepy wrote:
Omnicoder wrote:
OnTrue->mytractorbeam->SetLinearForce(250)
OnFalse->mytractorbeam->SetLinearForce(0)

I prefer enable / disable :)

I actually did modify Omnicoder's suggestion a little bit and used the enable/disable rather than set linear force. Thanks for the help!

Try out Twin Pillars, a Portal 2 map by BOB74j.
BOB74j wrote:
I'm trying to make it so that a press button (not one of the floor buttons that you place a cube on) will activate an excursion funnel/tractor beam on the first time it's pressed, and that same press button will deactivate the funnel on the next press, and the next press after that will reactivate it, and you get the point. So how do I make the button's outputs switch off like that even if whoever plays the map presses the button millions of times?

I made an advanced version of it, take a look if you're interested topic3558.html