scriptDone: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - ":<code>" to ": <code>") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 29: | Line 29: | ||
|r1= [[Boolean]] | |r1= [[Boolean]] | ||
|x1= | |x1= <sqf> | ||
< | _scriptHandle = ["arguments"] execVM "scriptname.sqf"; | ||
waitUntil { scriptDone _scriptHandle }; | |||
</sqf> | |||
|seealso= [[execVM]] [[spawn]] [[terminate]] [[scriptNull]] | |seealso= [[execVM]] [[spawn]] [[terminate]] [[scriptNull]] | ||
}} | }} | ||
{{Note | |||
|user= Bn880 | |||
|timestamp= 20090911035400 | |||
|text= A Null Script handle can be created in this manner: | |||
<sqf>_handle = 0 spawn {};</sqf> | |||
< | |||
That is what any [[Script Handle]] becomes when a script is finished running, meaning it will test as [[true]] with: | That is what any [[Script Handle]] becomes when a script is finished running, meaning it will test as [[true]] with: | ||
<sqf>scriptDone _handle;</sqf> 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]]. | <sqf>scriptDone _handle;</sqf> | ||
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. | |||
}} |
Latest revision as of 20:10, 13 May 2022
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:
Additional Information
- See also:
- execVM spawn terminate scriptNull
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
- Posted on Sep 11, 2009 - 03:54 (UTC)
-
A Null Script handle can be created in this manner:
That is what any Script Handle becomes when a script is finished running, meaning it will test as true with:
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.scriptDone _handle;
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint: Elite version 1.00
- Operation Flashpoint: Elite: New Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Program Flow