Thread Tools Display Modes
04/13/14, 05:20 AM   #1
Tyx
 
Tyx's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 23
Question GameTime function

Hello,
I want to write a little AddOn to show the ingame time.
This isn't exactly a lua problem but I couldn't find a better sub forum than this one - sry for that.

It is more an API problem. I couldn't find a function which gives me back the current ingame time.
Is there a function like this in the API? I tried many (but maybe overlooked some):

Shows:
how long you are playing:
GetFrameTimeMilliseconds() = GetGameTimeMilliseconds() ~ GetTimeString()

is self explainatory
GetSecondsSinceMidnight()

Don't know exactly what it does... delta is usually a difference between two things but... no idea between which times^^
GetFrameDeltaTimeSeconds()

I think this is for the alliance wars how long the campaign last
GetGameTimeRemaining()

Hope you can help me

I think this addon will be pretty usefull for vamp and ww hunts - it would be nice to know which moon phase it is right now but this will probably not be an api function.
  Reply With Quote
04/13/14, 05:34 AM   #2
Stormknight
 
Stormknight's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 128
I spent a while previously looking for functions that return ingame time or weather and there's nothing in the documentation on the wiki. There may be functions buried within the ZO API, but I don't have access to documentation on that.

Frame delta seconds is the number of milliseconds since the previous frame rendered.
  Reply With Quote
04/13/14, 07:49 AM   #3
skyraker
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 154
As far as I know, there is not a way to tell what the in-game time is right now.

EDIT: Guess I was wrong about GetGameTimeRemaining. It is still there.

Last edited by skyraker : 04/13/14 at 07:54 AM.
  Reply With Quote
04/13/14, 11:31 AM   #4
Tyx
 
Tyx's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 23
GetGameTimeRemaining is for Alliance War only, or isn't it? If I test the function outside PvP (didn't test it inside until now) it shows only a 0.

Maybe we can emulate a weather function if we now how long a day lasts.

Does anybody know?

The FAQ says it is ~5h but i don't really think that this is true because it wouldn't make much sense that a day is not a divider of 24.
Some player state that a day lasts 8h, I try to test this right now.
  Reply With Quote
04/13/14, 01:36 PM   #5
Nogaruk
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 15
Edit: I think I miss read what you were asking. You're looking for the tamriel world time?

if so, I didn't see you mention
GetGameTimeMilliseconds() - Returns: integer gameTimeInMilliseconds

There are a few relative globals and functions as well as Formatting for time and clock time. Probably isn't a difference, but might be worth exploring. I'm not sure we have access to the games world time, though.

I don't recall anywhere in the game that they show game time. It seems as if everything they do is based on real world time. The only thing I can even think of that is game time related is the day/night cycle. So your best bet might actually be to use the midnight function, figure out how long an in-game day takes, and adjust for it yourself.

These may be real world related
GetTimeString() - Returns: string currentTimeString
GetFormattedTime() - Returns: integer formattedTime
EVENT_SHOW_TIME (bool state)
SI_STR_TIME_DESC_DAYS_HOURS_MINUTES_AND_SECONDS
TIME_FORMAT_STYLE_RELATIVE_TIMESTAMP - Not sure what relative is to in this case

Last edited by Nogaruk : 04/13/14 at 02:00 PM.
  Reply With Quote
04/13/14, 02:40 PM   #6
Tyx
 
Tyx's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 23
Yes I am looking for a way to emulate (with the 8h model) or get the current (ingame) time in Tamriel.

GetGameTime...() returns the time you spend in the game this session.

I would test the EVENT but I have no idea how to use that^^
Can we start events too? I thought until now we can only do something if an event occurs.

The SI_STR... gives back "203"
and the other TIME_FORMAT... will give back "10".

I think the API really doesn't contain a function to ask for the time.
Which is sad because Vamps need to know the time (ok they can look to the sky^^) for best use of their abilities.

EDIT forgot the other two^^
GetTimeString() = hh:mm:ss
GetFormattedTime() = hhmmss
  Reply With Quote
04/14/14, 09:58 PM   #7
xevoran
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1
already exists

Tamriel Time
http://www.esoui.com/downloads/info2...Time.html#info

Last edited by xevoran : 04/14/14 at 09:59 PM. Reason: added info
  Reply With Quote
04/15/14, 01:36 AM   #8
EviliusDucain
Join Date: Apr 2014
Posts: 4
Originally Posted by xevoran View Post
it doesn't work correctly tho. tested it. last time it said it was 01:30 pm when it was the darkest point at night
  Reply With Quote
04/15/14, 02:46 AM   #9
Tyx
 
Tyx's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 23
@xevoran yeah that addon looks great - didn't noticed it before, is it new? But like Evilius said it: the time - he use a 4.8h system - is strange.

@Evilius thanks for your work. I think it is easier to find out how long noon is away from the next noon, because it is easier to look at the sun than to find the darkest hour of the night
These are the times I collected yesterday:
left CET and right TST (Tamriel Standard Time )
14:30 12-13h
15:00 14-15h
15:30 16-17h
16:00 18-19h
17:00 ? night
18:00 4-5h dawn
19:00 7h
19:30 9h
20:00 11h
20:30 12-13h
22:00 18-19h sunset
00:00 4-5h dawn

Between the two noons was a 6h wait. And, like you noticed too, the night was 2h long.
I truly hope you are wrong with your 5:30-45h day because it will complicate things^^ But I will test it today

EDIT: I think I have to change my code deeper than I thought. The whole system is based on the 6h system and bugged a lot when I make it a variable... this will take me one day or two.
My plan is to let the user (you) chose to set the time duration (and night) of one day themself or use the default one.
Until we have an exact time (definitely between 5:30 and 6:00h) or an API function this has to do
EDIT2: Damn 6h is it not for sure. The accumulated time delay (the 15min more per "day") have made the sun to set, with the default settings, to 18h (instead of 20h)^^

Last edited by Tyx : 04/15/14 at 07:40 AM.
  Reply With Quote
04/15/14, 03:24 AM   #10
EviliusDucain
Join Date: Apr 2014
Posts: 4
i was just on a moment ago and night started at 9:30 approimately. the times i've given so far is what i belive is the transition moment from where it goes from day to night not the darkest of midnight the moon shots i took was taken at different times during the night but i was online before it transitioned into night each time. i do think my times are mostly correct +/- 10 min off target at most. i suspect i'll see the next night time around 15:15 my time or atleast very close to it. This last night ended at 11:30 so if the other times are correct the day time will last 3h 45m approximately

i'll be sure to get the next nights time regardless.

also i live in gmt +1 so be sure to take that into account when looking at my times

EDIT:also just wanted to point out. its been the same moon all 4 in-game nights now =P

EDIT2: So night happend at 16:00 ... a whole 45 mins later then expected making the day last 4h 30min this time i am not totally sure as i arrived during night at 10:30 or so but night ended at 11:30

EDIT3: At this point i'm starting to get a feeling it would be easier to make an addon that states if its vamp spawn night or werewolf spawn night. people are saying there's 8 days between respawns. and that the beasties will spawn every night time during this day. i got turned saturday at 01:?? am by a ww and 8 days from that makes it sunday the 20th. However since the server is in NA their day would start for us at around saturday the 19th 06:00am If this appears to be true. perhaps its easier to make an addon that goes from there. It would also make people stop having to camp every ingame night in order to hit the right one

Last edited by EviliusDucain : 04/15/14 at 09:23 AM.
  Reply With Quote
04/15/14, 09:31 AM   #11
NWDD
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 3
Hi(TamrielTime author speaking), good thing I found this
I'm looking for noons as a way to find day/night cycle.

Addon won't get time right until day/night cycle is found, every other calculation is already done.
I originaly thought it was a 6h cycle based on preemptive calculations of time.
Then someone linked me the statement of Zenimax Online that says "Each Day/Night cycle lasts for a bit less than 5h" and set it to 4.8, because It integer seconds made sense at the time (3600/4.8 = 5)

After that I've been working on getting the exact time of a cycle by getting noons (sun is at exact south at arround 12:00). Unfortunately It rains every ***** noon. So I had to use shadows.

I'm certain there was a noon 15/04/2014 at 6:33 am (irl, UTC) and another one arround 04/15/14 - 11:47-53 UTC.

I was waiting for this next cycle but we got a surprise maintenance

About vamps, we got a 10-day-no-spawn right now
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » GameTime function


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off