I want a script that will trigger a event to run if a certain event is not over within 10 seconds of starting
are there scripts that do this?
say
you walk on event one
within 10 seconds of walking on it
you will die
UNLESS the event is no longer progressing
Use two events. One, the trigger, will turn on a switch, start a timer for 10 seconds, do what it needs to do, then stop the timer and turn the switch off.
The other event will be a parallel process event, conditioned by that switch. In the event commands, there will be a Conditional Branch (if the timer is 0 seconds or less) then do what it needs to do (kill player). After the Branch End, add a Wait 5 Frames to prevent lag.
The second event will start when you walk over the first event. It will wait for the timer to count down. If the first event finishes, stops the timer and turns the switch off, the second event will stop running. If the first event continues for longer than 10 seconds, the second event will detect the timer finishing, and take action.
If you don't like the timer being visible on the screen during the countdown, there are other ways of doing it.
Yeah I don't really like the timer on screen.
Alright ...
Event 1 - trigger event
When player walks over it
- put the game time into a variable (Control Variables > Game Data > Other)
- add 10 to the variable
- do whatever the event has to do
- turn the switch off
Event 2 - parallel process, conditioned by the switch used in event 1
- put the game time into a different variable
- do a Conditional Branch, if different variable (set in this event) >= original variable (set in the other event), 10 seconds is up and the other event is still running, so kill off player
- after the Branch End, add a Wait 5 Frames
It should have the same effect, but is using the current game time and two variables to determine when 10 seconds are up, rather than the timer.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Also moving back to Ace Support, since it didn't need a script