Making a Press Button Both Activate AND Deactivate Something
Quote from Brainstatic on June 9, 2011, 4:04 pmI'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'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?
Quote from Omnicoder on June 9, 2011, 4:52 pmlogic_branch can do this pretty easily.
prop_button:
OnPress->mylogicbranch->ToggleTestlogic_branch:
OnTrue->mytractorbeam->SetLinearForce(250)
OnFalse->mytractorbeam->SetLinearForce(0)
logic_branch can do this pretty easily.
prop_button:
OnPress->mylogicbranch->ToggleTest
logic_branch:
OnTrue->mytractorbeam->SetLinearForce(250)
OnFalse->mytractorbeam->SetLinearForce(0)
Quote from Brainstatic on June 9, 2011, 9:42 pmSweet, 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.
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.
Quote from DaMaGepy on June 10, 2011, 7:08 amOmnicoder wrote:OnTrue->mytractorbeam->SetLinearForce(250)
OnFalse->mytractorbeam->SetLinearForce(0)I prefer enable / disable
OnFalse->mytractorbeam->SetLinearForce(0)
I prefer enable / disable ![]()
Quote from Brainstatic on June 10, 2011, 2:11 pmDaMaGepy 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!
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!
Quote from FusedCore on June 11, 2011, 4:01 pmBOB74j 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
I made an advanced version of it, take a look if you're interested topic3558.html
