execFSM: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...)
m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ |()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}")
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command
{{RV|type=command


| arma2
| arma2


|1.00
|1.00


|gr1= Program Flow
|gr1= Program Flow
Line 15: Line 14:
Scripted FSMs are added into the scheduler just like [[exec]] scripts, [[execVM]] scripts and [[spawn]] scripts.<br>
Scripted FSMs are added into the scheduler just like [[exec]] scripts, [[execVM]] scripts and [[spawn]] scripts.<br>
To see what FSMs are currently in the scheduler, use [[diag_activeMissionFSMs]] command.
To see what FSMs are currently in the scheduler, use [[diag_activeMissionFSMs]] command.
{{Important|While the code placed into any of the sections of FSM cannot be suspended ([[canSuspend]] is false), the FSM itself is suspended every simulation between the state's <tt>init</tt> and <tt>precondition</tt> (exception is the '''init state'''). This is the only place where scripted FSM is suspended/resumed.
{{Feature|important|While the code placed into any of the sections of FSM cannot be suspended ([[canSuspend]] is false), the FSM itself is suspended every simulation between the state's <tt>init</tt> and <tt>precondition</tt> (exception is the '''init state'''). This is the only place where scripted FSM is suspended/resumed.
The usual difference between the state's <tt>init</tt> and <tt>precondition</tt> is 1 frame but if the scheduler is busy it can take longer. See [[FSM]] for more information about FSM's structure.}}
The usual difference between the state's <tt>init</tt> and <tt>precondition</tt> is 1 frame but if the scheduler is busy it can take longer. See [[FSM]] for more information about FSM's structure.}}


Line 26: Line 25:
| [[Number]] - FSM handle
| [[Number]] - FSM handle


|s2= [[execFSM]] fsmFilePath |Syntax 2=
|s2= [[execFSM]] fsmFilePath


|p21= fsmFilePath: [[String]] - file with FSM code |Parameter 21=
|p21= fsmFilePath: [[String]] - file with FSM code


| r2= [[Number]] - FSM handle
| r2= [[Number]] - FSM handle
Line 38: Line 37:
|x3= <code>_handle = [[execFSM]] "test.fsm";</code>
|x3= <code>_handle = [[execFSM]] "test.fsm";</code>


| [[FSM]], [[FSM Editor Manual]], [[execVM]], [[call]], [[spawn]], [[exec]], [[commandFSM]], [[completedFSM]], [[doFSM]], [[getFSMVariable]], [[setFSMVariable]]
|seealso= [[FSM]], [[FSM Editor Manual]], [[execVM]], [[call]], [[spawn]], [[exec]], [[commandFSM]], [[completedFSM]], [[doFSM]], [[getFSMVariable]], [[setFSMVariable]]
}}
}}


<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>


{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}

Revision as of 00:42, 17 February 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Program Flow

Syntax

Syntax:
Syntax needed
Parameters:
arguments: Anything - Arguments accessible as _this in the FSM
fsmFilePath: String - file with FSM code
Return Value:
Return value needed

Alternative Syntax

Syntax:
execFSM fsmFilePath
Parameters:
fsmFilePath: String - file with FSM code
Return Value:
Number - FSM handle

Examples

Example 1:
_id = player execFSM "test.fsm";
Example 2:
_handle = [_a, _b, _c] execFSM "test.fsm";
Example 3:
_handle = execFSM "test.fsm";

Additional Information

See also:
FSMFSM Editor ManualexecVMcallspawnexeccommandFSMcompletedFSMdoFSMgetFSMVariablesetFSMVariable

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