Difference between revisions of "execFSM"

From Bohemia Interactive Community
Jump to navigation Jump to search
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|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects? in MP|M...)
m (Text replacement - " {3,}\|" to " |")
Line 4: Line 4:
|gr1= Program Flow
|gr1= Program Flow

Revision as of 18:21, 18 January 2021

Hover & click on the images for description


Execute scripted FSM and return the FSM handle or 0 when failed. The FSM file is first searched in the mission folder, then in the campaign scripts folder and finally in the global scripts folder. Argument (if any) are available in _this variable inside FSM. Variables set inside FSMs can be read/modified externally, using setFSMVariable and getFSMVariable commands.

The return value is the FSM handle; it can be used to determine (via completedFSM) when the FSM has finished.
Arma 3
In Arma 3, the FSM handle is also available within the FSM through the _thisFSM variable.

Scripted FSMs are added into the scheduler just like exec scripts, execVM scripts and spawn scripts.
To see what FSMs are currently in the scheduler, use diag_activeMissionFSMs command.

Program Flow


arguments execFSM fsmFilePath
arguments: Anything - Arguments accessible as _this in the FSM
fsmFilePath: String - file with FSM code
Return Value:
Number - FSM handle

Alternative Syntax

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


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


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