What actually happens in a script when the sim restarts?
Posted: Tue Dec 29, 2020 4:38 am
Sorry if this is a frequently-asked question or anything, but I haven't stumbled across an answer: what actually happens in a script when a Kitely sim shuts down, and later starts up again? Especially if the script is in an event handler (or a function called from one, or etc.) at the time.
I'm pretty sure a script doesn't get reset on sim restart, but does it re-enter whatever event handler it was in from the start?
Or does it skip the unexecuted part of that handler?
Or does it sometimes do one and sometimes the other?
Or does the sim not actually shut down until all the scripts have finished their current handlers (or timed out from the handler time limit)?
I've done some experiments, but I'm not sure I understand what I've seen. I think maybe I've seen a case where it looked like handlers were getting interrupted halfway through when the sim shut down, and not re-entered on sim restart, but I'm not certain.
Is this a known thing?
Thanks! -- Dale
I'm pretty sure a script doesn't get reset on sim restart, but does it re-enter whatever event handler it was in from the start?
Or does it skip the unexecuted part of that handler?
Or does it sometimes do one and sometimes the other?
Or does the sim not actually shut down until all the scripts have finished their current handlers (or timed out from the handler time limit)?
I've done some experiments, but I'm not sure I understand what I've seen. I think maybe I've seen a case where it looked like handlers were getting interrupted halfway through when the sim shut down, and not re-entered on sim restart, but I'm not certain.
Is this a known thing?
Thanks! -- Dale