script.on_configuration_changed question

Place to get help with not working mods / modding interface.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1455
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

script.on_configuration_changed question

Post by TheSAguy »

In this control.lua file, i have script.on_configuration_changed twice.
Once by itself lines 42 and again in line 243, where it calls a function "On_Load"

Is this okay, or could there be problems because it's there twice?

Thanks.
Attachments
control.lua
control
(8.4 KiB) Downloaded 95 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 15921
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: script.on_configuration_changed question

Post by Rseding91 »

1. The first instance is 100% useless as the game already does exactly what that is doing when a mod is added, removed, or changed.

2. The script is setup in such a way that script.on_load might try to access game.tick which won't work because game is not accessible during on_load.

It looks like whoever wrote the script isn't aware of when things are going to be run and is just "throwing" checks/events around "until stuff works" :)

So, you can remove both and it will probably work fine.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Modding help”