Arma 3 Scripting

Identifier

  • Also known as identifier

Topic · Markdown · JSON · original wiki page

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

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