1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Adding promotions to certain units

Discussion in 'Civ4 - Modding Tutorials & Reference' started by cripp7, Jun 15, 2020.

  1. cripp7

    cripp7 Playin' Bored

    Joined:
    Aug 16, 2007
    Messages:
    3,095
    Location:
    Fantasyland
    I'm wanting to add the "Sentry" promotion to all archer (archers, longbow, crossbow), Explorer (scouts and explorers) and have it available after "Combat I" promotion. For some reason I cannot figure that out. What do I need to edit to make that happen?

    Cripp
     
  2. Spillsandstains

    Spillsandstains Warlord

    Joined:
    Mar 31, 2008
    Messages:
    226
    uhhh need to change the xml in your custom version of ... CIV4PromotionInfos.xml, scroll down and find the start of the 'promotion_sentry' entry
     

    Attached Files:

    cripp7 and LumpyLen like this.
  3. LumpyLen

    LumpyLen Chieftain

    Joined:
    Jun 26, 2020
    Messages:
    4
    Gender:
    Male
    Hey, since you seem to know what you're doing, mind takin a look? ;p
    I made my own promotion, everything's schmancy with that, but trying to put my icon into the .PAK file is perplexing me. Every time I compile a .pak with PakBuild, it creates it with no folder structure (Art\Interface\ etc.). Any ideas :0?

    Moderator Action: Edited your post to remove inappropriate language. Please help us keep our forums family friendly. Thanks. leif
     
    Last edited by a moderator: Jun 26, 2020
  4. cripp7

    cripp7 Playin' Bored

    Joined:
    Aug 16, 2007
    Messages:
    3,095
    Location:
    Fantasyland
    I knows there's a tutorial on that somewhere on here I've seen before. I'll do some research on here and find that out
     
  5. Spillsandstains

    Spillsandstains Warlord

    Joined:
    Mar 31, 2008
    Messages:
    226
    oops sorry LumpyLen, never built an fpk before … xml really is fairly to use once you get over the learning curve

    would be interested in finding out why you use fpk, please pm me
     
  6. cripp7

    cripp7 Playin' Bored

    Joined:
    Aug 16, 2007
    Messages:
    3,095
    Location:
    Fantasyland
    after looking at that that does change for every unit however I'm just wanting to change it for archer class only. Or at least have the promotion for city garrison 1
     
    Last edited: Jun 28, 2020
  7. Spillsandstains

    Spillsandstains Warlord

    Joined:
    Mar 31, 2008
    Messages:
    226
    ok suggest you clone the promotion and append it to promos.xml
    - this will produce same effects, uses different button art
    -available if you have either cbt-1 or c-grn-1 and unitcombat_archer
     

    Attached Files:

  8. cripp7

    cripp7 Playin' Bored

    Joined:
    Aug 16, 2007
    Messages:
    3,095
    Location:
    Fantasyland
    It's been a while since I messed with adding things like that, where exactly do I place it

    "
    </PromotionInfo>
    </PromotionInfos>
    </Civ4PromotionInfos>"

    that's at the very bottom, do I insert it after the first one or the 2nd
     
  9. Spillsandstains

    Spillsandstains Warlord

    Joined:
    Mar 31, 2008
    Messages:
    226
    hello cripp7 sorry boss ... should have switched my brane on for a moment

    ok adding to these xml files involves nesting the entries inside a grander structure
     

    Attached Files:

  10. cripp7

    cripp7 Playin' Bored

    Joined:
    Aug 16, 2007
    Messages:
    3,095
    Location:
    Fantasyland
    So I basically insert it after the last "</PromotionInfo>"
     
  11. Spillsandstains

    Spillsandstains Warlord

    Joined:
    Mar 31, 2008
    Messages:
    226
    Yeah, all entries should start with <PromotionInfo> and end with </PromotionInfo>
    if you're going alter a lot of xml it might be wise to get an xml checker
    there IS another way of doing it, involving changes to unitinfos.xml and the existing PROMOTION_SENTRY, but it's more annoying imho
     
  12. cripp7

    cripp7 Playin' Bored

    Joined:
    Aug 16, 2007
    Messages:
    3,095
    Location:
    Fantasyland
    I tried adding that end at the bottom, but BTS crashed when trying to load. I'm including the XML from the mod I'm using RevolutionDCM
     

    Attached Files:

  13. Spillsandstains

    Spillsandstains Warlord

    Joined:
    Mar 31, 2008
    Messages:
    226
    off sorry i assumed you were using vanilla bts ... (looks at file) ah it does look pretty much like vanilla bts ... I always thought this

    <Button>,Art/Interface/Buttons/Promotions/Logistics1.dds</Button>

    threw an error, you live and learn ... I wouldn't start with the initial comma, so maybe this isn't a vanilla version? I assumed

    <Button>Art/Interface/Buttons/Promotions/Combat1.dds</Button>

    or

    <Button>,Art/Interface/Buttons/Promotions/Combat1.dds,Art/Interface/Buttons/Promotions_Atlas.dds,8,2</Button>
    were they only valid syntaxes for button display. I assume you've been using it without errors, and spy promotions are displaying fine?

    ok insert new bit of xml 'new promo cripp7.txt' between PROMOTION_SENTRY and PROMOTION_MOBILITY entries. The preceding entry and succeeding entries are included.

    - make sure it starts and ends with the right tags, and you haven't overwritten the preceding and succeeding entries

    (preceding entry end)
    </PromotionInfo>
    <PromotionInfo>
    (inserted entry start and end)
    </PromotionInfo>
    (succeeding entry start)
    <PromotionInfo>

    I really recommend getting an xml checker, a good one is: Caveman2Cosmos XML Validator 1.3 by Alberts2

    ... and I'm capable of making errors as anyone, not sure why it crashed on loading. I assumed you tried again with the original civ4promotions.xml file and it loaded ok?
     

    Attached Files:

  14. cripp7

    cripp7 Playin' Bored

    Joined:
    Aug 16, 2007
    Messages:
    3,095
    Location:
    Fantasyland
    Oh I did forget to mention that I'm using a moded version of RevolutionDCM, yes by spies promotions are showing up correctly. I'm using Winmerge to do my editing and I'll try the Caveman2Cosmos XML checker just to make sure. I'll make those changes and let you kno

    I'm still not quite sure of your directions, I was able to get the Explorer unit to automatically assign the Sentry to it but not any of the others.
     
    Last edited: Jul 7, 2020
  15. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    4,142
    Gender:
    Male
    Location:
    In a constant brainstorm...
    @cripp7
    Winmerge is a very useful program to compare two similar files or even folders but I think it's not the best choice for XML editing.
    Let me suggest you trying FOXE:
    http://www.firstobject.com/dn_editor.htm

    A very simple but powerful program. I learned a lot about the way of XML working just by using it.
     

Share This Page