{"name":"saveVar","title":"saveVar","type":"command","url":"https://community.bistudio.com/wiki/saveVar","revid":379372,"updated":"2026-10-30T23:57:44Z","groups":["Variables"],"status":"ok","games":{"ofp":"1.75","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.75","arma3_since":"0.50","description":"Save variable value into the campaign space.\nThis variable is available to all following missions in the campaign.","syntaxes":[{"syntax":"saveVar varname","params":[{"name":"varname","type":"String","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"varname"}}],"examples":[{"code":["saveVar \"varOne\";"]}],"see_also":["isNil","missionNamespace","saveStatus"],"notes":[{"user":"Wolfrug","date":"2009-01-28T21:56:00Z","text":"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);)."}]}