Page 1 of 1

script.on_configuration_changed question

Posted: Fri Apr 08, 2016 2:02 am
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.

Re: script.on_configuration_changed question

Posted: Fri Apr 08, 2016 2:09 am
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.