Making a Press Button Both Activate AND Deactivate Something

Avatar
Brainstatic
219 Posts
Posted Jun 09, 2011
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?
Advertisement
Registered users don’t see ads! Register now!
Avatar
Omnicoder
299 Posts
Posted Jun 09, 2011
Replied 48 minutes later
logic_branch can do this pretty easily.

prop_button:
OnPress->mylogicbranch->ToggleTest

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

Avatar
Brainstatic
219 Posts
Posted Jun 09, 2011
Replied 4 hours later
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.
Avatar
DaMaGepy
361 Posts
Posted Jun 10, 2011
Replied 9 hours later

Omnicoder wrote:
OnTrue->mytractorbeam->SetLinearForce(250)
OnFalse->mytractorbeam->SetLinearForce(0)

I prefer enable / disable :smile:

Avatar
Brainstatic
219 Posts
Posted Jun 10, 2011
Replied 7 hours later

DaMaGepy wrote:
Omnicoder wrote:

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

I prefer enable / disable :smile:

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

Advertisement
Registered users don’t see ads! Register now!
Avatar
FusedCore
31 Posts
Posted Jun 11, 2011
Replied 1 day later

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