Is it possible to access the system time with Fatorio's LUA?
Is it possible to access the system time with Fatorio's LUA?
I would like to make a mod that adds a real world clock to the HUD. Can Fatorio's LUA use os.time or something similar to get the current time on the user's PC?
Re: Is it possible to access the system time with Fatorio's
I though there was "game.time", but seems like there wasn't. os is most likely disabled for security reasons, but mayby they can add lua interface for time.
There is "game.tick" and I noticed you can overwrite it. So you could set it to real time, but you would have to do it everytime you start or load a game and it could cause bad/wierd game behavior. So mayby its not good idea.
There is "game.tick" and I noticed you can overwrite it. So you could set it to real time, but you would have to do it everytime you start or load a game and it could cause bad/wierd game behavior. So mayby its not good idea.

Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Re: Is it possible to access the system time with Fatorio's
The time isn't accessible (as any function that reads from the outside world, as files etc), to avoid desynrchonisation in replays/multiplayer.
Re: Is it possible to access the system time with Fatorio's
By the way, are other system lua functions accessible through factorio?kovarex wrote:The time isn't accessible (as any function that reads from the outside world, as files etc), to avoid desynrchonisation in replays/multiplayer.
Daniel V. Lenskiy
Re: Is it possible to access the system time with Fatorio's
Hm. It could be added, if it would be an event, like any other. Instead of "LMB pressed" a "Systime has changed". Every client sends his events every minute or so, the time between could be estimated by a function call...
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...