Forgetful Units

Discussion in 'Civ4 - Creation & Customization' started by wioneo, Jul 2, 2009.

  1. wioneo

    wioneo King

    Joined:
    Jun 11, 2006
    Messages:
    752
    Is it possible to remove the loss of xp when units are upgraded? This always irritated me, and I don't think that it would change gameplay much.
     
  2. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    Yep it's possible. And easy

    From GlobalDefines.xml
    Code:
    	<Define>
    		<DefineName>MAX_EXPERIENCE_AFTER_UPGRADE</DefineName>
    		[B]<iDefineIntVal>10</iDefineIntVal>[/B]
    	</Define>
    If you don't know how to use custom assets to mod this in, just ask. It'll take me about 1 minute to describe it in detail, and you about the same to impliment, even if you don't have any experience with modding Civ4. This is a very simple thing to do.
     
  3. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Except I think he wants it to give back as much XP as the unit had to begin with, not a fixed number.

    Which presumably would be a lot harder, I think... probably have to save a unit's experience pre-upgrade, then after upgrading, set it's XP to that number... and I have no idea how to do that.
     
  4. Cao Mengde

    Cao Mengde Chieftain

    Joined:
    Jun 15, 2009
    Messages:
    45
    Location:
    Heather's imagination
    Since that's just the maximum amount you can set it to something very high like 1000 and be fine. Already with it set at 10 you can upgrade a unit that's not yet level 3 and it'll still have whatever exp it had before.
     
  5. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Ah. My mistake. I thought that was what units got after conquest...
     
  6. wioneo

    wioneo King

    Joined:
    Jun 11, 2006
    Messages:
    752
    So, all that i would need to do is open that file in notepad and change the number? I don't have any experience modding anything at all, so a walkthrough would be nice, but if that's all tha is necessary suppose I coul manage that.
     
  7. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    No, you never want to edit your original files (otherwise that'd be correct).
    Here are the inststructions:

    1)Browse to your ...Program Files\...\Beyond the Sword\Assets\XML folder. Right click on the GlobalDefines.xml file, select copy
    2)Go back to Program Files\...\Beyond the Sword Double click on the shortcut (looks like a folder) that says Shortcut to Custom Assets (This takes you to the ...My Documents\...\Beyond the Sword\Custom assets path)
    3)In your custom assets folder, you'll see one marked XML, go in there and select paste. This will copy your Global Defines file to your custom assets folder. The point of this is so you don't need to alter your original files, so you can still play multiplayer, and still have the original files for when you mess things up (which you will do if you start modifiying things a bit more). The game will by default load our custom assets when played in single player mode. While modding you always want to do things this way, or create a proper mod, but never alter the original files (there simply is no reason to).
    4)Now open up the file with notepad, search for MAX_EXPERIENCE_AFTER_UPGRADE, it'll take you to that line I showed, and change the number to what you want.

    That's it.
     
  8. mechaerik

    mechaerik Tuturuu!

    Joined:
    Oct 28, 2008
    Messages:
    7,064
    Location:
    Los Angeles
    Change it to -1, which would make it infinite.
     
  9. wioneo

    wioneo King

    Joined:
    Jun 11, 2006
    Messages:
    752
    Ok, thank you. I did what you said, and I'll load up the game to see if it worked in a bit...Will this affect games that have already started?
     
  10. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    Yep.

    ten characters
     
  11. wioneo

    wioneo King

    Joined:
    Jun 11, 2006
    Messages:
    752
    I used 10 million instead of -1, and that worked fine, just hope I don't accidentily pass 10 million xp...

    EDIT: Just noticed I ranted a bit, feel free to skip to the second to last paragraph for the relevant bits.

    Ok I have a newish question, is it possible to win 2 victories at once? In that game the number 2 guy who voluntarily vassalized, so I didn't actually have any competition for the whole game. So I thought I would go for a diplomatic win, since the civ that was second in pop was hated by EVERYONE, and me + vassal would have been enough to win, but my vassal was a candidate...why is this? Doesn't the civ that's second in population get picked? and isn't the rival percentage shown in the victory screen the civ with the next highest population?

    So after that hickup, I decided to just snag one more vassal since the 2 remaining heathens were horrifically backwards since they each had minority religions and were pretty much isolated tradewise(scare rifles+longbows vs. infantry+a few new tanks), one of them (Mao) capitulated one turn into the war :lol: after an amphibious city capture. So I called the vote and just for the heck of it, I rained down ICBMs on the last remaining rival.

    Next turn, behind the "You have won a diplomatic victory" message, I saw "Charlie is willing to capitulate" BUG message, and started wondering what would have happened if I had dow'd one turn earlier, and vassalized him while simultaneously calling for the Secretary General vote. Would I get two victories?(Actually 3 counting domination).

    Hmm...long winded question...
     
  12. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    Just a note, the variable can't store that high of a number, so basically when it gets to it's top number (in the 100K range I believe), it'll flip around to -1, and start counting upward again, only to reach max again and flip back to minimum, it'll do this until it counts a million. So in effect you've set it to some random number (not truely random you could look up the max storage for an integer variable online on your bit system and calculate it, but since you're unlikely to do that, it's de facto random) between -1 and somewhere around 100,000. I'd recommend using -1, but whatever floats your boat.
     
  13. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    Once you win, you win, the victory conditions stop being considered by the game. You can of course always reload before you won :mischief:
     
  14. wioneo

    wioneo King

    Joined:
    Jun 11, 2006
    Messages:
    752
    But you always get the "you won a [bla bla] victory" thing at the beginning of your next turn. So which victory would take precedence if you did both conquest and domination at the same time? I think I'm going to load up an autosave and DoW one turn earlier...
     
  15. Flying Pig

    Flying Pig Utrinque Paratus Retired Moderator

    Joined:
    Jan 24, 2009
    Messages:
    15,651
    Gender:
    Male
    Location:
    Perfidious Albion
    There was a SotD where someone did that.
     
  16. wioneo

    wioneo King

    Joined:
    Jun 11, 2006
    Messages:
    752
    I replayed the save, and had him capitulate on the same turn that I called the vote. Diplomatic victories take presidence over conquest/domintion apparently. At least they do when it's a capitulation conquest, not sure about actually killing everyone.
     

Share This Page