API:SaveVariables

Registers a variable to be saved automatically after the SAVE_VARIABLES event is triggered. The variable is automatically loaded before the VARIABLES_LOADED event is triggered.

NOTE: You must call this function every time your addon is loaded, not when the variable's contents change. This function requests that the game save the specified variable on exit, it is not a request for the game to capture the current value and save it. You should always call this from your OnLoad callback. If you fail to call this each time your addon loads, your value will likely get erased.

Arguments

 * variableName
 * String - The name of your variable. NOT the actual variable. Note that it doesn't save functions, threads, or userdata.

Returns

 * none

Related Functions

 * SaveVariablesPerCharacter
 * LoadVariablesAnchor
 * SaveVariablesAnchor