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

How to change a unit's upgrade unit?

Discussion in 'Civ5 - Creation & Customization' started by 501st Legion, Oct 22, 2010.

  1. 501st Legion

    501st Legion Warlord

    Joined:
    Oct 29, 2009
    Messages:
    107
    I want French Musketeers to upgrade to Foreign Legion, how to do this? Oh just in case anyone's curious as to what process I did, its this:

    My problem is that in-game, the Musketeers upgrade to just plain old infantry and not the Foreign Legion. Any help would be most appreciated.
     
  2. dmieluk

    dmieluk Chieftain

    Joined:
    Feb 15, 2007
    Messages:
    28
    I think it could be done, but you'd have to make a whole new unit class.

    So, first thing would be to copy all the infantry class info and duplicate it into all into a new class, which you might call "UNITCLASS_PROMOTED_MUSKETEER", and make a new unit in that class, which is exactly the same as the Foreign Legion, except you might call it "UNIT_PROMOTED_MUSKETEER". Make sure you get all the extra stuff like flavors otherwise the AI wont know how to use the foreign legions which it got by upgrading (or more likely i guess you'd get a crash)...

    Then, once you had a new class, you could use the code you already provided, but instead use:
    <Where UnitType="UNIT_FRENCH_MUSKETEER"/>
    <Set UnitClassType="UNITCLASS_PROMOTED_MUSKETEER"/>

    In practice, if you use this method, the units "foreign legion" and "promoted musketeer" are actually two different unit types from the code perspective, but the end user should not be able to tell the difference. I haven't done this before but my guess is it would work. Can anyone more experienced back this up?
     
  3. goddambigcar

    goddambigcar Chieftain

    Joined:
    Sep 28, 2010
    Messages:
    36
    That's odd. So units don't upgrade to unique units? I guess I've never tested it, so I wouldn't know, but it doesn't sound right.

    But if it is a bug, then you'd have to do some sort of workaround, like dmieluk says. Although I'm not sure I'd do it that same way, but whatever works.
     
  4. 501st Legion

    501st Legion Warlord

    Joined:
    Oct 29, 2009
    Messages:
    107
    Okay guys, after some scenario tests, I was finally able to do it. It was just a couple of other lines of code I didn't post that was interfering with my mod. The code in my original post actually works. Thanks anyway.

    However, for some reason, the Civilopedia doesn't display the Foreign Legion as the Musketeer's upgrade unit, yet when I click on a musketeer there's the upgrade to Foreign Legion button. Must be a Civilopedia glitch.
     
  5. varus

    varus Prince

    Joined:
    Nov 3, 2005
    Messages:
    130
    Well that won't change by itself just because you changed the way the unit upgrades. You would have to go and update the civelopedia on your own.
     

Share This Page