execFSM
Jump to navigation
Jump to search
Description
- 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.
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. - Groups:
- Program Flow
Syntax 1
- Syntax:
- arguments execFSM fsmFilePath
- Parameters:
- arguments: Anything - arguments accessible as _this in the FSM
- fsmFilePath: String - file with FSM code
- Return Value:
- Number - FSM handle (also available as _thisFSM in the FSM)
Syntax 2
- Syntax:
- execFSM fsmFilePath
- Parameters:
- fsmFilePath: String - file with FSM code
- Return Value:
- Number - FSM handle (also available as _thisFSM in the FSM)
Syntax 3
- Syntax:
- arguments execFSM [fsmFilePath, allowTermination]
- Parameters:
- arguments: Anything - arguments accessible as _this in the FSM
- fsmFilePath: String - file with FSM code
- allowTermination (Optional): Boolean - true to allow FSM termination with terminate command. Default false
- Return Value:
- Number - FSM handle (also available as _thisFSM in the FSM)
Syntax 4
- Syntax:
- execFSM [fsmFilePath, allowTermination]
- Parameters:
- fsmFilePath: String - file with FSM code
- allowTermination (Optional): Boolean - true to allow FSM termination with terminate command. Default false
- Return Value:
- Number - FSM handle (also available as _thisFSM in the FSM)
Examples
- Example 1:
- Example 2:
- Example 3:
Additional Information
- See also:
- FSM FSM Editor Manual execVM call spawn exec commandFSM completedFSM doFSM getFSMVariable setFSMVariable
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