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
script.on_load_finished
Re: script.on_load_finished
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.
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.
Re: script.on_load_finished
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?
Re: script.on_load_finished
Spawn the button on_player_created and 10 seconds later remove it. It will be created for any new player and then ever again.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?
If you want to get ahold of me I'm almost always on Discord.