Arma 3 Scripting

Topic in Data Types

Namespace

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

Arma 2 v1.00

A Namespace is a container for Variables. Any global variable is always part of exactly one namespace - another namespace may contain a variable with the same Identifier, but they remain two distinct independent variables. Scripts and functions are always executed in the context of some namespace.

The default namespace is the missionNamespace.

Namespaces

Game Namespace Description Lifetime
Arma 2 v1.00 missionNamespace The global namespace of the mission. Every mission has its own missionNamespace. Mission duration
Arma 2 v1.00 parsingNamespace The global namespace attached to the Config Parser. Game session
Arma 2 v1.00 uiNamespace The global namespace attached to the user interface. Game session
Take On Helicopters v1.00 profileNamespace The global namespace attached to the user profile. Profile lifetime
Arma 3 v2.00 localNamespace This namespace is like the missionNamespace, except that its variables can not be sent over network (e.g. with publicVariable) or serialised. Mission duration
Arma 3 v2.06 serverNamespace The namespace used by Server Event Handlers. This namespace is only available on servers. Game session
Arma 3 v2.10 missionProfileNamespace This namespace is like profileNamespace but is also attached to a missionName or missionGroup. Automatically loaded before init.sqf. Profile lifetime

Serialisation

Only the missionNamespace is serialised, as in only the variables from this namespace are saved when the game is saved (e.g. with saveGame) and loaded when the game is loaded (e.g. with loadGame). This is also the reason the game will complain that one should use disableSerialization when storing UI variables in missionNamespace - UI elements are temporary and therefore exempt from serialisation by default.

Scripting

Interacting with namespaces is not difficult: