saveVar: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\|x1= *([^ ]+) \}\}" to "|x1=$1 |seealso= }}") |
Lou Montana (talk | contribs) m (Text replacement - ">Posted on January ([0-9]{2})[ a-zA-Z]*, ([0-9]{4})" to ">Posted on $2-01-$1") |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
| ofp | |game1= ofp | ||
|1. | |version1= 1.75 | ||
|game2= ofpe | |game2= ofpe | ||
Line 24: | Line 24: | ||
|gr1= Variables | |gr1= Variables | ||
| Save variable value into the campaign space. This variable is available to all following missions in the campaign. | |descr= Save variable value into the campaign space. | ||
This variable is available to all following missions in the campaign. | |||
|s1= | |s1= [[saveVar]] varname | ||
|p1= varname: [[String]] | |p1= varname: [[String]] | ||
|r1=[[Nothing]] | |r1= [[Nothing]] | ||
|x1= < | |x1= <sqf>saveVar "varOne";</sqf> | ||
|seealso= | |seealso= [[isNil]] [[missionNamespace]] [[saveStatus]] | ||
}} | }} | ||
Line 40: | Line 41: | ||
<dt><dt> | <dt><dt> | ||
<dd class="notedate">Posted on | <dd class="notedate">Posted on 2009-01-28 - 22:56 (CET)</dd> | ||
<dt class="note">[[User:Wolfrug|Wolfrug]]</dt> | <dt class="note">[[User:Wolfrug|Wolfrug]]</dt> | ||
<dd class="note">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);). | <dd class="note">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);). | ||
</dd> | |||
</dl> | </dl> | ||
Latest revision as of 23:02, 13 May 2023
Description
- Description:
- Save variable value into the campaign space. This variable is available to all following missions in the campaign.
- Groups:
- Variables
Syntax
Examples
- Example 1:
- saveVar "varOne";
Additional Information
- See also:
- isNil missionNamespace saveStatus
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
- Posted on 2009-01-28 - 22:56 (CET)
- 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);).
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.75
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Variables