Script File: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "{{Inline code|" to "{{ic|") |
Lou Montana (talk | contribs) m (Text replacement - "\[\[SQF[ _]syntax" to "[[SQF Syntax") |
||
Line 1: | Line 1: | ||
{{TOC|side}} | {{TOC|side}} | ||
A [[{{PAGENAME}}|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 | A [[{{PAGENAME}}|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 Syntax|SQF]] or (deprecated) [[SQS syntax]]. | ||
{{Feature | Informative | See [[:Category:Community Tools#Code Edition|Community Tools - Code Edition]] for recommended text editors.}} | {{Feature | Informative | See [[:Category:Community Tools#Code Edition|Community Tools - Code Edition]] for recommended text editors.}} | ||
Line 9: | Line 9: | ||
* See [[exec]] | * See [[exec]] | ||
The already existing ({{Since|ofp|1.85}}) [[SQF | The already existing ({{Since|ofp|1.85}}) [[SQF Syntax]] was introduced for scripts in [[{{arma1}}]]. [[SQS syntax]] is still usable but is considered deprecated since. | ||
* See [[execVM]], [[spawn]] | * See [[execVM]], [[spawn]] | ||
Line 31: | Line 31: | ||
; execVM | ; execVM | ||
: [[execVM]] [[preprocessFileLineNumbers|preprocesses]] and [[compile|compiles]] a [[SQF | : [[execVM]] [[preprocessFileLineNumbers|preprocesses]] and [[compile|compiles]] a [[SQF Syntax]] script file and starts a thread for it. | ||
; call | ; call | ||
Line 48: | Line 48: | ||
* [[Function|Functions]] | * [[Function|Functions]] | ||
* [[:Category:Syntax|Syntax]] | * [[:Category:Syntax|Syntax]] | ||
** [[SQF | ** [[SQF Syntax]] | ||
** [[SQS syntax]] | ** [[SQS syntax]] | ||
* [[Statement]] | * [[Statement]] |
Revision as of 23:03, 24 March 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.