Need help with my first mod

matt94

Warlord
Joined
Jul 18, 2009
Messages
118
I'm trying to make a mod that simply makes the morale promotion possible to get without the National Wonder. I've played around with the XML file, but nothing is happening when I test it. :(

I attached a picture showing everything I've done

Basically what I did was make <cannotbechosen> false and moved the whole morale thing above the <!--These entries can be gained from Policies, Wonders, etc.--> line, even though I'm not sure if that matters.

Any idea what I'm doing wrong? Most likely a silly newbie mistake...:lol:

Also another quick question, what would I put in the XML file to make the promotion require the unit to be like level 10 or something, for balancing purposes?
 

Attachments

  • Morale.PNG
    Morale.PNG
    204.6 KB · Views: 57
In Civ5UnitPromotions.xml there are a several sections. If you collapse the XML structure, you'll see tags (sections) like <UnitPromotions> which you modified but also:
<UnitPromotions_UnitClasses> , <UnitPromotions_UnitCombats> etc

For example, Shock promotion specifies in <UnitPromotions_UnitCombats> types of units for which it is applicable. Make sure that your new promotions have entries in all the same sections as the game-defined promotions which can be chosen (use search inside the file)
 
Also another quick question, what would I put in the XML file to make the promotion require the unit to be like level 10 or something, for balancing purposes?

You can't.

All you can do is make that promotion explicitly require the unit to already have another promotion, using the <PromotionPrereqOR1> through <PromotionPrereqOR4> stubs. See the existing promotions for examples of this; there are quite a few promotions that require Shock III or Drill III to unlock.


Your bigger problem is YOU'RE DOING IT ALL WRONG.

In XML modding, you do not replace the entire file with a new version; you only modify or add to the existing file. The game will take the vanilla version of the file as the baseline, and add your changes to it.
So your entire mod is completely screwed up; you're re-defining all of the existing promotions, meaning the game now thinks there'll be two of everything. Except it won't, because you also duplicated the Table definition and it can't allow that.

All you do is this:
Code:
<GameData>
  <UnitPromotions>
    <Update>
      <Set CannotBeChosen="false"/>
      <Where Type="PROMOTION_MORALE"/>
    </Update>
  </UnitPromotions>
<GameData>
That's it. Period. Mod is now complete. (If that Set command doesn't work, try Set CannotBeChosen="0"; the Booleans are kinda flaky in Civ5.)

If you're adding a new entry you use a <Row> definition, just like in the vanilla file. If you're modifying, you use <Update>, and if you're deleting you use a <Delete>. Go to the Tutorials section and find the sticky for Kael's modding guide. Go read that.
 
Ok got it to work thanks spatzimaus! Btw, is it possible to make a promotion require one promotion and another instead of or?
 
Btw, is it possible to make a promotion require one promotion and another instead of or?

No.

It's unfortunate, but they didn't implement any sort of AND logic for promotions. Even that OR logic was done in an unfortunately crude way, without the flexibility they used in other tables. So it's just not possible without the DLL.
 
Back
Top Bottom