Stop a prop_dynamic performing a delayed animation? [Solved]
Quote from GODFATHER on August 26, 2011, 2:53 pmHi all,
I've almost completed my first map. But I have one small issue, that although is not a puzzle breaker, is very annoying. So hoping some of you experienced mappers can help.
The issue is that I have a floor button. When its pressed it tells a prop_dynamic (telescope arm in this case) to move up 90degrees. When the button is unpressed it tell it to move back down after a delay of 8 seconds. (Using animations ofc)
While standing on the button I want it to stay up, but if I get off and back on again, after a few seconds the delayed on unpressed command kicks in and moves it down.
So is there a way to cancel an instruction that is attached to a delay after it has been triggered?
Hi all,
I've almost completed my first map. But I have one small issue, that although is not a puzzle breaker, is very annoying. So hoping some of you experienced mappers can help.
The issue is that I have a floor button. When its pressed it tells a prop_dynamic (telescope arm in this case) to move up 90degrees. When the button is unpressed it tell it to move back down after a delay of 8 seconds. (Using animations ofc)
While standing on the button I want it to stay up, but if I get off and back on again, after a few seconds the delayed on unpressed command kicks in and moves it down.
So is there a way to cancel an instruction that is attached to a delay after it has been triggered?
Quote from Rubrica on August 26, 2011, 3:52 pmAdd an output to the button: OnPressed;!self;CancelPending. Do the same for OnUnPressed. I think that's what you're looking for, anyway.
Add an output to the button: OnPressed;!self;CancelPending. Do the same for OnUnPressed. I think that's what you're looking for, anyway.
Quote from Will T. on August 26, 2011, 3:59 pmTelling a button to CancelPending on itself will crash the game when you try to activate it. I learned this the hard way.
Instead, move all of the current OnPressed commands into a logic_relay, and all OnUnpressed commands into another logic_relay. Add the button outputs like this:
OnPressed -> logic_relay-1 -> Trigger
OnPressed -> logic_relay-2 -> CancelPendingOnUnpressed -> logic_relay-2 -> Trigger
OnUnpressed -> logic_relay-1 -> CancelPendingEDIT: I haven't actually tried telling a button to CancelPending OnUnpressed. That may work, but I'm not sure. I know doing it OnPressed will crash Portal 2.
Telling a button to CancelPending on itself will crash the game when you try to activate it. I learned this the hard way. ![]()
Instead, move all of the current OnPressed commands into a logic_relay, and all OnUnpressed commands into another logic_relay. Add the button outputs like this:
OnPressed -> logic_relay-1 -> Trigger
OnPressed -> logic_relay-2 -> CancelPending
OnUnpressed -> logic_relay-2 -> Trigger
OnUnpressed -> logic_relay-1 -> CancelPending
EDIT: I haven't actually tried telling a button to CancelPending OnUnpressed. That may work, but I'm not sure. I know doing it OnPressed will crash Portal 2.
Quote from GODFATHER on August 26, 2011, 8:13 pmGiven Will's comment on crashing I went straight for the relay method, worked a treat!
Thanks for help. One of those occasions where searching for something told me everything except what I needed to know.
Given Will's comment on crashing I went straight for the relay method, worked a treat!
Thanks for help. One of those occasions where searching for something told me everything except what I needed to know.
