Too Many Local Variables
Posted: Tue Jun 21, 2016 2:09 am
Hey modders,
I'm creating a mod but I'm running into a problem regarding local variables used in the control.lua. I have entities in the world that store values concerning themselves as local variables, but if there's too many of these entities in the world, on world load, the game will return an error, telling you the maximum limit of local variables is 200, and this save file has exceeded this.
The only way to restore the file is to uninstall the mod, load the save file, have it kill all entities and items pertaining to that mod automatically, save that game, exit and reinstall the mod and reload the level.
I'm asking you help on solving this case - how can I either reduce the number of local variables I need (work-around); limit the amount of entities placed of this type (worse work-around - factorio is all about going big; putting a hard limit on certain entities seems silly); increase the local variable limit (possibly this means overriding/hacking into base game defaults - something not all users would be happy with); come up with a way to not need local variables?
In my case, I'm setting up the local variables so they can later be altered through research; i.e. have their values altered depending on the amount of research done in a particular, custom tech tree.
Thanks,
Shrooblord
I'm creating a mod but I'm running into a problem regarding local variables used in the control.lua. I have entities in the world that store values concerning themselves as local variables, but if there's too many of these entities in the world, on world load, the game will return an error, telling you the maximum limit of local variables is 200, and this save file has exceeded this.
The only way to restore the file is to uninstall the mod, load the save file, have it kill all entities and items pertaining to that mod automatically, save that game, exit and reinstall the mod and reload the level.
I'm asking you help on solving this case - how can I either reduce the number of local variables I need (work-around); limit the amount of entities placed of this type (worse work-around - factorio is all about going big; putting a hard limit on certain entities seems silly); increase the local variable limit (possibly this means overriding/hacking into base game defaults - something not all users would be happy with); come up with a way to not need local variables?
In my case, I'm setting up the local variables so they can later be altered through research; i.e. have their values altered depending on the amount of research done in a particular, custom tech tree.
Thanks,
Shrooblord