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

Installing Leaderhead Tutorial (BtS)

Discussion in 'Civ4 - Modding Tutorials & Reference' started by Wolfshanze, Jun 14, 2008.

  1. Wolfshanze

    Wolfshanze CFC Historian

    Joined:
    Nov 12, 2001
    Messages:
    5,689
    Location:
    Florida
    Thought this might help folks out:

    Assuming you have BTS, these are the minimum files you need to change (some say the "schema" files, but these files will do just fine... I've never once changed a schema file).

    The below files can be found in either default or BtS XML folders... copy them into custom assets or a mod folder before making changes.

    Minimum XML files to add a leaderhead:
    --------------------------------------
    1) Civ4ArtDefines_Leaderhead.xml
    2) Civ4CivilizationInfos.xml
    3) Civ4LeaderHeadInfos.xml
    4) Civ4GameText_Civilopedia_BTS.xml
    5) Civ4GameText_Objects_BTS.xml


    1) Civ4ArtDefines_Leaderhead.xml
    Should look something like this:
    Code:
    		<LeaderheadArtInfo>
    			<Type>ART_DEF_LEADER_CALIGULA</Type>
    			<Button>Art/Interface/Buttons/LeaderHeads/Caligula.dds</Button>
    			<NIF>art/LeaderHeads/Caligula/Pacal.nif</NIF>
    			<KFM>art/LeaderHeads/Caligula/Pacal.kfm</KFM>
    			<NoShaderNIF>art/LeaderHeads/Caligula/Pacal.nif</NoShaderNIF>
    			<BackgroundKFM>art/LeaderHeads/Caligula/Pacal_bg.kfm</BackgroundKFM>
    		</LeaderheadArtInfo>
    One of the most important things to modify... make sure the NIF and ART lines match the paths and file names for the custom files you've downloaded.

    2) Civ4CivilizationInfos.xml
    Pretty small entry... look for other leaders, then add something like this:
    Code:
    				<Leader>
    					<LeaderName>LEADER_CALIGULA</LeaderName>
    					<bLeaderAvailability>1</bLeaderAvailability>
    				</Leader>
    3) Civ4LeaderHeadInfos.xml
    This is by far the largest/trickiest to work with. I won't post the whole code, but simply-put, find a leader with similar traits... if you think Caligula would be most like Ghengis Khan, copy Ghengis Khan's entry... or if you thought he'd be most like Pacal... copy Pacal's entry... so-on and so-on. It's a very large entry, so copy the WHOLE thing. You need to change at a minimum the first few lines... I'll post that snippet here:

    Code:
    			<Type>LEADER_CALIGULA</Type>
    			<Description>TXT_KEY_LEADER_CALIGULA</Description>
    			<Civilopedia>TXT_KEY_LEADER_CALIGULA_PEDIA</Civilopedia>
    			<ArtDefineTag>ART_DEF_LEADER_CALIGULA</ArtDefineTag>
    Note the lines you use in the above code must match the lines you are putting in the other files you're altering. Below the first major block of code lines you'll find the "Trait" and "Favorite Civic" lines... those are pretty easy to change if/when you want to.

    You'll also probably want to change the "<DiplomacyMusicPeace>" code section, as this matches civ/leader music... if you copied Ghengis Khan's leader entry for Caligula for-instance, you'll get rather oriental music in the game for your Roman Caligula if you don't change this section... simply cut/paste from the right civ/leader for this area (say Caesar) if you want the music to make sense... though this is not mandatory to make a leader work, it's recomended.

    Remember... the above code determines the leaders personality in-game, so it's important to copy/base your new LH code from a leader with similar traits... if you're adding a new LH to the game that is very belligerant and war-like, you would NOT copy Ghandi's LH code!

    4) Civ4GameText_Civilopedia_BTS.xml
    I'm not going to say much about this... simply-put, it's what you change/add to create the Pedia entry for your LH... if you're incredibly lazy, you can re-use an existing leader, but I recomend doing something here... at least copy a Wikipedia bio or something! Copy an existing LH pedia entry if you need help with formatting here.

    5) Civ4GameText_Objects_BTS.xml
    Add some simple code for using the appropriate LH name... something like this:

    Code:
    	<TEXT>
    		<Tag>TXT_KEY_LEADER_CALIGULA</Tag>
    		<English>Caligula</English>
    		<French>
    			<Text>Caligula</Text>
    			<Gender>Male</Gender>
    			<Plural>0</Plural>
    		</French>
    		<German>
    			<Text>Caligula</Text>
    			<Gender>Male</Gender>
    			<Plural>0</Plural>
    		</German>
    		<Italian>
    			<Text>Caligula</Text>
    			<Gender>Male</Gender>
    			<Plural>0</Plural>
    		</Italian>
    		<Spanish>
    			<Text>Caligula</Text>
    			<Gender>Male</Gender>
    			<Plural>0</Plural>
    		</Spanish>
    	</TEXT>
     
  2. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,045
    Location:
    San Diego, California
    Nice job Wolf. The only thing I would add is how to make it modular. A moderator needs to sticky this so we dont get all those "how do I..." threads.
     
  3. Wolfshanze

    Wolfshanze CFC Historian

    Joined:
    Nov 12, 2001
    Messages:
    5,689
    Location:
    Florida
    If someone wants to chime-in on modular stuff... have at it... the above will work for custom assets, new mods and/or merging into existing mods.

    Wolf fears change... Wolf doesn't do modular.
     
  4. mamba

    mamba Chieftain

    Joined:
    Aug 23, 2007
    Messages:
    2,520
    That is quite simple, instead of adding the definitions to the existing files, you create new files. So e.g. you would have a

    Caligula_CIV4LeaderHeadInfos.xml
    Caligula_CIV4ArtDefines_Leaderhead.xml
    Caligula_CIV4GameText.xml (with all game texts for Caligula which Wolf spread across two text files)

    All these files would then contain only the Caligula definition, none of the regular ones. So instead of copying them from the original xml and pasting them to a new entry in the original files, you copy them to a new file which then only contains that particular entry.

    You would need to keep the beginning and end of each file as well (the enclosing tags of the definition), so e.g. the art would look as follows :

    Spoiler :
    Code:
    <?xml version="1.0"?>
    <!-- edited with XMLSPY v2004 rel. 2 U (http://www.xmlspy.com) by Firaxis Games (Firaxis Games) -->
    <!-- Sid Meier's Civilization 4 -->
    <!-- Copyright Firaxis Games 2005 -->
    <!-- -->
    <Civ4ArtDefines xmlns="x-schema:CIV4ArtDefinesSchema.xml">
    	<LeaderheadArtInfos>
    		<LeaderheadArtInfo>
    			<Type>ART_DEF_LEADER_CALIGULA</Type>
    			<Button>Art/Interface/Buttons/LeaderHeads/Caligula.dds</Button>
    			<NIF>art/LeaderHeads/Caligula/Pacal.nif</NIF>
    			<KFM>art/LeaderHeads/Caligula/Pacal.kfm</KFM>
    			<NoShaderNIF>art/LeaderHeads/Caligula/Pacal.nif</NoShaderNIF>
    			<BackgroundKFM>art/LeaderHeads/Caligula/Pacal_bg.kfm</BackgroundKFM>
    		</LeaderheadArtInfo>
    	</LeaderheadArtInfos>
    </Civ4ArtDefines>


    The only thing which will not be truly modular is adding the leaderhead to the civ. You can copy the Rome definition of CIV4CivilizationInfos.xml and call it e.g. Rome_CIV4CivilizationInfos.xml and add the leaderhead there the way Wolf described, but it will not be entirely modular.

    If you wanted to add a second leaderhead (e.g. Nero), you could not do the same for Nero, the two would need to share the Rome_CIV4CivilizationInfos.xml which then needs to include both leaderheads. For anything else, you could create Nero_... files, just like you did for Caligula.

    You should use modular loading, it is superior to regular loading, even though the Wolf fears change ;) If e.g. there is a new patch which changes some xml, you would only need the changes which affect your modular definitions (i.e. which truly affected the Rome civ in this example). With Non-Modular loading, you would need to take care of all changes, so if they changed a regular leaderhead or a civ other than Rome, you would need to include those changes in your version of the definition (which is included in your copy of the original file).
    With modular loading, these changes would not affect you, as you inherit the regular (updated) definitions for anything you do not explicitly add to your mod (in this case anything but Rome).

    If you use the modular way, you create a dir in which you store the Caligula files, make sure to copy the appropriate schemas used by your files to that dir as well. Each xml file (except for the text ones) contains a line like "<Civ4CivilizationInfos xmlns="x-schema:CIV4CivilizationsSchema.xml">" whatever schema file is mentioned there is needed to load the file.
     
  5. The Capo

    The Capo godless Heathen

    Joined:
    Jan 29, 2001
    Messages:
    9,302
    Location:
    Washington, DC
    I hope somebody sees this, but I have DLed a bunch of mods and for some reason they seem to be using leaderheads that are inferior to others out there and I want to change them. I know its not a big deal, but I just want my game to look smooth. Anyway whenever I try to follow these instructions here to change them I can't find the files at all, and I can't understand where I am supposed to put the files after I download a leaderhead.

    Even simple things are difficult to do, like I downloaded the Thomas' War mod, and I can't get the Mussolini (which is Ekmek's latest version) to work with it. Same for Lajos Kossuth. I have been using test folders and everything, but I can't find the folder that has the leaderheads.

    What am I doing wrong?
     
  6. Wolfshanze

    Wolfshanze CFC Historian

    Joined:
    Nov 12, 2001
    Messages:
    5,689
    Location:
    Florida
    Some Leaderheads come in modular format, which means it's designed to be run "on the side" and not part of a mainstream mod... it will probably ship with totally different files then the ones I mentioned here.

    Other Leaderheads may not come with any XML code at all... it's just the graphic files... which means you need to do the XML work yourself...

    It really boils-down to how you're going to install your LHs in the first place... are you doing modular, or putting them all in a single mod? The above instructions I wrote are for installing in MOD format, not modular, and you may well need to do your own XML code, though it's certainly not hard to do, since you apply the same format to all entries.
     
  7. dutchking

    dutchking Chieftain

    Joined:
    Apr 30, 2007
    Messages:
    3,317
    That's not true wolf, leaderheads that come in modular format can be used as a stand alone mod or you can plug them into your own mod simply by moving the LH folder with the XML in it from its "module" folder to yours. (with modular loading enabled) I have a few modular LH's out there myself and I must say they make life much easier for modders.
     
  8. Wolfshanze

    Wolfshanze CFC Historian

    Joined:
    Nov 12, 2001
    Messages:
    5,689
    Location:
    Florida
    You totally misunderstood me... if you read what I said, I did mention modular format LHs run on the side... it can be done different from putting them in a mod itself... there's multiple ways of doing it, and the way I mention is a valid one.

    There's two completely different ways of installing a LH, and I only speak of doing it in straight-up mod format here. What I said is true, however, you need to read more carefully before making such comments. I've integrated several modular LHs as well as non-modular LHs directly into my mod using the above format. If you'd like to take the time to write a work-up on modular format, go right ahead... I took the time to help others with mod-format instead of just saying "that's not true".
     
  9. dutchking

    dutchking Chieftain

    Joined:
    Apr 30, 2007
    Messages:
    3,317
    Jeeze wolf calm down. You said that they "only run on the side" and I thought you meant they only run as stand alones, I'm sorry (for whatever reason) I "misunderstood" you. Whatever the hell "such comments" I made.

    Take a chill pill.
     
  10. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,058
    Location:
    In orbit
    I say: :goodjob:, Wolfshanze!
     
  11. Dellsucks

    Dellsucks Chieftain

    Joined:
    Feb 15, 2008
    Messages:
    1
    I've very confused. Do I have to copy all the files or just part of them?
     
  12. dutchking

    dutchking Chieftain

    Joined:
    Apr 30, 2007
    Messages:
    3,317
    For people who don't get it:
    Red=Me
     
  13. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,058
    Location:
    In orbit
    :hmm: I see... Actually, this whole thread might be moved to the Civ4 - Tutorials section.;)
     
  14. Wolfshanze

    Wolfshanze CFC Historian

    Joined:
    Nov 12, 2001
    Messages:
    5,689
    Location:
    Florida
    A lot of this stuff is already in the Tutorials section... the problem is a lot of people go HERE, but never go to the Tutorials section... since the LHs are here, I think it's a good idea to keep a tutorial page the same place the LHs are.
     
  15. The Capo

    The Capo godless Heathen

    Joined:
    Jan 29, 2001
    Messages:
    9,302
    Location:
    Washington, DC
    I really appreciate the help and the time you guys put into helping people, some of us are not really great with computers (well me at least) but really love civilization (I've been playing since the original). I just recently started using mods and some of the leaderheads bothered me, this really helps me out and I thank all of you for even putting forth an ounce of help.

    Thanks guys.
     
  16. The Capo

    The Capo godless Heathen

    Joined:
    Jan 29, 2001
    Messages:
    9,302
    Location:
    Washington, DC
    Now say I am simply replacing what the leader looks like? For instance if I didn't like the graphics used for a leader, or there is a newer updated version of that same leader I only change the Civ4ArtDefines_Leaderhead.xml, is this correct?

    Again, I could test it myself but I am worried about screwing up my computer, I am a total computer idiot, but from what I can tell if I just replace those files with the ones that go with the NEW leaderhead it will change it. Is this line of thinking correct or am I totally wrong here?
     
  17. Wolfshanze

    Wolfshanze CFC Historian

    Joined:
    Nov 12, 2001
    Messages:
    5,689
    Location:
    Florida
    Yeah... that would be the only file you change if you're just updating a new graphic for an existing LH... I do it all the time (I have replaced the LH graphics for Sury and Darius)... you can't mess anything up if you use a copied file in a mod or custom assets... never change your base files.
     
  18. The Capo

    The Capo godless Heathen

    Joined:
    Jan 29, 2001
    Messages:
    9,302
    Location:
    Washington, DC
    Alright, I'm going to copy the mod folder and then try and do this. I'll let you know if I screw up, thanks so much for all of your help, I've been trying to get some advice on this topic and this is the first time I've got any feedback.

    Thank you.
     
  19. OzzyKP

    OzzyKP Chieftain

    Joined:
    Dec 16, 2000
    Messages:
    1,600
    Location:
    Washington, DC USA
    Hey Capo! Welcome to the wide world of modding. :goodjob:
     
  20. Agent327

    Agent327 Observer

    Joined:
    Oct 28, 2006
    Messages:
    16,058
    Location:
    In orbit
    I know. (Seems logical to have tutorials with the section where you need it.) Just hope you can keep it here.;)
     

Share This Page