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

Bug in my mod - My Combat XP bar is stuck!

Discussion in 'Civ4 - Creation & Customization' started by ChaosSlayer, Feb 25, 2020.

  1. ChaosSlayer

    ChaosSlayer King

    Joined:
    Feb 3, 2011
    Messages:
    608
    Sudden bug in my own mod
    My Combat XP bar is stuck! - I been in pretty long war, killed like 100+ enemy units (and like 50+ barbarians) since beginning of the game, and my Combat Xp bar is FULL and showing like 431/45 , therefore its overflowing, and I should have gotten like few great generals by now...

    Thing is I haven't touched the mod for so long I don't even remember when I did last changes, and I never touched dll or python things.
    The only thing I remember changing is the unit XP up to which barbarians give XP, and XP limit when unit can upgraded (maybe I think?)

    Any ideas what could cause this???
     
  2. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    735
    Location:
    Germany
    That's strange. Apparently, CvPlayer::setCombatExperience is getting called correctly because, otherwise, the hover text of the GG bar wouldn't show the correct (total) combat XP value. The threshold is also shown correctly. This pretty much narrows it down to the game being unable to find a city to place the GG in (but any city should do, so I don't think it's that) or to find the GG unit in Civ4UnitInfos.xml. The game looks for a unit with either LeaderPromotion=PROMOTION_LEADER or iLeaderExperience > 0 or both. I don't suppose you would've changed both of those values?

    Perhaps you could just do a diff of your XML folder and the XML folder of the mod that your mod is based on (BULL?), e.g. using WinMerge. Unless your older XML changes are too extensive to review them all.
     
    ChaosSlayer likes this.
  3. ChaosSlayer

    ChaosSlayer King

    Joined:
    Feb 3, 2011
    Messages:
    608
    OMG, I think you got it!
    Yes my XML changes over 5 years are way to extensive, but I removed function to assign Warlords to units - AI was kept wasting GG on that and they kept dying in combat. So I did:

    <LeaderPromotion>NONE</LeaderPromotion>
    <iLeaderExperience>0</iLeaderExperience>

    :lol::lol::lol::lol::lol:

    The reason I didn't noticed this right away is because last few games I played were like 6 months ago and it went without any wars what so ever and I never actually finished them.

    Now better question how to prevent warlord assignment to units but to keep my warlords? :crazyeye:
     
  4. ChaosSlayer

    ChaosSlayer King

    Joined:
    Feb 3, 2011
    Messages:
    608
    I figured it out. I put back LeaderPromotion and iLeaderExperience. And instead went into Promotions.xml and REMOVED all available unit types from Leadership promotion ;) Tested it and it works - I now get my great generals, but there are no units in game that he can be attached to, so AI will forced to use it to be build my special buildings ;)

    Again thank you so much f1rpo you saved me god knows how many hours of searching and testing!
     
    f1rpo likes this.

Share This Page