View Single Post
11/15/23, 07:06 PM   #1
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 247
Question update character variable on all chars at once?

Looking for a way to update char saved variables all at once while logged into only one toon.

I'm currently running mostly an account wide setup but have a few char specific variables id like to reset at server daily reset. I'm currently saving the per char variables like this:
Code:
ZO_SavedVars:NewAccountWide( MyAddon.svName, MyAddon.svVersion, GetUnitName("player"), defaultSavedCharVars )
MyAddon.charVariables.myvariable = something
what Id like to use is something like this to go through every character on account and set a specifici char variable at daily login which I have the code for already I'm just unsure how to save a char variable for a toon your not logged into:
Code:
function MyAddon.ResetCharacterData()
	for i = 1, GetNumCharacters() do
		local charName = GetCharacterInfo(i)
                charName = charName:sub(1, charName:find("%^") - 1)
		MyAddon.charVariables.charName.myvariable = something
	end
end
Basically in short I'd like to cycle through all characters on acct with a for statement resetting 2 char variables to 0 at daily reset time. Any suggestions?

Last edited by sinnereso : 11/16/23 at 02:32 AM.
  Reply With Quote