Skins

Aungi

Chieftain
Joined
Sep 28, 2010
Messages
54
Location
Missouri
I didnt see the "tutorial" on how to do this and if there is one and you know where it is please direct me there!

In my experimentation years back I was able to do this with the civ XML editor, but it forced me to "add a new unit" so I had 6 units of "Modern Infantry" and could only deploy the unit from the world builder.
I dont want to create a new unit, I just want to change the skin of one in the game, can I do that? and if so how.
This is in a mod, so its not a vanilla unit.

Thanks in advance for any help!
 
Do you want to change how the already existing unit looks (like have all infantry in the game look different)?

Because from the sound of it (6 units and all) it seems to me that you are trying to make it so that multiple civs have the same unit look different.

I can help in both cases. Just need to know what case to work on :).
 
Well, I would like to know how to make the infantry different for each civ, "Flavor" I think is the right term :S ???
But just being able to change the skin in a few units in the mod im playing now would be great.
Basically I dont like the skin the modder chose for the modern marine and I want to change it with one I d/l. Thanks for the quick response!
 
Since you mentioned you were moding an existing mod, I can skip the newer edit the core civ story and get to the work.:lol:


Alright, to make a new skin the first thing you have to do is make the skin .dds file.
From your posts, I assume you know how to do that.

The next step is to make a copy of the .nif file and all the other skin files (the ones you did not change) and put it in a new folder next to the old one. (you don't need to copy the animations, you can just link to them from the XML)

Step three, copy your new skin into the folder so that the .nif file when opened shows the new skin instead of the old one.

Than make a new art define linking to the new folder and the nif file within it.


Thus far, I think I have probably not said anything new to you since you have already created units. But here is where the interesting part begins.


To change how a unit looks for all civilizations, just enter CIV4UnitInfos.xml, find the unit in question and find the part named <UnitMeshGroups>.

For your marine the text should look something like this (from base civ)
Code:
			<UnitMeshGroups>
				<iGroupSize>3</iGroupSize>
				<fMaxSpeed>1.75</fMaxSpeed>
				<fPadTime>1</fPadTime>
				<iMeleeWaveSize>3</iMeleeWaveSize>
				<iRangedWaveSize>0</iRangedWaveSize>
				<UnitMeshGroup>
					<iRequired>3</iRequired>
					<EarlyArtDefineTag>[COLOR="Red"]ART_DEF_UNIT_MARINE[/COLOR]</EarlyArtDefineTag>
				</UnitMeshGroup>
			</UnitMeshGroups>

See the bit I colored red? Just delete that and write in it's place the name of your new art define you created just moments ago.

And there you have it, all civilizations will now use the new art instead of the old one.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Section 2: Flavor

So you want to add flavor (different skins or even models for different civilizations).
This is a bit harder but not significantly so. You will again have to make a new art define for each skin you want to use. So each different skin means one extra folder, one extra copy of the nif file and one extra skin.

After that is done, you have to connect the art to the units. To do this, open the file named: CIV4CivilizationInfos.xml

Inside it, find the civilization you want to edit.
Once you find the civ, find a tag titled: <UnitArtStyleType>
The contents of this tag define an art style that the units of that civilization will use.

Now, depending on the type of mod you are working with, the text in the tag can be just about anything. In base civ, the values are shared for multiple civilizations. While mods like Varies Delectat might have separate tags for each civ.

Subsection 1.
In case of 1 art style for 1 civ, all you have to do is open the file called CIV4UnitArtStyleTypeInfos.xml, find the art style that correspond to the name given in the CIV4CivilizationInfos.xml file.

After that is done, go to the end of the art style (where the <StyleUnits> tag closes) and insert this code before the closing line:
Code:
					<StyleUnit>
					<UnitType>[COLOR="red"]The name of the unit you want to change the art for. This can be read from the CIV4UnitInfos.xml file.[/COLOR]</UnitType>
					<UnitMeshGroup> [COLOR="red"]This is the mesh group. Your marine only has one, but if you are working with units that have multiple (like the settler) make 1 of these tags for each mesh group.[/COLOR]
						<EarlyArtDefineTag>[COLOR="red"]The new art define you want[/COLOR]</EarlyArtDefineTag>
						<LateArtDefineTag>[COLOR="red"]The new art define you want[/COLOR]</LateArtDefineTag>
						<MiddleArtDefineTag>[COLOR="red"]The new art define you want[/COLOR]</MiddleArtDefineTag>
					</UnitMeshGroup>
				</StyleUnit>

Also, keep in mind that an art style might already contain a change to the unit.
In case this is so it will be clearly visible in that one of the tags will already have the unit name you desire. For example, you might run into something like this:
Code:
				<StyleUnit>
					<UnitType>[COLOR="Red"]UNIT_MARINE[/COLOR]</UnitType>
					<UnitMeshGroup>
						<EarlyArtDefineTag>[COLOR="Blue"]ART_DEF_UNIT_MARINE_1[/COLOR]</EarlyArtDefineTag>
						<LateArtDefineTag>[COLOR="blue"]ART_DEF_UNIT_MARINE_1[/COLOR]</LateArtDefineTag>
						<MiddleArtDefineTag>[COLOR="blue"]ART_DEF_UNIT_MARINE_1[/COLOR]</MiddleArtDefineTag>
					</UnitMeshGroup>
				</StyleUnit>
If you do, than there is no need to make a new copy of it in the end like I said. Instead, just edit the part I colored blue to match the art style you want.


Subsection 2:
Now, if you are working with a mod that does not have specific art styles for each civilization. (you can check this in the CIV4CivilizationInfos.xml file. To do this, simply check if more than one civ uses the same value for the <UnitArtStyleType> tag.

If this is the case, you will need to make a new art style for your civ. That is fairly easy.
Again, open the CIV4UnitArtStyleTypeInfos.xml file and find the art style the civ uses.

Make a copy of the entire art style (bordered for your convenience by the <UnitArtStyleTypeInfo> tags.) Paste this copy near the end of the file just before the <UnitArtStyleTypeInfos> tag closes.

Change the value of the <Type> tag in the copied style.
For example:
Code:
<Type>UNIT_ARTSTYLE_ASIAN</Type>
becomes:
Code:
<Type>UNIT_ARTSTYLE_MY_NEW_STYLE</Type>

After that is done, do the same to the new art style that you would have done in Section 2 - Subsection 1.

Finally open the CIV4CivilizationInfos.xml file, find your chosen civilisation and change the value of the <ArtStyleType> tag to match your new name.
For example:

Code:
		<UnitArtStyleType>UNIT_ARTSTYLE_ASIAN</UnitArtStyleType>
Becomes:
Code:
		<UnitArtStyleType>UNIT_ARTSTYLE_MY_NEW_STYLE</UnitArtStyleType>

Once that is done, it should all work fine in game.
Try it out, and if something fails come back here with more questions.


Also, questions should go to the general moding forum. Not the turtorials section.
 
Glad I could help. If you have any further questions, you know where to find me.
 
Hi, I am really sorry, but I am newbie in modding and it's embarrasing for me to ask this, but few days ago I downloaded a bunch of medieval viking skins, there are some folders and inside them there are mostly *.dds files and some *.nif What i want to change is so called unit flavor of Vikings units in one mode I play. It means that only Viking nation will have those changed skins if I'm right, and all the other nations in Europe will have same old skins. So I had found this tutorial and than I got stuck. So I did found CIV4CivilizationInfos.xml, opened it with notepad, found out that the vikings use european art style, and than I tried to find CIV4UnitArtStyleTypeInfos.xml and I did not manage to, it's simply not there probably:( And even if I managed to, I don't know what to do with all those folders and files, where to move them or copy, and what does the text file referring to units using some Charle Magne unit animations has to do with all this? Again I am sorry, I usually have no trouble reading tutorials and guides :( I would be very happy if someone could help me. Thank you, and pardon me for my English.
 
Welcome to CFC :).

Did you read post #4, and did you understand it?
Because it should answer most of the questions.

And you can easily add a new style: You have to mention it in Assets\XML\GlobalTypes.xml, then you can copy one of the existing ones and rename it to your new style.
 
Thanks buddy :) I am maybe modding newbie, but I have been playing all the civ games, except civ 5, since my childhood and I'm 24 now.

I understand it more or less. I have searched through CIV4CivilizationInfos.xml file mentioned in Section 2: Flavor of post no.4, but according to subsection 1 and 2 I should open CIV4UnitArtStyleTypeInfos.xml and i can't find it. Neither in Civ 4, or BTS folder or in the mod I want to change. :( But I have found GlobalTypes.xml, but this file is not mentioned in post no. 4. So that's why I am confused.
 
I should open CIV4UnitArtStyleTypeInfos.xml and i can't find it. Neither in Civ 4, or BTS folder or in the mod I want to change.

The file should be in BtS\Assets\XML\Civilizations.
To note: Never ever change the original files. Always create a mod.

:( But I have found GlobalTypes.xml, but this file is not mentioned in post no. 4. So that's why I am confused.

Seems PPQ forgot it. It's needed as last step for section 2.
 
So here's basicaly what I did. First I had copied my downloaded viking skins( bunch of folders like Viking Age Spearman etc, each containing *.nif and *.dds files, but compared to the other basic skins, there are like three times less files in each viking skin folder) into C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Assets\Art\Units\. Than i opened CIV4UnitArtStyleTypeInfos.xml in notepad, copied european art style type and paste under the other art styles and renamed it to UNIT_ARTSTYLE_MY_NEW_STYLE. Actually i wanted to do this in the mod I always play, but it does not contain CIV4UnitArtStyleTypeInfos.xml and I finally found it exactly where you told me to search it for The_J. BtS\Assets\XML\Civilizations. I decided to beging first with spearman, because the renamed european art style contained only few units and spearman was amongst them so it was easily for me to edit it like this:
<StyleUnit>
<UnitType>UNIT_SPEARMAN</UnitType>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_UNIT_VIKING_AGE_SPEARMAN</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_VIKING_AGE_SPEARMAN</LateArtDefineTag>
<MiddleArtDefineTag>ART_DEF_UNIT_VIKING_AGE_SPEARMAN</MiddleArtDefineTag>
</UnitMeshGroup>
</StyleUnit>

Than I changed artstyle name in CIV4CivilizationInfos.xml file. This file I found in mod folder. And finally I add my new style to other art styles in GlobalTypes.xml so it looks like this:
<ArtStyleTypes>
<ArtStyleType>ARTSTYLE_EUROPEAN</ArtStyleType>
<ArtStyleType>ARTSTYLE_ASIAN</ArtStyleType>
<ArtStyleType>ARTSTYLE_SOUTH_AMERICA</ArtStyleType>
<ArtStyleType>ARTSTYLE_MIDDLE_EAST</ArtStyleType>
<ArtStyleType>ARTSTYLE_GRECO_ROMAN</ArtStyleType>
<ArtStyleType>ARTSTYLE_BARBARIAN</ArtStyleType>
<ArtStyleType>ARTSTYLE_MY_NEW_STYLE</ArtStyleType>
</ArtStyleTypes>

The Results: During game starting I recieved troubleshooting message that something is wrong in CIV4UnitArtStyleTypeInfos.xml It was in my native language, and it was something about ending component not matching the starting component, after that I recieved more error messages about each of the artstyle (asian, grec roman, ...) even if I did not edit them. After loading mod, the same error messages. After many turns of playing scenario of the mod I trained spearman and the skin was Greco Roman :D :D I obviously screwed something druing the process :(
 
Thank you for helping me The_J, i know it could be annoying helping someone who does know nothing. I appreciate it.

P.S. Those previous steps I mentioned above were correct? Because there are some animation instructions in text file of the downloaded skins and I did not do anything about it.
 

Attachments

  • CIV4UnitArtStyleTypeInfos.rar
    1.2 KB · Views: 281
Thank you for helping me The_J, i know it could be annoying helping someone who does know nothing. I appreciate it.

I agree, but it's not the case here ;).
You've read the post, you did what it suggested, and now you know at least a bit about XML editing, so i'm fine with it.

P.S. Those previous steps I mentioned above were correct? Because there are some animation instructions in text file of the downloaded skins and I did not do anything about it.

Example please.

@problem:
At the top of your file you can see this:
PHP:
<Civ4UnitArtStyleTypeInfos xmlns="x-schema:CIV4CivilizationsSchema.xml">
	<UnitArtStyleTypeInfos>
		<UnitArtStyleTypeInfo>

But at the bottom, there's only this:
PHP:
		</UnitArtStyleTypeInfo>
	</Civ4UnitArtStyleTypeInfos>

The
PHP:
</UnitArtStyleTypeInfos>

is missing in there.


Another thing:
Sorry, i confused you with Assets\XML\GlobalTypes.xml. I looked in there right now, it's NOT needed for ethnic units, it's only for ethnic buildings, sorry :(.
 
I have entered the missing line you have noticed. While starting the game no alert messages appeard, so it helped! :) But after loading the mod and after I started to play things went a bit wrong. Empty technology advisor chart poped up before the first turn, so I exited. Than I realized that there are no game icons and frames. I mean no map, no gold income, no science income, no unit action icons, even when I entered the city, there was nothing except surrounding city plots, with production and food, so I decided to continue playing to reach the first spearman in order to check the skin. I remebered some shortcuts for actions and finaly I gained access to copper and when the chart of production appeared the game crushed. In exactly the same moment. I just don't get it. I don't know what the hell does it mean. Maybe I am not choosen to have other skins :D I even tried to copy those skin folders from C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Assets\Art\Units to Assets\Art\Units of mod, where I created the new folder: Units. It's just dead end.
 
Do you have the BUG mod installed as default maybe? Or is that problem completely new introduced in your mod?

You might want to enable python exceptions in Documents\My Games\BtS\Civ4.ini (just search for python and change the value where exceptions are mentioned). You then should get an error message upon start, please post that message.
 
I play Alexmod, with the huge earth map, It never happened to me before.

After I went to Windows and switched back to civ, the icons and frames suddenly appeared and were functional except those inside the city. So again I finally tried to train spearman, but his icon was not in the city production options. And after I closed the city window and the the "what to build next" chart turned up, the game crashed again. It seems like the spearman unit I edited is somehow disconnected from the game and when I'm about to train it, game crashes.

I did switch the HidePythonExceptions value and no error messages showed upon start.
 
Later I tried edit a new art define, so I opened CIV4ArtDefines_Unit.xml and created this:

<UnitArtInfo>
<Type>ART_DEF_VIKING_AGE_SPEARMAN</Type>
<Button>,Art/Interface/Buttons/Units/Spearman.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,4,6</Button>
<fScale>0.44</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/Units/Viking_Age_Spearman/VikingAgeSpearmanfinal.nif</NIF>
<KFM>Art/Units/Spearman_European/Spearman.kfm</KFM>
<SHADERNIF>Art/Units/Spearman_European/Spearman_European_FX.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
<fShadowScale>1.0</fShadowScale>
</ShadowDef>
<fBattleDistance>0.4</fBattleDistance>
<fRangedDeathTime>0.31</fRangedDeathTime>
<bActAsRanged>0</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIQUE_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
</UnitArtInfo>

I coloured blue parts I edited. Than i tried to connect this with unit art style, so I opend CIV4UnitArtStyleTypeInfos.xml and edited it this way:


<UnitArtStyleTypeInfo>
<Type>UNIT_ARTSTYLE_MY_NEW_STYLE</Type>
<StyleUnits>
<StyleUnit>
<UnitType>UNIT_KNIGHT</UnitType>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_UNIT_KNIGHT_EUROPEAN</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_KNIGHT_EUROPEAN</LateArtDefineTag>
<MiddleArtDefineTag>ART_DEF_UNIT_KNIGHT_EUROPEAN</MiddleArtDefineTag>
</UnitMeshGroup>
</StyleUnit>
<StyleUnit>
<UnitType>UNIT_SCOUT</UnitType>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_UNIT_SCOUT_EUROPEAN</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_SCOUT_EUROPEAN</LateArtDefineTag>
<MiddleArtDefineTag>ART_DEF_UNIT_SCOUT_EUROPEAN</MiddleArtDefineTag>
</UnitMeshGroup>
</StyleUnit>
<StyleUnit>
<UnitType>UNIT_SETTLER</UnitType>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_UNIT_SETTLER_EUROPEAN</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_SETTLER_EUROPEAN</LateArtDefineTag>
<MiddleArtDefineTag>ART_DEF_UNIT_SETTLER_EUROPEAN</MiddleArtDefineTag>
</UnitMeshGroup>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_UNIT_SETTLER_FEMALE_EUROPEAN</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_SETTLER_FEMALE_EUROPEAN</LateArtDefineTag>
<MiddleArtDefineTag>ART_DEF_UNIT_SETTLER_FEMALE_EUROPEAN</MiddleArtDefineTag>
</UnitMeshGroup>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_UNIT_SETTLER_CHILD_EUROPEAN</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_SETTLER_CHILD_EUROPEAN</LateArtDefineTag>
<MiddleArtDefineTag>ART_DEF_UNIT_SETTLER_CHILD_EUROPEAN</MiddleArtDefineTag>
</UnitMeshGroup>
</StyleUnit>
<StyleUnit>
<UnitType>UNIT_SPEARMAN</UnitType>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_VIKING_AGE_SPEARMAN</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_VIKING_AGE_SPEARMAN</LateArtDefineTag>
<MiddleArtDefineTag>ART_DEF_VIKING_AGE_SPEARMAN</MiddleArtDefineTag>
</UnitMeshGroup>
</StyleUnit>
<StyleUnit>
<UnitType>UNIT_WORKER</UnitType>
<UnitMeshGroup>
<EarlyArtDefineTag>ART_DEF_UNIT_WORKER_EUROPEAN</EarlyArtDefineTag>
<LateArtDefineTag>ART_DEF_UNIT_WORKERMODERN</LateArtDefineTag>
<MiddleArtDefineTag>ART_DEF_UNIT_WORKER_EUROPEAN</MiddleArtDefineTag>
</UnitMeshGroup>
</StyleUnit>
</StyleUnits>
</UnitArtStyleTypeInfo>
Agin, blue line is the one i changed.

Results: Troubleshooting i mentioned previously is gone, the game is fully playable, the spearman icon was there inside the city, game did not crashed after i started spearman production, but after spearman was trained, he has the same old european_spearman style. So even if i connected the newly created art define with *.nif file, it seems as the *.dds files are not involved. I just don't know :D
 
Sorry for not replying earlier, i didn't have any internet connection over the weekend.

@problem:
Please change the
PHP:
<SHADERNIF>

entry to the same like the nif entry.

I did switch the HidePythonExceptions value and no error messages showed upon start.

o_O that's crazy.
Lost interface normally means that during the loading parts of the python scripts, which are responsible for the interface, crash, so that the interface doesn't get build at all.
Haven't heard of other reasons for this yet :dunno:.
 
The_J, I'd like to truly thank you for being only one who was helping me here. It worked! The SHADERNIF was the last problem to solve. The unit art define was most important thing I overlooked at the beginning, because it is mentioned only in one sentence in the tutorial and as a beginner I simply could not perceive it.

Again thank you very much for your time :) Merry Christmas buddy if you celebrate it :)
 
Top Bottom