scriptDone: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "<h3 style="display:none">Bottom Section</h3> " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| arma1 | | arma1 | ||
|1.00 | |1.00 | ||
|gr1= Program Flow | |gr1= Program Flow | ||
| Check if a script is finished running using the [[Script_(Handle)]] returned by [[execVM]] or [[spawn]]. | | Check if a script is finished running using the [[Script_(Handle)]] returned by [[execVM]] or [[spawn]]. | ||
| '''scriptDone''' handle | | '''scriptDone''' handle | ||
|p1= handle: [[Script (Handle)]] - handle returned by [[spawn]] or [[execVM]] | |p1= handle: [[Script (Handle)]] - handle returned by [[spawn]] or [[execVM]] | ||
| [[Boolean]] | | [[Boolean]] | ||
|x1= SQS Syntax:<code>@[[scriptDone]] _Handle</code> | |x1= SQS Syntax:<code>@[[scriptDone]] _Handle</code> | ||
|x2= SQF Syntax:<code>script_handler = [parameters] [[execVM]] "scriptname.sqf"; | |x2= SQF Syntax:<code>script_handler = [parameters] [[execVM]] "scriptname.sqf"; | ||
[[waitUntil]] { [[scriptDone]] script_handler };</code> | [[waitUntil]] { [[scriptDone]] script_handler };</code> | ||
| [[execVM]], [[spawn]], [[terminate]], [[scriptNull]] | | [[execVM]], [[spawn]], [[terminate]], [[scriptNull]] | ||
}} | }} |
Revision as of 11:03, 18 January 2021
Description
- Description:
- Check if a script is finished running using the Script_(Handle) returned by execVM or spawn.
- Groups:
- Program Flow
Syntax
- Syntax:
- scriptDone handle
- Parameters:
- handle: Script (Handle) - handle returned by spawn or execVM
- Return Value:
- Boolean
Examples
- Example 1:
- SQS Syntax:
@scriptDone _Handle
- Example 2:
- SQF Syntax:
script_handler = [parameters] execVM "scriptname.sqf"; waitUntil { scriptDone script_handler };
Additional Information
- See also:
- execVMspawnterminatescriptNull
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
- Posted on 03:54, 11 September 2009
- Bn880
- 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.
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.00
- ArmA: Armed Assault: New Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Command Group: Program Flow
- Operation Flashpoint: Elite: Scripting Commands
- Arma 2: Scripting Commands
- Arma 3: Scripting Commands
- Take On Helicopters: Scripting Commands