strategyonly
C2C Supreme Commander
I always forget things!
So, do you suggest to only get slaves from land combat?
Well yes, i think that would be appropriate.
I always forget things!
So, do you suggest to only get slaves from land combat?
#mod#
if (pWinner.isMadeAttack()):
iAttacker = pWinner.getOwner()
attacker = PyPlayer(iAttacker)
if gc.getPlayer(iAttacker).isCivic(CvUtil.findInfoTypeNum(gc.getCivicInfo,gc.getNumCivicInfos(),'CIVIC_SLAVERY')):
if ((pLoser.plot()).isCity() == 0):
if (pLoser.isAnimal() == 0):
if (pLoser.getDomainType() == gc.getInfoTypeForString('DOMAIN_LAND') and pWinner.getDomainType() == gc.getInfoTypeForString('DOMAIN_LAND')):
if (pLoser.getCaptureUnitType((gc.getPlayer(pLoser.getOwner())).getCivilizationType()) == -1):
# you can change the chance of getting slaves with this between 0-100, 0 means 0% and 100 100%
iChance = 40
iRandNum = CyGame().getSorenRandNum(99, "Slave")
if iChance > iRandNum:
attacker.initUnit(gc.getCivilizationInfo(gc.getPlayer(iAttacker).getCivilizationType()).getCivilizationUnits(CvUtil.findInfoTypeNum(gc.getUnitClassInfo, gc.getNumUnitClassInfos(), 'UNITCLASS_SLAVE')), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI)
#mod#
The AI_SLAVE messes up worldbuilder so remove it
UNITAI_SLAVE causes errors because worldbuilder doesn't recognize it!
Traceback (most recent call last):
File "CvWBInterface", line 230, in writeDesc
File "CvWBDesc", line 1545, in write
File "CvWBDesc", line 1193, in write
File "CvWBDesc", line 827, in write
AttributeError: 'NoneType' object has no attribute 'getType'
ERR: Python function writeDesc failed, module CvWBInterface
In the last game I played it appears that the AI does not know what to do with these units. They capture a slave and then just leave it standing there for the rest of the game. No one even bothers to attack them.
In the last game I played it appears that the AI does not know what to do with these units. They capture a slave and then just leave it standing there for the rest of the game. No one even bothers to attack them.
What is the slave's UNITAI in the version you're using? The UNITAI_SLAVE was incorrect so AI couldn't understand what to do to them.
Checks. Yes, I am using an old version of the XML.
<!-- Promotion Infos -->
<Civ4PromotionInfos xmlns="x-schema:CIV4UnitSchema.xml">
<UnitAIs>
<UnitAI>
<UnitAIType>UNITAI_ENGINEER</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<UnitAI>
<UnitAIType>UNITAI_MERCHANT</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
<!--UnitAI>
<UnitAIType>UNITAI_SLAVE</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI-->
</UnitAIs>
That mod looks great! Would it be possible to make it modular?
And what code do I have to add (and where) if I want to have all slaves disbanded when the player/AI leaves the slavery civic?
Thanks in advance
CellKu
You are already in the testing stage? How is it coming along? Would be great if you had good news...I am testing a WoC/BUG modular version now. It uses Python code so it can't be straight Civ modular.