The issue is that the variable will not save, its stays 0.
Any ideas?
So far I have been able to find out that the file is created with the default values if they are specified, then neither loading vales or saving them works, as if it could not read or write to the file. I checked permissions, the file has r/w for everyone.
Doing
Lua Code:
for index, param in pairs(TCC.settings) do
CHAT_SYSTEM:AddMessage(index..": "..tostring(param))
end
prints out
Lua Code:
GetInterfaceForCharacter: function: 5A559658
Inside my .txt file I have:
Lua Code:
## SavedVariables: TCC_SV
Inside my .xml I have:
Lua Code:
<OnInitialized>
TCC.OnInitialized()
</OnInitialized>
Inside my lua file I have:
Lua Code:
TCC.settings = {
var = 0
}
function TCC.OnInitialized()
TCC.settings = ZO_SavedVars:NewAccountWide("TCC_SV", 1, nil, TCC.settings)
TCC.settings.var = 1
end
The AddOn's saved var lua file is created just fine inside the \SavedVariables\ folder with this content:
Lua Code:
TCC_SV =
{
["Default"] =
{
["@AccountName"] =
{
["$AccountWide"] =
{
["var"] = 0,
["version"] = 1,
},
},
},
}