Access amount of time played variable?
Access amount of time played variable?
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.
Factorio Modder
Solar Expansion
Solar Expansion
Re: Access amount of time played variable?
perhaps game.tick? I do not know if there is a formated version available or not
<I'm really not active any more so these may not be up to date>
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me
Or drop into #factorio on irc.esper.net
~FreeER=Factorio Modding
- Factorio Wiki
- My Factorio Modding Guide
- Wiki Modding Guide
Feel free to pm me
Or drop into #factorio on irc.esper.net
Re: Access amount of time played variable?
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.
EDIT:
You are correct! "game.tick" is actually what I need.
Factorio Modder
Solar Expansion
Solar Expansion
Re: Access amount of time played variable?
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?
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?
Factorio Modder
Solar Expansion
Solar Expansion
Re: Access amount of time played variable?
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...
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?
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.
Factorio Modder
Solar Expansion
Solar Expansion