Jump to content
Trenchcoat

Transport Pilot Rewards Script Help

Recommended Posts

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

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
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

  • Thanks 1

Share this post


Link to post
Share on other sites

@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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×