script.on_load_finished

Things that we aren't going to implement
Post Reply
AntiElitz
Filter Inserter
Filter Inserter
Posts: 446
Joined: Sat Aug 29, 2015 11:37 pm
Contact:

script.on_load_finished

Post by AntiElitz »

I tried for a long time to run code on the first tick after a game is finisched loading, but there seems to be no clean workaround, without the game desyncing in MP.

Requested features:
-Should fire on the first tick after a game was loaded, so you can edit global.variables
-Should NOT fire when another player joins the game (and load it just for him) to prevent desyncs

Why do I need this?:
-I want to check my config file for changes
-I want to set a global timer that hides the gui after 10 seconds
-I want to react to changes of the config and set active=true for some entities

Rseding91
Factorio Staff
Factorio Staff
Posts: 13235
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: script.on_load_finished

Post by Rseding91 »

What you're asking for is the entire reason we changed on_load to prevent modification of the game state. Loading a map is not meant to change anything about the game. If it did, then replays wouldn't work, and MP wouldn't work.

As for why you want this: I'm already working on a mod config system that will allow you to do all of this without needing to even restart the game.
If you want to get ahold of me I'm almost always on Discord.

AntiElitz
Filter Inserter
Filter Inserter
Posts: 446
Joined: Sat Aug 29, 2015 11:37 pm
Contact:

Re: script.on_load_finished

Post by AntiElitz »

I see. Good to hear about the new system! Any idea on how one could implement a gui button to timeout after 10 seconds for a player than? There is pobably still no way to do so with the new config changes, is there?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13235
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: script.on_load_finished

Post by Rseding91 »

AntiElite wrote:I see. Good to hear about the new system! Any idea on how one could implement a gui button to timeout after 10 seconds for a player than? There is pobably still no way to do so with the new config changes, is there?
Spawn the button on_player_created and 10 seconds later remove it. It will be created for any new player and then ever again.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Won't implement”