How do I add a promotion?

hoonak

Keeper of Odd Knowledge
Joined
Dec 27, 2002
Messages
65
Greetings,
I have a couple capabilities I want to add to certain units. I think the best way would be to add promotions to the game and allow certain units to start with these promotions. I can make the effect work, but I cannot get the promotion to display properly in the Civiliopedia.
I eagerly await your suggestions,
Thanks in advance,
John- Demon Lord of Burbank
 
I am trying to add a unit that has an expanded maritime search radius. This unit would represent Naval Air Services, shore patrols and other defensive reconnaissance efforts.

I would rather use a building for this purpose, but I do not see any reasonable way to add visibility to a building. Since I am not able to use a building, I have chosen to add a unit with no combat strength, no movement value and must be built in a port.

I want the expanded maritime search capability to improve over time. Observation balloons would add a little bit, whereas full blown Coast Guards with multiple different types of aircraft and sea going vessels would have a considerable search area.

The concept is to build this unit in a port and set it to sentry. The unit would then activate if an enemy or pirate came into range.

My addition to Civ4PromotionInfos.xml is as follows:
Spoiler :
<!-- My sentry 2 here -->
<PromotionInfo>
<Type>PROMOTION_SENTRY2</Type>
<Description>TXT_KEY_PROMOTION_SENTRY</Description>
<Sound>AS2D_IF_LEVELUP</Sound>
<LayerAnimationPath>NONE</LayerAnimationPath>
<PromotionPrereq>NONE</PromotionPrereq>
<PromotionPrereqOr1>NONE</PromotionPrereqOr1>
<PromotionPrereqOr2>NONE</PromotionPrereqOr2>
<TechPrereq>TECH_PHYSICS</TechPrereq>
<StateReligionPrereq>NONE</StateReligionPrereq>
<bLeader>0</bLeader>
<bBlitz>0</bBlitz>
<bAmphib>0</bAmphib>
<bRiver>0</bRiver>
<bEnemyRoute>0</bEnemyRoute>
<bAlwaysHeal>0</bAlwaysHeal>
<bHillsDoubleMove>0</bHillsDoubleMove>
<bImmuneToFirstStrikes>0</bImmuneToFirstStrikes>
<iVisibilityChange>2</iVisibilityChange>
<iMovesChange>0</iMovesChange>
<iMoveDiscountChange>0</iMoveDiscountChange>
<iAirRangeChange>0</iAirRangeChange>
<iInterceptChange>0</iInterceptChange>
<iEvasionChange>0</iEvasionChange>
<iWithdrawalChange>0</iWithdrawalChange>
<iCargoChange>0</iCargoChange>
<iCollateralDamageChange>0</iCollateralDamageChange>
<iBombardRateChange>0</iBombardRateChange>
<iFirstStrikesChange>0</iFirstStrikesChange>
<iChanceFirstStrikesChange>0</iChanceFirstStrikesChange>
<iEnemyHealChange>0</iEnemyHealChange>
<iNeutralHealChange>0</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>
<iKamikazePercent>0</iKamikazePercent>
<iRevoltProtection>0</iRevoltProtection>
<iCollateralDamageProtection>0</iCollateralDamageProtection>
<iPillageChange>0</iPillageChange>
<iUpgradeDiscount>0</iUpgradeDiscount>
<iExperiencePercent>0</iExperiencePercent>
<TerrainAttacks/>
<TerrainDefenses/>
<FeatureAttacks/>
<FeatureDefenses/>
<UnitCombatMods/>
<DomainMods/>
<TerrainDoubleMoves/>
<FeatureDoubleMoves/>
<UnitCombats>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
</UnitCombats>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Units/Sentry2_128.dds,Art/Interface/Buttons/Promotions_Atlas.dds,5,6</Button>
</PromotionInfo>
<!-- My sentry 4 here -->
<PromotionInfo>
<Type>PROMOTION_SENTRY4</Type>
<Description>TXT_KEY_PROMOTION_SENTRY</Description>
<Sound>AS2D_IF_LEVELUP</Sound>
<LayerAnimationPath>NONE</LayerAnimationPath>
<PromotionPrereq>NONE</PromotionPrereq>
<PromotionPrereqOr1>NONE</PromotionPrereqOr1>
<PromotionPrereqOr2>NONE</PromotionPrereqOr2>
<TechPrereq>TECH_FLIGHT</TechPrereq>
<StateReligionPrereq>NONE</StateReligionPrereq>
<bLeader>0</bLeader>
<bBlitz>0</bBlitz>
<bAmphib>0</bAmphib>
<bRiver>0</bRiver>
<bEnemyRoute>0</bEnemyRoute>
<bAlwaysHeal>0</bAlwaysHeal>
<bHillsDoubleMove>0</bHillsDoubleMove>
<bImmuneToFirstStrikes>0</bImmuneToFirstStrikes>
<iVisibilityChange>4</iVisibilityChange>
<iMovesChange>0</iMovesChange>
<iMoveDiscountChange>0</iMoveDiscountChange>
<iAirRangeChange>0</iAirRangeChange>
<iInterceptChange>0</iInterceptChange>
<iEvasionChange>0</iEvasionChange>
<iWithdrawalChange>0</iWithdrawalChange>
<iCargoChange>0</iCargoChange>
<iCollateralDamageChange>0</iCollateralDamageChange>
<iBombardRateChange>0</iBombardRateChange>
<iFirstStrikesChange>0</iFirstStrikesChange>
<iChanceFirstStrikesChange>0</iChanceFirstStrikesChange>
<iEnemyHealChange>0</iEnemyHealChange>
<iNeutralHealChange>0</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>
<iKamikazePercent>0</iKamikazePercent>
<iRevoltProtection>0</iRevoltProtection>
<iCollateralDamageProtection>0</iCollateralDamageProtection>
<iPillageChange>0</iPillageChange>
<iUpgradeDiscount>0</iUpgradeDiscount>
<iExperiencePercent>0</iExperiencePercent>
<TerrainAttacks/>
<TerrainDefenses/>
<FeatureAttacks/>
<FeatureDefenses/>
<UnitCombatMods/>
<DomainMods/>
<TerrainDoubleMoves/>
<FeatureDoubleMoves/>
<UnitCombats>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
</UnitCombats>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Units/Sentry4_128.dds,Art/Interface/Buttons/Promotions_Atlas.dds,5,6</Button>
</PromotionInfo>
<!-- My sentry 6 here -->
<PromotionInfo>
<Type>PROMOTION_SENTRY6</Type>
<Description>TXT_KEY_PROMOTION_SENTRY</Description>
<Sound>AS2D_IF_LEVELUP</Sound>
<LayerAnimationPath>NONE</LayerAnimationPath>
<PromotionPrereq>NONE</PromotionPrereq>
<PromotionPrereqOr1>NONE</PromotionPrereqOr1>
<PromotionPrereqOr2>NONE</PromotionPrereqOr2>
<TechPrereq>TECH_RADIO</TechPrereq>
<StateReligionPrereq>NONE</StateReligionPrereq>
<bLeader>0</bLeader>
<bBlitz>0</bBlitz>
<bAmphib>0</bAmphib>
<bRiver>0</bRiver>
<bEnemyRoute>0</bEnemyRoute>
<bAlwaysHeal>0</bAlwaysHeal>
<bHillsDoubleMove>0</bHillsDoubleMove>
<bImmuneToFirstStrikes>0</bImmuneToFirstStrikes>
<iVisibilityChange>6</iVisibilityChange>
<iMovesChange>0</iMovesChange>
<iMoveDiscountChange>0</iMoveDiscountChange>
<iAirRangeChange>0</iAirRangeChange>
<iInterceptChange>0</iInterceptChange>
<iEvasionChange>0</iEvasionChange>
<iWithdrawalChange>0</iWithdrawalChange>
<iCargoChange>0</iCargoChange>
<iCollateralDamageChange>0</iCollateralDamageChange>
<iBombardRateChange>0</iBombardRateChange>
<iFirstStrikesChange>0</iFirstStrikesChange>
<iChanceFirstStrikesChange>0</iChanceFirstStrikesChange>
<iEnemyHealChange>0</iEnemyHealChange>
<iNeutralHealChange>0</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>
<iKamikazePercent>0</iKamikazePercent>
<iRevoltProtection>0</iRevoltProtection>
<iCollateralDamageProtection>0</iCollateralDamageProtection>
<iPillageChange>0</iPillageChange>
<iUpgradeDiscount>0</iUpgradeDiscount>
<iExperiencePercent>0</iExperiencePercent>
<TerrainAttacks/>
<TerrainDefenses/>
<FeatureAttacks/>
<FeatureDefenses/>
<UnitCombatMods/>
<DomainMods/>
<TerrainDoubleMoves/>
<FeatureDoubleMoves/>
<UnitCombats>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
</UnitCombats>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Units/Sentry6_64.dds,Art/Interface/Buttons/Promotions_Atlas.dds,5,6</Button>
</PromotionInfo>
<!-- My sentry 8 here -->
<PromotionInfo>
<Type>PROMOTION_SENTRY8</Type>
<Description>TXT_KEY_PROMOTION_SENTRY</Description>
<Sound>AS2D_IF_LEVELUP</Sound>
<LayerAnimationPath>NONE</LayerAnimationPath>
<PromotionPrereq>NONE</PromotionPrereq>
<PromotionPrereqOr1>NONE</PromotionPrereqOr1>
<PromotionPrereqOr2>NONE</PromotionPrereqOr2>
<TechPrereq>TECH_ADVANCED_FLIGHT</TechPrereq>
<StateReligionPrereq>NONE</StateReligionPrereq>
<bLeader>0</bLeader>
<bBlitz>0</bBlitz>
<bAmphib>0</bAmphib>
<bRiver>0</bRiver>
<bEnemyRoute>0</bEnemyRoute>
<bAlwaysHeal>0</bAlwaysHeal>
<bHillsDoubleMove>0</bHillsDoubleMove>
<bImmuneToFirstStrikes>0</bImmuneToFirstStrikes>
<iVisibilityChange>8</iVisibilityChange>
<iMovesChange>0</iMovesChange>
<iMoveDiscountChange>0</iMoveDiscountChange>
<iAirRangeChange>0</iAirRangeChange>
<iInterceptChange>0</iInterceptChange>
<iEvasionChange>0</iEvasionChange>
<iWithdrawalChange>0</iWithdrawalChange>
<iCargoChange>0</iCargoChange>
<iCollateralDamageChange>0</iCollateralDamageChange>
<iBombardRateChange>0</iBombardRateChange>
<iFirstStrikesChange>0</iFirstStrikesChange>
<iChanceFirstStrikesChange>0</iChanceFirstStrikesChange>
<iEnemyHealChange>0</iEnemyHealChange>
<iNeutralHealChange>0</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>
<iKamikazePercent>0</iKamikazePercent>
<iRevoltProtection>0</iRevoltProtection>
<iCollateralDamageProtection>0</iCollateralDamageProtection>
<iPillageChange>0</iPillageChange>
<iUpgradeDiscount>0</iUpgradeDiscount>
<iExperiencePercent>0</iExperiencePercent>
<TerrainAttacks/>
<TerrainDefenses/>
<FeatureAttacks/>
<FeatureDefenses/>
<UnitCombatMods/>
<DomainMods/>
<TerrainDoubleMoves/>
<FeatureDoubleMoves/>
<UnitCombats>
<UnitCombat>
<UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
<bUnitCombat>1</bUnitCombat>
</UnitCombat>
</UnitCombats>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Units/Sentry8_64.dds,Art/Interface/Buttons/Promotions_Atlas.dds,5,6</Button>
</PromotionInfo>


I am adding some units to use these promotions. I am still working on the units. These are my current screenshots:

Hope this helps.
 

Attachments

  • sentry2.jpg
    sentry2.jpg
    3 KB · Views: 89
  • Civ4ScreenShot0002.JPG
    Civ4ScreenShot0002.JPG
    172.6 KB · Views: 54
You are specifying the button using the atlas syntax, so it is using the button from the atlas like you are telling it to. Since you specify the same atlas entry for each they are all using the same plain old sentry button.

To just use a DDS file just specify the file. No leading comma. No trailing comma or anything that comes after it either. Just a "<Button>Art/Units/Sentry8_64.dds</Button>" type thing for each.
 
As God-Emperor says for the button, and this is problem with the text, each promotion has same entry on this line
Code:
<Description>TXT_KEY_PROMOTION_SENTRY</Description>
make each one slightly different like PROMOTION_SENTRY2 and so on and then
add something like this to CIV4GameText_Objects_BTS.xml so each promotion is named properly
Code:
	<TEXT>	
		<Tag>TXT_KEY_PROMOTION_SENTRY2</Tag>
		<English>Sentry II</English>
		<French/>
		<German/>
		<Italian/>
		<Spanish/>
	</TEXT>
Also I have just noticed this in your code, at the moment the promotion is available to all Siege Weapons
Code:
<UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
Have you considered giving the unit its own UnitCombatType?
That way you could make a collection of Maritime Recon units with their own promotions set, which don't have all the siege promotions as well
and conversely so that siege weapons don't have the maritime sentry promotions.
Plus you could then add some of the existing promotions that may suit your new units.
 
I am trying to add a unit that has an expanded maritime search radius. This unit would represent Naval Air Services, shore patrols and other defensive reconnaissance efforts.

I would rather use a building for this purpose, but I do not see any reasonable way to add visibility to a building.

You might want to take a look at the first python wonder here.
 
You guys are great. I have fixed most of the problems. I still have some cheeziness with respect to graphics and I had to add a movement point (otherwise it would never activate), but I am close to fixing it.
 
Back
Top Bottom