Page 1 of 1

Access to current real time

Posted: Fri Nov 09, 2018 12:14 pm
by Tarrke
Hi,

there is in the LuaGameScript class an access to the write_file function of the os lua lib. Working on a mod that display timers I'm asked to add a current local time visualisation on the GUI. To answer this, after some lua digging, I found the os.clock() function (https://www.lua.org/pil/22.1.html) I can work with in lua, but here is no access to this function through the Factorio API.

Is it possible to make this function accessible through the Factorio API.

Thanks.

Re: Access to current real time

Posted: Fri Nov 09, 2018 12:15 pm
by Klonan
Tarrke wrote: Fri Nov 09, 2018 12:14 pm Is it possible to make this function accessible through the Factorio API.
Nope, sorry, it isn't deterministic, so would cause desyncs if used

Re: Access to current real time

Posted: Fri Nov 09, 2018 12:17 pm
by Tarrke
Klonan wrote: Fri Nov 09, 2018 12:15 pm Nope, sorry, it isn't deterministic, so would cause desyncs if used
Thanks for the quick answer.

Do you know any workaround for this maybe?