I don't have Space Exploration! My modification re-index all spidertrons every time we use the weapon switcher that this mod provides. Probably exists a better way to do this, but I don't know how to mod this game very much. And I'm not familiar with Lua...
Maybe someone can provide a better fix...
Dominiquini, I figured out a better way to handle situations when the spidertron control center UI gets out of sync when weapon switcher is toggled. Instead of having the populate_initial_spidertrons() kick off on every rename, build, destroy event in the game, I added a simple console command using
commands.add_command() and I can manually run it. I dont toggle my weapons very much at all, so manual console command is simple and doesn't cause performance issues when these events trigger.
If you want the code I used for this, let me know