saveProfileNamespace: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Added to OA category)
m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(45 intermediate revisions by 7 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands]]
{{RV|type=command


{{Command|= Comments
|game1= tkoh
____________________________________________________________________________________________
|version1= 1.00


| TKOH |= Game name
|game2= arma2oa
|version2= 1.62


|1.00|= Game version
|game3= arma3
____________________________________________________________________________________________
|version3= 0.50


| Saves the variables stored in [[profileNamespace]] to the persistent active user profile.
|gr1= Namespaces
|gr2= Variables


* '''Warning''': this is a file operation, which makes it expensive! It is not recommended to do this at a high frequency in a loop for example. It is however also recommended not to change a large amount of variables and wait long before saving, because certain game crashes may cause a loss of data.  
|descr= Saves all variables stored in [[profileNamespace]] to the active [[Profile]].
 
{{Feature|informative|This command should be used when it is likely that the game will not be closed the usual way (e.g. via {{Controls|Alt|F4}}) or when the data is important and must not be lost due to a game crash.}}
* '''Warning''': saving a lot of data can quickly increase the size of the profile variables file, so keep an eye on this.
{{Feature|warning|
 
* This command triggers a file operation. As file operations are slow (even on SSDs), it is not recommended to use this command too frequently (i.e. several times per second).
* '''Warning''': TKOH's Heliport status (used in the Career mode for example) is stored in this file, so be mindful of working with this technology to avoid losing data and progress. |= Description
* Do not save large amounts of data to the profile; the larger the profile file gets, the slower it loads!
____________________________________________________________________________________________
* The [[profileNamespace]] is saved automatically when the game is closed.
 
}}
| '''saveProfileNamespace'''|= Syntax
{{Feature|tkoh|Heliport status, used in the Career mode for example, is stored in the file that is modified by this command, so be mindful of this to avoid losing data and progress.}}


| [[Nothing]] |= Return value
|s1= [[saveProfileNamespace]]
____________________________________________________________________________________________


|x1= <code>saveProfileNamespace;</code> |=
|r1= [[Nothing]]


| [[profileNamespace]] |= See also
|x1= <sqf>
profileNamespace setVariable ["TAG_lastPlayerLocation", getPosASL player];
saveProfileNamespace; // Optional since namespace is saved when game is closed
</sqf>


|seealso= [[saveMissionProfileNamespace]] [[save3DENPreferences]] [[profileNamespace]] [[Profile]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
* Variables are also saved when the game is quit.
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Take On Helicopters: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:ArmA 2 OA: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 19:43, 3 September 2024

Hover & click on the images for description

Description

Description:
Saves all variables stored in profileNamespace to the active Profile.
This command should be used when it is likely that the game will not be closed the usual way (e.g. via Alt + F4) or when the data is important and must not be lost due to a game crash.
  • This command triggers a file operation. As file operations are slow (even on SSDs), it is not recommended to use this command too frequently (i.e. several times per second).
  • Do not save large amounts of data to the profile; the larger the profile file gets, the slower it loads!
  • The profileNamespace is saved automatically when the game is closed.
Take On Helicopters
Heliport status, used in the Career mode for example, is stored in the file that is modified by this command, so be mindful of this to avoid losing data and progress.
Groups:
NamespacesVariables

Syntax

Syntax:
saveProfileNamespace
Return Value:
Nothing

Examples

Example 1:
profileNamespace setVariable ["TAG_lastPlayerLocation", getPosASL player]; saveProfileNamespace; // Optional since namespace is saved when game is closed

Additional Information

See also:
saveMissionProfileNamespace save3DENPreferences profileNamespace Profile

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