ZO_SavedVars - account vs character behavior?
Trying to understand the behavior and interaction between ZO_SavedVars:NewCharacterId() and ZO_SavedVars:NewAccountWide() ...
If I want to offer character-specific saved variables, would I call BOTH functions and then decide which set of variables to actually use? If I do call BOTH, at save time, does the game save BOTH sets of variables? Thanks! Tazmyr |
Quote:
If you just want to offer character specific variables, then you only need the characterID variables. If you plan to do different svaed variable profiles (e.g. writ crafter, you can choose between account wide and character specific) then you'd use both. |
If you want to use both you could e.g. use the account wide SavedVariables with the 3rd parameter (if left nil it will use the value "Default" in the SV table) as a speficif table name like "AccountBaseSettings" where you store the SavedVariables save mode (character or account wide) and other base addon settings like the language etc. which should be the same for the account.
And then you'd load the CharacterId or other account wide settings from another table like "Settings", or the "Default" table. Keep in mind there exist different servers like EU megaserver and NA megaserver, and the public test server PTS. You can use GetWorldName() to get the name of the actual server and could use this as well in the ZO_SavedVars: ... (AccountWide or CharacterId) function parameter for profile e.g. to save the different server's savedvars below a subtable of the server's name. The last parameter of ZO_SavedVars:NewAccountWide will be the name of the account the data will be saved to. If you leave it empty the game will use the function GetDisplayName() which returns your current @AccountName. But you could also just specify a string like "AllAccounts" or "All" or "Master" or whatever so all the accounts of the player (at a server) will be saved the same way. |
Thanks!
Thanks Dolgubon and Baertram! Just what I needed.
I appreciate your time. |
All times are GMT -6. The time now is 09:04 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI