Please or Register to create posts and topics.

Output delay

Is there any way to fire an output from a trigger, not as a delay, but where it wouldn't be fired unless you stayed in the trigger for a certain amount of time?

Use a logic_timer, which resets its time when it's disabled. You can either make the time random within a range, or specify a number of seconds. Enable the timer OnStartTouch, and disable it on OnEndTouch. When it fires, have it activate whatever else and then disable itself.

Falsi sumus crusto!

Or just fire a logic_relay with a delay of the time you want the player to be on the button;
then give the button onunpressed <relay> cancelpending. :)

Lpfreaky90 wrote:
Or just fire a logic_relay with a delay of the time you want the player to be on the button;
then give the button onunpressed <relay> cancelpending. :)

Wait, that's what cancelpending does? I had no idea you could do that!

Falsi sumus crusto!

When you have a Relay, who Fires an Output with a Delay of maybe 5 secounds And it get triggered, you can "break up" (cancel pending) the Output.
So the Output Will not fired :D

Example

Spoiler
A floor_button opens a door with a delay of 10 sec's but on UnPressed it closes the door within 2 seconds. Now the problem is, that if you go on the button, and go within 5 seconds off the button, the door opens later, but you're not standing on the button. Now you can easily Make a relay, that has the outputs of the button, and make the Output from the floor_button: " OnUnpressed -> Door_Rl -> Cancelpending. " So now if you go of the button, the 10 seconds will be canceled :D

FelixGriffin wrote:
Lpfreaky90 wrote:
Or just fire a logic_relay with a delay of the time you want the player to be on the button;
then give the button onunpressed <relay> cancelpending. :)

Wait, that's what cancelpending does? I had no idea you could do that!

Yep! It's also great for preventing errors that can be caused by quick moving on/off buttons;

Do_stuff_rl;
ontrigger, <do stuff>, 0.10
ontrigger, undo_stuff_rl, cancelpending, 0.00

undo_stuff_rl
ontrigger, <undo stuff>, 0.10
ontrigger, do_stuff_rl, cancelpending, 0.00

Lpfreaky90 wrote:
Yep! It's also great for preventing errors that can be caused by quick moving on/off buttons;

It's important for laser relays/catchers as well, if not more important than on buttons.

Also, I remember learning the use of CancelPending by reading a conversation between wrathofmobius, Habzs and Aixce in the IRC Webchat who had a discussion by using outputs, like 'ent_fire Aixce Kill', then wrathofmobius would reply with 'ent_fire Habzs CancelPending' "i saved you aixce"

Good times. Wasn't there myself, but good times.

ImageImage