TC01
Deity
Okay, so after another test, I found that the code highlighted in red (placed in the placeObject function) is working. I put a supernova on a tile with a solar system, and the next turn the solar system did not pop back. It also solves the problem of two solar systems on top of each other. (You can also see the other code I added to add new solar system data below).
However, the code below, added to removeObject, still does not work if I just remove a solar system via the remove button.
Still, at least there is now a way to remove and add solar systems properly. I'd still like to make this work, though...
Code:
if (iCount == iButtonIndex):
[COLOR="Red"] if self.m_pCurrentPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_SOLAR_SYSTEM'):
FinalFrontier = CvEventInterface.getEventManager()
pSystem = FinalFrontier.getSystemAt(self.m_pCurrentPlot.getX(), self.m_pCurrentPlot.getY())
FinalFrontier.apSystems.remove(pSystem)
FinalFrontier.iNumSystems -= 1
self.m_pCurrentPlot.setScriptData("")[/COLOR]
self.m_pCurrentPlot.setFeatureType(i, j)
if i == gc.getInfoTypeForString('FEATURE_SOLAR_SYSTEM'):
FinalFrontier = CvEventInterface.getEventManager()
pSystem = createRandomSystem(self.m_pCurrentPlot.getX(), self.m_pCurrentPlot.getY(), -1, 3)
FinalFrontier.addSystem(pSystem)
However, the code below, added to removeObject, still does not work if I just remove a solar system via the remove button.
Code:
elif (self.m_iNormalMapCurrentList[self.m_normalMapTabCtrl.getActiveTab()] == self.m_iFeatureListID):
iFeatureType = self.m_iNormalMapCurrentIndexes[self.m_normalMapTabCtrl.getActiveTab()]
[COLOR="red"] if self.m_pCurrentPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_SOLAR_SYSTEM'):
FinalFrontier = CvEventInterface.getEventManager()
pSystem = FinalFrontier.getSystemAt(self.m_pCurrentPlot.getX(), self.m_pCurrentPlot.getY())
FinalFrontier.apSystems.remove(pSystem)
FinalFrontier.iNumSystems -= 1
self.m_pCurrentPlot.setScriptData("")[/COLOR]
self.m_pCurrentPlot.setFeatureType(FeatureTypes.NO_FEATURE, -1)
Still, at least there is now a way to remove and add solar systems properly. I'd still like to make this work, though...