Hi,
This mod is really cool, but is there any plan to add any more features/variety? Or is there another mod that does this to Final Frontier?
Cheers,
Yes, there is. In fact, if you look at the 1.4 changelog in the first post, I'm going to be adding some new techs, buildings, promotions, and also add unique buildings and units for all civilizations.
This is not an issue with my mod because yesterday it gave no exceptions. I reinstalled BTS and
it fixed the issue. It means that I corrupted some vanilla files.
I am still interested in this:
Hey TC01! In the post #126 there was an error reported that buildings are on planets but not on the list to the left.
I use "standard" method (in CvSolarSystem.py) to add free buildings to a homeworld (it originally lists nutrition facility and mining facility) and new buildings are added to a planet but do not appear on the left.
Were you able to assign building spawning via python properly?
If you want to add a building to a city, you need to do this:
Code:
pCity.setNumRealBuilding(iBuilding, pCity.getNumRealBuilding(iBuilding)+1)
pPlanet.setHasBuilding(iBuilding)
pCity is obviously the city. pPlanet is the planet you want to assign the building to.
"iBuilding" is an integer (really a buildingtypes enumerator in the SDK, but that's not important) that represents the order of the building in CIV4BuildingInfos.xml. To get it, use gc.getInfoTypeForString('BUILDING_WHATEVER')
The second argument in setNumRealBuilding() is the number of that building you want to have in the city. Normally this would be a 0 or a 1. But in Final Frontier, you usually want to use "pCity.getNumRealBuilding(iBuilding)" plus or minus one (because you can have multiple buildings). So in this case it's +1.
You can't just add the building to a planet or the city, you must do both.
Now... addBasicBuildingsToBestPlanet(pSystem), which I think is what you are talking about, does this:
Code:
def addBasicBuildingsToBestPlanet(pSystem):
pPlot = CyMap().plot(pSystem.getX(), pSystem.getY())
pCity = pPlot.getPlotCity()
iNutritionFacility = CvUtil.findInfoTypeNum(gc.getBuildingInfo,gc.getNumBuildingInfos(),'BUILDING_NUTRITION_FACILITY')
iMiningFacility = CvUtil.findInfoTypeNum(gc.getBuildingInfo,gc.getNumBuildingInfos(),'BUILDING_MINING_FACILITY')
pCity.setNumRealBuilding(iNutritionFacility, pCity.getNumRealBuilding(iNutritionFacility) + 1)
pCity.setNumRealBuilding(iMiningFacility, pCity.getNumRealBuilding(iMiningFacility) + 1)
iBestPlanetIndex = getBestPlanetInSystem(pSystem)
# Free buildings on the homeworld
pPlanet = pSystem.getPlanetByIndex(iBestPlanetIndex)
pPlanet.setHasBuilding(iNutritionFacility, true)
pPlanet.setHasBuilding(iMiningFacility, true)
You notice that it both adds the buildings to the city and adds them to the best planet. So you need to do both too.