scriptDone: Difference between revisions
Jump to navigation
Jump to search
m (Added SEEALSO) |
m (Wrong browser window..) |
||
Line 21: | Line 21: | ||
waitUntil {scriptDone script_handler};</code> |= Example 2 | waitUntil {scriptDone script_handler};</code> |= Example 2 | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[execVM]], [[execFSM]], [[terminate | | [[execVM]], [[execFSM]], [[terminate]] |= See also | ||
}} | }} |
Revision as of 18:48, 20 December 2010
Description
- Description:
- Check if a script is finished running using the Script_(Handle) returned by execVM or spawn.
- Groups:
- Uncategorised
Syntax
- Syntax:
- scriptDone handle
- Parameters:
- handle: Script_(Handle) returned by spawn or execVM
- Return Value:
- Boolean
Examples
- Example 1:
- @ScriptDone _Handle
- Example 2:
script_handler = [parameters] execVM "scriptname.sqf"; waitUntil {scriptDone script_handler};
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Notes
-
A Null Script handle can be created in this manner:
_handle = 0 spawn {};
That is what any Script_(Handle) becomes when a script is finished running, meaning it will test as true with: scriptDone _handle
and it returns "<NULL-script>" when converted to string. This in turn lets you initialize the variable with a completed Script_(Handle) and lets you test the variable even though nothing else may have set the handle by creating a script with spawn or execVM. It also lets you store and manage script handles in arrays, and a few other sexy things.