From Bohemia Interactive Community
Revision as of 10:38, 20 September 2020 by R3vo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Introduced with Arma 2 version 1.001.00
Hover & click on the images for descriptions


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 logo black.png
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.

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 init and precondition (exception is the init state). This is the only place where scripted FSM is suspended/resumed. The usual difference between the state's init and precondition is 1 frame but if the scheduler is busy it can take longer. See FSM for more information about FSM's structure.


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
Program Flow


Only post proven facts here. Report bugs on the Feedback Tracker and discuss on the Arma Discord or on the Forums.


Bottom Section