God-Emperor
Deity
This would be yet another FF bug...
I'm surprised this hasn't been noticed before, but I can't find any mention of it.
If a "city" is razed then the next colony to be founded in that same system can have problems. Specifically, the individual planets can claim to have buildings on them that the game DLL doesn't think exist. These phantom buildings can't be built on these planets since the python function cannotConstruct thinks they already exist on the planet so indicates that you cannot do so. You also may be unable to build any buildings that require the phantom buildings for the opposite reason: it appears that if you have not built one of the prereq buildings somewhere in the system then the DLL knows you don't have the prereq at all and won't let you build the building.
I noticed this after I settled in a system that had formerly been a colony of the Paradise civ until a pirate invasion ship killed the defending destroyer and razed the colony maybe 10 turns after it was settled. Since it was a Paradise colony, every planet in the system had a mag-lev system added to it when they colonized it. When I colonized it, the main building list on the left side of the city screen (which is built from data frmothe DLL, not the planets' building data) showed no mag-lev systems but 3 of the 6 planets were still showing mag-lev systems - I assume that the other 3 were wiped out by the random 50% chance for buildings to be destroyed that happens in the onCityAcquired callback.
Tha cause of this is that in the DLL when a city is razed all of the buildings are deleted. This makes sense because in the regular game you can't have buildings anywhere but in a city, no city = no buildings.
The solution is to add an onCityRazed callback to CvFinalFrontierEvents.py so that all of the planets in the system are actually cleared of all buildings when the "city"/colony is razed. Something like this:
There may be a related bug when a system is nuked with a doomsday missile. A planet is disabled but the buildings on it are not removed, either from the planet data or in the DLL's data. I would have to guess that if there was, for example, a bank on the disabled planet it would still give the +25% bonus to money. (I have seen a very small number of doomsday missiles used, but never against a system. I've only ever seen them used against ships in open space.)
I'm surprised this hasn't been noticed before, but I can't find any mention of it.
If a "city" is razed then the next colony to be founded in that same system can have problems. Specifically, the individual planets can claim to have buildings on them that the game DLL doesn't think exist. These phantom buildings can't be built on these planets since the python function cannotConstruct thinks they already exist on the planet so indicates that you cannot do so. You also may be unable to build any buildings that require the phantom buildings for the opposite reason: it appears that if you have not built one of the prereq buildings somewhere in the system then the DLL knows you don't have the prereq at all and won't let you build the building.
I noticed this after I settled in a system that had formerly been a colony of the Paradise civ until a pirate invasion ship killed the defending destroyer and razed the colony maybe 10 turns after it was settled. Since it was a Paradise colony, every planet in the system had a mag-lev system added to it when they colonized it. When I colonized it, the main building list on the left side of the city screen (which is built from data frmothe DLL, not the planets' building data) showed no mag-lev systems but 3 of the 6 planets were still showing mag-lev systems - I assume that the other 3 were wiped out by the random 50% chance for buildings to be destroyed that happens in the onCityAcquired callback.
Tha cause of this is that in the DLL when a city is razed all of the buildings are deleted. This makes sense because in the regular game you can't have buildings anywhere but in a city, no city = no buildings.
The solution is to add an onCityRazed callback to CvFinalFrontierEvents.py so that all of the planets in the system are actually cleared of all buildings when the "city"/colony is razed. Something like this:
Code:
def onCityRazed(self, argsList):
'City Razed'
self.parent.onCityRazed(self, argsList)
pCity, iPlayer = argsList
# Wipe out all of the buildings on all of the planets in the system.
# They will be destroyed by the DLL shortly after this returns (there's no way to avoid it - you can't
# have buildings without a city for them to be in, from the DLL's perspective).
pSystem = self.getSystemAt(pCity.getX(), pCity.getY())
pSystem.aaiSingleBuildingLocations = [] # clear this list
# Loop through all the planets in the system
for iPlanetLoop in range(pSystem.getNumPlanets()):
pPlanet = pSystem.getPlanetByIndex(iPlanetLoop)
# Loop through all building types
for iBuildingLoop in range(gc.getNumBuildingInfos()):
# Set the planet to not have one of these
pPlanet.setHasBuilding(iBuildingLoop, false)
# There are now no buildings left in the system.
There may be a related bug when a system is nuked with a doomsday missile. A planet is disabled but the buildings on it are not removed, either from the planet data or in the DLL's data. I would have to guess that if there was, for example, a bank on the disabled planet it would still give the +25% bonus to money. (I have seen a very small number of doomsday missiles used, but never against a system. I've only ever seen them used against ships in open space.)