Arma 3 Scripting

Topic in Scripting

Identifier

Also available as Markdown and JSON, or read the original wiki page.

NOTOC An Identifier is the name given to a variable that the scripter can choose: It is the name that identifies the variable.

Rules

+ Regex: [a-zA-Z_][a-zA-Z0-9_]* Valid Invalid
- variable1
- _my_local_variable
- _1variable
- _player
- 1variable
- _my#localVar
- _guy1&2var
- player (player)

Binding rules for identifiers:

Recommendations

It is recommended to write local variable identifiers in camel case syntax. This makes identifiers more readable:

private _myVariableName = 5;

Important

https://en.wikipedia.org/wiki/Snake_case is sometimes encountered but is not recommended and should be avoided:

_my_variable_name = 5;

It is also recommended to prefix global variable identifiers with your tag in order to avoid any potential conflict between addons, scripts and missions: // **Tag**_identifier UNIQUETAG_player = player;

See also