Arma 3 Scripting

saveVar

  • Arma 3 v0.50
  • First in Operation Flashpoint v1.75

Command · Markdown · JSON · original wiki page

Description

Save variable value into the campaign space. This variable is available to all following missions in the campaign.

Syntax

saveVar varname

Parameters:

Returns: Nothing

Examples

Example 1

saveVar "varOne";

See also

isNil · missionNamespace · saveStatus

Community notes

Wolfrug

If you try to saveVar a vehicle saved in your variable (SavedVars = [Car1]; saveVar "SavedVars"), then Car1 will not be properly "saved", refering to ObjNull if you try to use it in subsequent missions, even if a vehicle with the same vehicle varname exists. To get around this, save the vehicle's varname as a string (SavedVars = [str(Car1)]) and then when you need it just use call compile to "unstring" the varname (_car = call compile (SavedVars select 0);).