I would like to restrict the training of units that have resource requirements to a certain number of units per instance of the resource controlled. can anyone point me to a mod that does this where I might be able borrow code?
I think RevDCM or Legends of Revolution or Fall from heaven II maybe does this. I'm not totally sure.
def cannotTrain(self,argsList):
pCity = argsList[0]
eUnit = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
bIgnoreUpgrades = argsList[5]
[COLOR="Red"] ePlayer = pCity.getOwner()
pPlayer = gc.getPlayer(ePlayer)
info = gc.getUnitInfo(eUnit)
eUnitClass = info.getUnitClassType()
iBonus = info.getBonusPrereq()
iNumPerBonus = 3
if iBonus != -1:
if pPlayer.getUnitClassCount(eUnitClass) > iNumPerBonus * pPlayer.getNumAvailableBonuses(iBonus):
return True
return False
def cannotTrain(self,argsList):
pCity = argsList[0]
eUnit = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
bIgnoreUpgrades = argsList[5]
[COLOR="Red"]ePlayer = pCity.getOwner()
pPlayer = gc.getPlayer(ePlayer)
info = gc.getUnitInfo(eUnit)
eUnitClass = info.getUnitClassType()
iBonus = info.getPrereqAndBonus()
iNumPerBonus = 3
if iBonus != -1:
if pPlayer.getUnitClassCount(eUnitClass) > iNumPerBonus * pPlayer.getNumAvailableBonuses(iBonus):
return True[/COLOR]
[COLOR="DarkOrange"]for i in range(gc.getNUM_UNIT_PREREQ_OR_BONUSES()):
if info.getPrereqOrBonuses(i):
if pPlayer.getUnitClassCount(eUnitClass) > iNumPerBonus * pPlayer.getNumAvailableBonuses(i):
return True[/COLOR]
return False
for i in range(gc.getNUM_UNIT_PREREQ_OR_BONUSES()):
if info.getPrereqOrBonuses(i):
if pPlayer.getUnitClassCount(eUnitClass) > iNumPerBonus * pPlayer.getNumAvailableBonuses(iBonus):
return True
Hi, all I have a request. I need a building (world wonder), which, if your empire have state religion Tao and will be attacked, wonder generate to the game two units xy_unit. Is such a thing possible?