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.
script.on_configuration_changed question
script.on_configuration_changed question
- Attachments
-
- control.lua
- control
- (8.4 KiB) Downloaded 95 times
Re: script.on_configuration_changed question
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.
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.