Installing Leaderhead Tutorial (BtS)

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>
 
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.
 
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.

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.
 
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?
 
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.
 
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.
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.
 
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.
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".
 
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.
 
For people who don't get it:
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.
Look for these files in C:/Program Files/Firaxis Games/Sid Meiers.../Beyond the Sword/Assets/XML/Art
and C:/Program Files/Firaxis Games/Sid Meiers.../Beyond the Sword/Assets/XML/Civilizations
and C:/Program Files/Firaxis Games/Sid Meiers.../Beyond the Sword/Assets/XML/Text
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.
To create a new mod, create a folder in My Games/Beyond the Sword/MODS. Name it whatever you want. In this folder make a new folder called "Assets". Then make "Art" and "XML" inside Assets. In "Art" create a new two new folders, "Leaderheads" and "Interface". Under Interface put a new folder called "Buttons". Back in XML create 3 new folders, "Art", "Civilizations", and "Text". Copy the files listed above from the directories listed above to the same directories as in your mod. Then start editing. Open Civ4ArtDefines_Leaderhead.xml with notepad or an editor. Copy one of the Leaderhead entries in "Civ4ArtDefines_Leaderhead.xml" once you've opened it. An entry would be for example from "Leaderheadartinfo" to "</Leaderheadartinfo" like in wolf's quotes above. Leave it open and move your downloaded leaderhead to "My Games/BTS/MODS/<your mod name>/Assets/Art/Leaderheads". Then type in the entries to lead to your leader's dds button, nif, kfm, noshader nif, and background kfm like wolf has listed above but with the name of the LH folder replacing "caligula".
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>
Go to the civ in civilizationinfos.xml that you want your leader to lead. copy one of the existing leaders in that entry and paste it just below, then replace its name with your leaders name.
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:
^This is right.
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.
Also right.
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.
I'm not saying much either. :p Unless you're making a mod this really isn't too important. Try looking in the tutorials section if you want to design a high quality mod.
5) Civ4GameText_Objects_BTS.xml
Add some simple code for using the appropriate LH name... something like this:
You can just put your leaders name in lowercased letters in Leaderheadinfos.xml as what you want it to appear in game under the tag "description".
Ex:
Code:
            <Type>LEADER_CALIGULA</Type>
            [B]<Description>Caligula</Description>[/B]
            <Civilopedia>TXT_KEY_LEADER_CALIGULA_PEDIA</Civilopedia>
            <ArtDefineTag>ART_DEF_LEADER_CALIGULA</ArtDefineTag>

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>
Red=Me
 
:hmm: I see... Actually, this whole thread might be moved to the Civ4 - Tutorials section.;)
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.
 
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.
 
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?
 
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?
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.
 
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.
 
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.

I know. (Seems logical to have tutorials with the section where you need it.) Just hope you can keep it here.;)
 
Top Bottom