Mesure PAUSE duration

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
ever_Lord
Inserter
Inserter
Posts: 20
Joined: Thu Apr 02, 2020 7:20 pm
Contact:

Mesure PAUSE duration

Post 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 !

ever_Lord
Inserter
Inserter
Posts: 20
Joined: Thu Apr 02, 2020 7:20 pm
Contact:

Re: Mesure PAUSE duration

Post 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 ?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Mesure PAUSE duration

Post by DaveMcW »

There is game.create_profiler(), which displays a duration in milliseconds. But you can't read the value.

curiosity
Filter Inserter
Filter Inserter
Posts: 325
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Mesure PAUSE duration

Post 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

Post Reply

Return to “Modding interface requests”