Script File: Difference between revisions
Jump to navigation
Jump to search
m (→Syntax) |
m (Text replacement - "{{Inline code|" to "{{ic|") |
||
Line 40: | Line 40: | ||
{{Feature | Informative | | {{Feature | Informative | | ||
* [[execVM]] is almost like using {{ | * [[execVM]] is almost like using {{ic|[[spawn]] [[compile]] [[preprocessFile]]}}. | ||
* [[spawn]] and [[execVM]] both add the thread to the [[Scheduler]] and provide a [[Script (Handle)|script handle]] which allows you to check if the spawned script is done (using [[scriptDone]]).}} | * [[spawn]] and [[execVM]] both add the thread to the [[Scheduler]] and provide a [[Script (Handle)|script handle]] which allows you to check if the spawned script is done (using [[scriptDone]]).}} | ||
Revision as of 18:10, 27 February 2021
A script file is multiple commands and arguments defining wanted behaviour from the game, all grouped together in a textfile. This code does a specific task handled by the game engine. The common extensions for Arma scripts are .sqf and .sqs, depending on the used syntax: SQF or (deprecated) SQS syntax.
Syntax
In Operation Flashpoint, scripts are limited to SQS syntax.
- See exec
The already existing (Template:Since) SQF syntax was introduced for scripts in Armed Assault. SQS syntax is still usable but is considered deprecated since.
Execution
Scripts can be executed from several points in the game:
- Other scripts
- Other functions
- Init fields and (de)activation triggers in the Mission Editor
- Event Handlers in addon config files
The commands to execute scripts are:
- exec
- exec starts a thread for a script in SQS syntax.
- execVM
- execVM preprocesses and compiles a SQF syntax script file and starts a thread for it.
- call
- call adds provided Code to the stack and wait for it to execute, then returns the code's last returned value.