cybrxkhan
Asian Xwedodah
Hello all. Me and The Capo have been attempting to add a wonder into our mods, the Bamyan Buddha Statues - ideally what it's supposed to do is to increase the buildable limit of missionaries from 3 to 5 (so you can have 5 Islamic Missionaries running around, instead of 3, for example). However, the coding doesn't seem to work.
What happens is that even though the wonder does allow you to start building a 4th missionary, after one turn, a message comes up saying that the missionary cannot be built and some gold is given to you as "compensation" (like what happens if you can't finish a wonder).
The J did most of the work here, but he's stumped as well. We based the coding off Tsentsom's HERC Factory Wonder. The coding from the HERC Factory Wonder is below:
And the code from the Bamyan Buddha Statues is below:
If anybody can help us, that'd be really great! Thanks in advance.
What happens is that even though the wonder does allow you to start building a 4th missionary, after one turn, a message comes up saying that the missionary cannot be built and some gold is given to you as "compensation" (like what happens if you can't finish a wonder).
The J did most of the work here, but he's stumped as well. We based the coding off Tsentsom's HERC Factory Wonder. The coding from the HERC Factory Wonder is below:
Spoiler :
Code:
## HERC Factory Start ##
iAssault = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_ASSAULT_MECH')
iHerc = CvUtil.findInfoTypeNum(gc.getBuildingInfo,gc.getNumBuildingInfos(),'BUILDING_HERC_FACTORY')
obsoleteTech = gc.getBuildingInfo(iHerc).getObsoleteTech()
pPlayer = gc.getPlayer(pCity.getOwner())
if eUnit == iAssault:
if ( gc.getTeam(pPlayer.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1 ):
for iCity in range(pPlayer.getNumCities()):
ppCity = pPlayer.getCity(iCity)
if ppCity.getNumActiveBuilding(iHerc) == true:
return True
## HERC Factory End ##
And the code from the Bamyan Buddha Statues is below:
Spoiler :
Code:
## BAMYAN BUDDHA STATUES Start ##
iMissionary = []
iMissionary.append (CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_JEWISH_MISSIONARY'))
iMissionary.append (CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_CHRISTIAN_MISSIONARY'))
iMissionary.append (CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_ISLAMIC_MISSIONARY'))
iMissionary.append (CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_HINDU_MISSIONARY'))
iMissionary.append (CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_BUDDHIST_MISSIONARY') )
iMissionary.append (CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_CONFUCIAN_MISSIONARY'))
iMissionary.append (CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),'UNIT_TAOIST_MISSIONARY'))
iMoreMissionariesWonder = CvUtil.findInfoTypeNum(gc.getBuildingInfo,gc.getNumBuildingInfos(),'BUILDING_BAMYAN')
obsoleteTech = gc.getBuildingInfo(iMoreMissionariesWonder).getObsoleteTech()
pPlayer = gc.getPlayer(pCity.getOwner())
NumReligions = 7
for i in range (NumReligions):
if eUnit == iMissionary[i]:
if pCity.isHasReligion(i):
pUnit = gc.getUnitInfo (eUnit)
Class = pUnit.getUnitClassType ()
MissionaryCount = pPlayer.getUnitClassCount(Class)
if MissionaryCount <5:
if (gc.getTeam(pPlayer.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1 ):
for iCity in range(pPlayer.getNumCities()):
ppCity = pPlayer.getCity(iCity)
if ppCity.getNumActiveBuilding(iMoreMissionariesWonder) == true:
return True
## BAMYAN BUDDHA STATUES End ##
If anybody can help us, that'd be really great! Thanks in advance.