Page 1 of 1

Access amount of time played variable?

Posted: Fri May 24, 2013 10:45 pm
by metzyn
Is there a way I can get access to the variables that store the amount of time played? I want to take that time and format it in a way that will display the amount of in-game time a player has experienced, such as how many days, months, and years have gone by.

Re: Access amount of time played variable?

Posted: Fri May 24, 2013 11:05 pm
by FreeER
perhaps game.tick? I do not know if there is a formated version available or not

Re: Access amount of time played variable?

Posted: Mon May 27, 2013 2:13 pm
by metzyn
Its not game.tick for what I am looking. After you save a game or when you are about to load one, you can see how much time you've spent in that level. My most recent displays over 27 hours. Is there a way I can get access to that variable, perhaps via "glob" dot something?

EDIT:
You are correct! "game.tick" is actually what I need.

Re: Access amount of time played variable?

Posted: Mon May 27, 2013 2:26 pm
by metzyn
Is my math correct in that 25,000 ticks per in-game day?

EDIT:
Nope... but I'm super close. Its slightly less than 25,000 ticks. Hey, Factorio devs! What is the exact amount of ticks to an in-game day?

Re: Access amount of time played variable?

Posted: Mon May 27, 2013 3:30 pm
by drs9999
25k ticks/day is correct:
https://forums.factorio.com/forum/vie ... f=18&t=738

BUT if you are playing on an older pc, like me you will not reach the 60tick/sec, so if you try to convert the total ticks into hours, minutes, seconds the calculation probably messed up because of this...

Re: Access amount of time played variable?

Posted: Mon May 27, 2013 4:17 pm
by metzyn
Shame on me for not doing the research to find the ticks/day. Thank you for linking the resource. Right now I have the days, months, years all tied to the game tick. I noticed it was slightly off after a full 24 in-game hours. Not using an older PC... I assume the game shoots for 60/sec and probably bounces between 58-60, which would account for the slight difference.