Removing a Faction Mid-Playthrough Throws an Exception
This probably only happens if the removed faction has a hive on your map (see my conjecture below).
Save: https://mega.nz/file/55xR1CqZ#lsYAmolUOPTIVUbwqRYbZzMnVBwHS0x5thuoll2Z180
Stack Trace: https://i.imgur.com/IKLW6V8.png
The mod Rampant (1.0.4) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event Rampant::on_land_mine_armed (ID 103)
Rampant/libs/BaseUtils.lua:185: attempt to index field '?' (a nil value)
stack traceback:
Rampant/libs/BaseUtils.lua:185: in function <Rampant/libs/BaseUtils.lua:176>
(...tail calls...)
Rampant/libs/BaseUtils.lua:281: in function 'upgradeEntity'
Rampant/control.lua:768: in function <Rampant/control.lua:752>
(Looks like removing a faction no longer forces Rampant to re-index surfaces. Based on checking out the code referenced in the trace my guess is that if the removed faction has a hive on the map Rampant tries to process hive activities and crashes because the data for that faction no longer exists).
Workaround to remove the faction if you encounter this issue:
1) Pause the game in editor mode (the Hive logic does not execute if the game isn't processing "game play" ticks. You'll crash pretty much instantly in #4 if you skip this step.)
2) Make a save
3) Remove the faction in mod startup settings
4) Load the save
5) Trigger Rampant's surface re-indexing (Note: I couldn't figure out how to do this without editing the source code. So if anyone needs a modified copy of their Rampant version to trigger re-indexing just post a reply and I can edit and upload one for you. The workaround involves creating a surface in editor mode (it can be deleted after). The edit I make is to have Rampant re-index all surfaces instead of just the new surface).
(The re-indexing has the downside of "re-rolling" all hives on your map to a new faction (which is mostly undesired but we've accepted this spike in difficulty in lieu of ending our play through! :P Parts of our solid wall of laser turrets are now fighting the Energy Thief faction and if you're familiar with their resistances we've got a crisis to deal with!)).