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 !
Mesure PAUSE duration
Re: Mesure PAUSE duration
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
There is game.create_profiler(), which displays a duration in milliseconds. But you can't read the value.
Re: Mesure PAUSE duration
https://lua-api.factorio.com/latest/Lua ... cks_playedever_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.
viewtopic.php?f=28&t=85623ever_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 ?
- freeafrica
- Long Handed Inserter

- Posts: 59
- Joined: Mon Aug 19, 2019 2:33 pm
- Contact:
Re: Mesure PAUSE duration
Bump on this. For me an event on `pause/resume` would be superb. I saw that Bob's similar request got put into won't-fix, however this one was still "open" so +1. Now my usecases:
As a gamer I rely heavily on pausing the game (i play on deathworld+++) to plan my next step. Pausing helps me to not worry about getting attacked.
As a newb mod developer I've added a custom (not permanent) rain effect which has sounds (~15sec long). I restart the sounds based on tick-timing. On pause however, the sound continues to play to its end, but since game is paused, tick-callbacks are not firing so my sound-timer gets desynced.
I know there is `game.tick_paused`, however during my play, when I pause to plan something, sometimes I don't execute any extra action on UI, I just think. Hence there is no callback that can read it and apply resync code.
With a pause/resume event, I could resync those timers properly.
EDIT: If I could use the real time, I could deduce pausing from time-ellapse, however `os` is not available (which I understand ofc).
Ty for reading
As a gamer I rely heavily on pausing the game (i play on deathworld+++) to plan my next step. Pausing helps me to not worry about getting attacked.
As a newb mod developer I've added a custom (not permanent) rain effect which has sounds (~15sec long). I restart the sounds based on tick-timing. On pause however, the sound continues to play to its end, but since game is paused, tick-callbacks are not firing so my sound-timer gets desynced.
I know there is `game.tick_paused`, however during my play, when I pause to plan something, sometimes I don't execute any extra action on UI, I just think. Hence there is no callback that can read it and apply resync code.
With a pause/resume event, I could resync those timers properly.
EDIT: If I could use the real time, I could deduce pausing from time-ellapse, however `os` is not available (which I understand ofc).
Ty for reading
- nerf landmines, bots
- change infinite resources (solar, space-mining, etc...)
- change infinite resources (solar, space-mining, etc...)


