Making WB make random solar systems

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).

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...
 
Have you checked the eraseAll function? This function includes a "self.m_pCurrentPlot.setFeatureType(FeatureTypes.NO_FEATURE, -1)".

Anyplace that removes features should have the FF system removal check as well. I think that this place and the removeObject function are the only two, although there may be some place that uses a different value, like just a "-1" (I searched for "FeatureTypes.NO_FEATURE" rather than "setFeatureType").
 
No, I didn't look at the eraseAll function. I'll add the code there- and other places. Thanks God-Emperor!
 
Top Bottom