I didn't test it but I think it has something to do with the time (OS Time) which is at the top left corner if you open your map.
EDIT1: I created a little AddOn on base of a DB where you can put a example time to calc the in-game time from there.
Like I see the sun setting and use the command /cl sunset to save the time.
Because we know that a day is 6h long (2h night 4h day) - I hope this is right^^ - it will now set the midnight 1h, the sunrise 2h and noon 4h later (and all of that 4x because 6*4 = 24
)
But it has one big problem if the day-night cycle isn't 6h long xD
And an other small one because I get an Error right after the login.
Lua Code:
local mid_h = settings.gameTime["midnight"]["h"] --[[ <-- ERROR ATTEMPED
user:/AddOns/Clock/Clock.lua:135: attempt to index a nil value stack traceback:
user:/AddOns/Clock/Clock.lua:135: in function 'GetInGameTime'
user:/AddOns/Clock/Clock.lua:199: in function 'PrintClock'
18135679543117558641:3: in function '(main chunk)' ]]
Lua Code:
-------------------------------------------
-- Start
-------------------------------------------
local function Clock_OnLoaded(eventCode, addOnName)
if(addOnName ~= "Clock") then
return
end
settings = ZO_SavedVars:NewAccountWide("Clock_Settings", 0.1, "settings", defaults)
-- Commands
-- Register
-- Unregister
end
------------------
-- Init
------------------
local function Clock_Init()
EVENT_MANAGER:RegisterForEvent("Clock", EVENT_ADD_ON_LOADED, Clock_OnLoaded)
end
Clock_Init()
I use the xml OnUpdate function to call my function PrintClock(). I think it is called before the settings are loaded/saved and so it only gets a nil value...
EDIT2: I fixed it (and a lot more) by giving the local settings not the = nil value but the defaults (with the database). So the first few times hte OnUpdate asks for a value it gets the default values back until the user values are loaded.
BTW:
http://www.esoui.com/downloads/info2...ndartTime.html my AddOn is online