Page 1 of 1

Mesure PAUSE duration

Posted: Thu Jun 02, 2022 10:01 am
by ever_Lord
Now that we have game.tick_paused=true/false we can use it to pause a game while chat is still active, and that is GREAT.
In my case, I would also like to know how long a pause is/has last, so we can get the statistic of lobby time during a game.

maybe something like game.virtual_ticks_while_paused could be equal to "nil" unless game.tick_paused==true.

we also could use this to limit the pause duration, but since ticks are "paused" it seems impossible, unless we have a button_to_click "pause duration" that will show the number of virtual ticks since pause is active, and will unpause the game if duration exceed a limit (need human/referee action regularly , but better than nothing)

context: Biter battles championships where we had very long pauses that killed the show for streamers/viewers.

thanks !

Re: Mesure PAUSE duration

Posted: Thu Jun 02, 2022 10:04 am
by ever_Lord
now i think of it, is there a possibility to add an event: "on_game_paused" that would be triggered every "virtual tick" or "every real-time second" or something ?

Re: Mesure PAUSE duration

Posted: Thu Jun 02, 2022 11:51 am
by DaveMcW
There is game.create_profiler(), which displays a duration in milliseconds. But you can't read the value.

Re: Mesure PAUSE duration

Posted: Fri Jun 03, 2022 6:07 am
by curiosity
ever_Lord wrote:
Thu Jun 02, 2022 10:01 am
Now that we have game.tick_paused=true/false we can use it to pause a game while chat is still active, and that is GREAT.
In my case, I would also like to know how long a pause is/has last, so we can get the statistic of lobby time during a game.
https://lua-api.factorio.com/latest/Lua ... cks_played
ever_Lord wrote:
Thu Jun 02, 2022 10:04 am
now i think of it, is there a possibility to add an event: "on_game_paused" that would be triggered every "virtual tick" or "every real-time second" or something ?
viewtopic.php?f=28&t=85623