Help with editing unit promotions

Deathpossum

Chieftain
Joined
Jul 21, 2014
Messages
4
Hi all.

I am trying to increase the B17's evasion (originally 50). From what I understand after reading guides on modding, I need to create a new promotion as a new object (which I have done) and then update the B17 to use it. The problem is, I can't work out how, and any searching i've done has not helped. I cannot work out how to reference my new XML file.

My second thought was updating the UnitPromotions file (the one the B17 currently references to for PROMOTION_EVASION) to have my promotion, but I again didn't know how to add a promotion to the list, only how to update numerical values. I've tried searching for answers, but I keep coming up short as nearly everyone is talking about creating new Civs/Leaders/Units/Buildings/ect, when the mod i'm working on wants to simply update a lot of things.

Here is the code that I presume I need to change (America/Units.xml):
Code:
 <Unit_FreePromotions>
    <Row>
      <UnitType>UNIT_AMERICAN_B17</UnitType>
      <PromotionType>PROMOTION_EVASION</PromotionType>
    </Row>
    <Row>
      <UnitType>UNIT_AMERICAN_B17</UnitType>
      <PromotionType>PROMOTION_AIR_SIEGE_1</PromotionType>
    </Row>
  </Unit_FreePromotions>

And here is the code that, unless I am mistaken PROMOTION_EVASION references (in CIV5UnitPromotions.xml):
Code:
<Row>
			<Type>PROMOTION_EVASION</Type>
			<Description>TXT_KEY_PROMOTION_EVASION</Description>
			<Help>TXT_KEY_PROMOTION_EVASION_HELP</Help>
			<Sound>AS2D_IF_LEVELUP</Sound>
			<PromotionPrereqOr1>PROMOTION_AIR_SIEGE_2</PromotionPrereqOr1>
			<PromotionPrereqOr2>PROMOTION_BOMBARDMENT_2</PromotionPrereqOr2>
			<OrderPriority>7</OrderPriority>
			<InterceptionDefenseDamageModifier>-50</InterceptionDefenseDamageModifier>
			<PortraitIndex>23</PortraitIndex>
			<IconAtlas>PROMOTION_ATLAS</IconAtlas>
			<PediaType>PEDIA_AIR</PediaType>
			<PediaEntry>TXT_KEY_PROMOTION_EVASION</PediaEntry>
		</Row>

Any help appreciated, sorry if i'm being a bit daft.
Thanks

Moderator Action: Welcome to CivFanatics. Threads with questions belong in the main C&C forum, so moved it there. Thanks.
 
Maybe an update tag to replace the B17's evasion with yours? If that's what you were looking to do!

Code:
<Unit_FreePromotions>
   <Update>
      <Set PromotionType="YOUR_PROMOTION" />
      <Where UnitType="UNIT_AMERICAN_B17" PromotionType="PROMOTION_EVASION" />
   </Update>
</Unit_FreePromotions>

I'm, er, not totally sure it'd work, but I would try that if it were me. Or did you want to add it rather than replace it?
 
Just create a new promotion with a different InterceptionDefenseDamageModifier than -50, and update the free promotion the B17 gets, like PMF suggested (but I believe the type name should start with PROMOTION_ , so YOUR_PROMOTION is not a good example).

Btw I don't know what you mean by "referencing your XML file" - you only need to reference the promotion you create, XML files are just a way of entering data into the database.
 
Top Bottom