Vadi wrote:Sneak peek is in the downloads page atm.
Went and looked at the downloads page...
Variable Persistence System -- Easily save settings between sessions!
remember( varName ) - flags a variable to be saved. Variables pending saving are stored in the table _saveTable
loadVars() - loads saved variables out of SavedVariables.lua into _G (global namespace).
saveVars() - saves all variables flagged for saving into SavedVariables.lua. Stores their values at time func is called.
Notes: Variables are loaded with the same name they were saved as. Saving global "myVar" will load it load it back in as global "myVar" when loadVars() is called.
I just want to make sure I am understanding all of this correctly because scripting and triggers and stuff is pretty new to me.
In the alias that I use to set the backeq variable I should call the function remember(backeq). That way whenever I set the variable to a new value it will flag it to save over the previous version in the SavedVariables.lua table. I then need to create 2 new triggers. 1)that fires when the session first starts, which is pretty easy because I can trigger it off of the welcome text, that will call loadVars(). and 2) that fires when the session ends, triggering off of the rent out text probably, that calls saveVars().
And doing that will save my backeq variable and take it from session to session...and I can apply that to any other variable that I want to be moveable as well...correct?