Trenchcoat 14 Posted February 2, 2020 I am attempting to create a rewards script for transport pilots fulfilling their duties. I have it set up to count the passengers, create a starting marker and ending marker, and calculate it, but my waitUntils do not seem to be functioning properly, causing the script to finalize as soon as the Event handler fires. Are Event handlers able to be suspended? Examples: waitUntil {count fullCrew [_vehicle,"",false] >= 2}; waitUntil { ((getPos (_vehicle) select 2) > 25) && (speed (_vehicle) > 30) }; If it is not suspendable, I guess I will have to make addActions for Transport begin, and Transport ended; but if it gets crazy at the LZ, remembering to do that may be a issue. Share this post Link to post Share on other sites
beno_83au 1369 Posted February 3, 2020 Use spawn inside the event handler. 1 Share this post Link to post Share on other sites
Trenchcoat 14 Posted February 3, 2020 The only call on the script is to something else, would one "call" function for a different action (to external script) convert the entire script to a not supendable environment? The only execution of the script is via execVM otherwise. Doesn't really make a difference now as I re-wrote it to all addactions, but would be good to know for the future if any call contained inside a script creates a non-suspendable environment. Share this post Link to post Share on other sites
Dedmen 2716 Posted February 4, 2020 On 2/2/2020 at 7:44 PM, Trenchcoat said: Are Event handlers able to be suspended? No. 14 hours ago, Trenchcoat said: would one "call" function for a different action (to external script) convert the entire script to a not supendable environment call keeps the current environment, so inside eventhandler that would be unscheduled, meaning you can't wait/sleep. 14 hours ago, Trenchcoat said: any call contained inside a script creates a non-suspendable environment. you can use isNil to do that 1 Share this post Link to post Share on other sites
Trenchcoat 14 Posted February 4, 2020 @Dedmen thank you! That explains it perfectly. Now to just figure out how to retrieve the object ID (and get rid of my error) from a created spawnpoint, and this mission of mine is ready for a major update. Share this post Link to post Share on other sites