orlanth
Storm God. Yarr!
- Joined
- Nov 17, 2001
- Messages
- 1,805
To prevent players from using a captured Treasure to explore around at will, I'm trying to apply promotion to Treasure units that reduces their sight range and gives a negative healing rate. Giving this promotion in Civ4Unitinfos.xml didnt work, so I tried adding the following python code in Cv4EventManager.py .
Unfortunately it's still doesn't seem to be doing anything. Can anyone spot what I'm doing wrong?
Code:
def onUnitCreated(self, argsList):
'Unit Completed'
unit = argsList[0]
#treasure promo
unitInfo = gc.getUnitInfo(unit.getUnitType())
if unitInfo == gc.getInfoTypeForString('UNIT_TREASURE'):
unit.setHasPromotion(gc.getInfoTypeForString("PROMOTION_VULNERABLE"), 1)
#end treasure promo
if (not self.__LOG_UNITBUILD):
return
Unfortunately it's still doesn't seem to be doing anything. Can anyone spot what I'm doing wrong?
Spoiler :
<PromotionInfo>
<Type>PROMOTION_VULNERABLE</Type>
<Description>Vulnerable</Description>
<Sound>AS2D_IF_LEVELUP</Sound>
<PromotionPrereq>NONE</PromotionPrereq>
<PromotionPrereqOr1>NONE</PromotionPrereqOr1>
<PromotionPrereqOr2>NONE</PromotionPrereqOr2>
<bLeader>0</bLeader>
<bBlitz>0</bBlitz>
<bAmphib>0</bAmphib>
<bRiver>0</bRiver>
<bEnemyRoute>0</bEnemyRoute>
<bAlwaysHeal>0</bAlwaysHeal>
<bHillsDoubleMove>0</bHillsDoubleMove>
<iVisibilityChange>-1</iVisibilityChange>
<iMovesChange>0</iMovesChange>
<iMoveDiscountChange>0</iMoveDiscountChange>
<iWithdrawalChange>0</iWithdrawalChange>
<iCargoChange>0</iCargoChange>
<iBombardRateChange>0</iBombardRateChange>
<iEnemyHealChange>-10</iEnemyHealChange>
<iNeutralHealChange>-10</iNeutralHealChange>
<iFriendlyHealChange>0</iFriendlyHealChange>
<iSameTileHealChange>0</iSameTileHealChange>
<iAdjacentTileHealChange>0</iAdjacentTileHealChange>
<iCombatPercent>0</iCombatPercent>
<iCityAttack>0</iCityAttack>
<iCityDefense>0</iCityDefense>
<iHillsAttack>0</iHillsAttack>
<iHillsDefense>0</iHillsDefense>
<iPillageChange>0</iPillageChange>
<iUpgradeDiscount>0</iUpgradeDiscount>
<iExperiencePercent>0</iExperiencePercent>
<TerrainAttacks/>
<TerrainDefenses/>
<FeatureAttacks/>
<FeatureDefenses/>
<UnitClassAttackMods/>
<UnitClassDefenseMods/>
<UnitCombatMods/>
<DomainMods/>
<TerrainDoubleMoves/>
<FeatureDoubleMoves/>
<UnitCombats/>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<bGraphicalOnly>1</bGraphicalOnly>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/Buttons/units/floating eye.dds</Button>
</PromotionInfo>
<Type>PROMOTION_VULNERABLE</Type>
<Description>Vulnerable</Description>
<Sound>AS2D_IF_LEVELUP</Sound>
<PromotionPrereq>NONE</PromotionPrereq>
<PromotionPrereqOr1>NONE</PromotionPrereqOr1>
<PromotionPrereqOr2>NONE</PromotionPrereqOr2>
<bLeader>0</bLeader>
<bBlitz>0</bBlitz>
<bAmphib>0</bAmphib>
<bRiver>0</bRiver>
<bEnemyRoute>0</bEnemyRoute>
<bAlwaysHeal>0</bAlwaysHeal>
<bHillsDoubleMove>0</bHillsDoubleMove>
<iVisibilityChange>-1</iVisibilityChange>
<iMovesChange>0</iMovesChange>
<iMoveDiscountChange>0</iMoveDiscountChange>
<iWithdrawalChange>0</iWithdrawalChange>
<iCargoChange>0</iCargoChange>
<iBombardRateChange>0</iBombardRateChange>
<iEnemyHealChange>-10</iEnemyHealChange>
<iNeutralHealChange>-10</iNeutralHealChange>
<iFriendlyHealChange>0</iFriendlyHealChange>
<iSameTileHealChange>0</iSameTileHealChange>
<iAdjacentTileHealChange>0</iAdjacentTileHealChange>
<iCombatPercent>0</iCombatPercent>
<iCityAttack>0</iCityAttack>
<iCityDefense>0</iCityDefense>
<iHillsAttack>0</iHillsAttack>
<iHillsDefense>0</iHillsDefense>
<iPillageChange>0</iPillageChange>
<iUpgradeDiscount>0</iUpgradeDiscount>
<iExperiencePercent>0</iExperiencePercent>
<TerrainAttacks/>
<TerrainDefenses/>
<FeatureAttacks/>
<FeatureDefenses/>
<UnitClassAttackMods/>
<UnitClassDefenseMods/>
<UnitCombatMods/>
<DomainMods/>
<TerrainDoubleMoves/>
<FeatureDoubleMoves/>
<UnitCombats/>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<bGraphicalOnly>1</bGraphicalOnly>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/Buttons/units/floating eye.dds</Button>
</PromotionInfo>