Please or Register to create posts and topics.

Stop a prop_dynamic performing a delayed animation? [Solved]

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?

Add an output to the button: OnPressed;!self;CancelPending. Do the same for OnUnPressed. I think that's what you're looking for, anyway.

Image
ImageImageImageImage

Telling a button to CancelPending on itself will crash the game when you try to activate it. I learned this the hard way. :P

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.

There is no "N" in "Turret."

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.