profileNamespace: Difference between revisions
Jump to navigation
Jump to search
m (Added command group Namespaces) |
Lou Montana (talk | contribs) m (Text replacement - "\{\{cc\|([^} ]*)\}\}" to "// $1") |
||
Line 21: | Line 21: | ||
|x1= <code>[[profileNamespace]] [[setVariable]] ["TAG_kills", 10000]; | |x1= <code>[[profileNamespace]] [[setVariable]] ["TAG_kills", 10000]; | ||
// somewhere else in the code | |||
_kills = [[profileNamespace]] [[getVariable]] ["TAG_kills", 0];</code> | _kills = [[profileNamespace]] [[getVariable]] ["TAG_kills", 0];</code> | ||
Revision as of 11:26, 12 May 2022
Description
- Description:
- Returns the global namespace attached to the active user profile. Use setVariable and getVariable to save and load data to and from this Namespace. A variable can be deleted by setting its value to nil. By default the variables set in this namespace will exist while the game is running, and variables are saved persistently when the game is closed. Saving can also be forced by using saveProfileNamespace to prevent data loss on e.g game crash.
The variables are stored next to the user profile in a file named myUsername.vars.GAMENAME. - Groups:
- NamespacesVariables
Syntax
- Syntax:
- profileNamespace
- Return Value:
- Namespace
Examples
- Example 1:
profileNamespace setVariable ["TAG_kills", 10000]; // somewhere else in the code _kills = profileNamespace getVariable ["TAG_kills", 0];
Additional Information
- See also:
- saveProfileNamespace missionNamespace uiNamespace parsingNamespace currentNamespace localNamespace allVariables with Forward Compatibility
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 Nov 25, 2011 - 17:33 (UTC)
- The variables are loaded when the user profile is loaded or changed.