What file points to unit skin?

Fabius

Chieftain
Joined
Oct 27, 2005
Messages
83
I am trying to reskin the new unit I made for my new civilization mod. I found the infantry skin, and spruced it up and saved it. Now the problem is, what XML file actually points to that skin? Basically I want to use the infantry model, the infantry movements, everything, only I want to change the skin to my new skin. So I don't want to put my new skin in place of the infantry, I want it on my new unit.

Anyone know?
 
[offtopic] This is off topic, but what program did you use to make your skins?
 
I just edited the DDS file that was out there for Infantry. I did not get into any of the modeling, just changed the DDS file that (I assume) gets stretched over top of the model.

I use DXTBmp to open up DDS files. That imports into Paintshop Pro where I edit it, then it exports right back into DXTBmp for saving.

Were you thinking I was changing the model itself?
 
I was asking what program you used to make the skin and you said DXTBmp and Paintshop Pro, so you answered my question, thank you. Try checking in one of the stickies for more info on XML, I don't know.

Good luck with your mod! Care to tell us about it?
 
Assets\XML\Art\CIV4ArtDefines_Unit.xml

I don't know for sure, but it does "look" like it is here.
 
I'll have to check those out when I get home. I thought I already looked in every likely XML file and nothing seemed to point to Infantry-128.dds (or whatever the skin is called). I have the new skin, have it in the new directory, but without changing whatever points to it, it won't show up.

Anyway, my mod is sort of an in joke with me and a couple friends. Back in college playing the original Civ we used to change the name of our leader, our civ, and our cities to reflect local towns or sometimes all of Pennsylvania. So I made a "civilization" called the Pennsylvanians. It's a joke as a basis, but serious in approach. No unbalanced units, no extra free techs or any of that. It's a mod I meant for me and my friends to have some fun with.

I doubt a whole lot of you guys would fancy your capitol as Harrisburg and your leader being Thomas Mifflin, first governor of the commonwealth, but when it's done I'll post it here in case anyone else is from PA and wants to give it a try.

All that's left for me is to fix up my colors and to hopefully reskin my unique unit (Pennsylvania National Guard). I'm also debating adding Benjamin Franklin as a second leader, but we'll see.
 
Just checked. Both CIV4ArtDefinesUnit.xml points to the .nif and the .kfm files, but not the .dds one. And CIV4UnitInfos.xml points to two .dds files, but they're for the buttons, not for the in game unit.

See what I mean? Is anyone a skinner? They should know where that file is referenced, or even if I'm barking up the wrong tree. Though I've seen people reskin other units using that .dds file. They're job is easy since they're changing the file being referenced. I'm looking to reference a brand new file.
 
Hmm. Usually skins are originally created when you first make the unit, so I'd guess the link would be located inside the .nif file (if it isn't anywhere else, which it doesn't seem to be).

Would it not be possable just to go through the same procedure as reskinning a unit, but move all the files into a different directory?
 
if you want to create another unit, just create a new folder for it and copy and paste all the original files into the new folder. Now replace the .dds skin with your own and changing the name of it to overwrite the old .dds.

In the artinfo.xml (or whatever its called) just change the target to read that folder. It doesnt matter what name the .kfm and .nif files are.
This should solve your problem if I read it correctly.

This is the only way so far to add completely new units in the game without the sdk. Of course you have to ref them properly to techs, text keys etc.
 
sovarn said:
if you want to create another unit, just create a new folder for it and copy and paste all the original files into the new folder. Now replace the .dds skin with your own and changing the name of it to overwrite the old .dds.

In the artinfo.xml (or whatever its called) just change the target to read that folder. It doesnt matter what name the .kfm and .nif files are.
This should solve your problem if I read it correctly.

This is the only way so far to add completely new units in the game without the sdk. Of course you have to ref them properly to techs, text keys etc.

So even though the .nif and .kfm files have the name of the original unit in their filenames that doesn't matter?
 
no it doesnt
but whatever you do, do not mix and match .kf files.
and do not rename any of the files.
 
That would explain why, when I looked through the XML files, I saw nothing that referenced the file I was changing (unitname-128.dds). If it was referencing the folder, then knew to use the dds file in that folder for the skin, the filename itself need not be referenced. Nice.

I'll try that out tonight and let you know how that worked. It sounds promising.
 
Unfortunately, the CIV4ArtDefinesUnit.xml file (I assume this is the one you meant) only has the following tags for Infantry (which was to be my model):

Code:
<NIF>Art/Units/Infantry/Infantry.nif</NIF>
<KFM>Art/Units/Infantry/Infantry.kfm</KFM>
<SHADERNIF>Art/Units/Infantry/Infantry_FX.nif</SHADERNIF>
<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF

I tried copying the Infantry folder to a new location and renamed my new skin to Infantry_128.dds with the proper links in CIV4ArtDefinesUnit.xml and CIV4UnitInfos.xml. The game started, but the unique unit wouldn't appear in the Civilopedia (the entry did, the button, but no information and no moving unit). So I renamed all those files (changed every instance of Infantry to Guardsman) and tried again with the same results. We're getting closer (no errors when I load) but still not there yet. Something else is still not right.
 
i dont really understand your post. but are you sure you have created a completly new unit in the civ4unitinfos.xml and civ4unitclassinfo.xml.

after you have done this go to civ4unitinfos.xml and scroll down you new unit till you reach near the bottom of that unit info.

Code:
<UnitMeshGroups>
				<iGroupSize>3</iGroupSize>
				<fMaxSpeed>1.75</fMaxSpeed>
				<iMeleeWaveSize>3</iMeleeWaveSize>
				<iRangedWaveSize>0</iRangedWaveSize>
				<UnitMeshGroup>
					<iRequired>3</iRequired>
					<EarlyArtDefineTag>ART_DEF_UNIT_PANTHER</EarlyArtDefineTag>
				</UnitMeshGroup>
			</UnitMeshGroups>

you should see something like that

notice the <earlyartdefinetag> and make a new DEF_UNIT_ETC for your unit.

then go to.../art/civ4define_units.xml and create a new entry by copying and pasting an existing entry. then basically point the files to the appropiate nif and kfm file.

if it still doesnt work just post back here and iwill see if i can help....

EDIT: i just wrote a guide to add new units in - http://forums.civfanatics.com/showthread.php?t=139721
 
I have already done all that. In CIV4UnitInfos I have

Code:
<UnitMeshGroups>
	<iGroupSize>3</iGroupSize>
	<fMaxSpeed>1.75</fMaxSpeed>
	<iMeleeWaveSize>3</iMeleeWaveSize>
	<iRangedWaveSize>0</iRangedWaveSize>
	<UnitMeshGroup>
		<iRequired>3</iRequired>
		<EarlyArtDefineTag>ART_DEF_UNIT_PENNSYLVANIA_NATIONAL_GUARD</EarlyArtDefineTag>
	</UnitMeshGroup>
</UnitMeshGroups>

In my CIV4ArtDefines_Unit.xml file I have

Code:
<UnitArtInfo>
	<Type>ART_DEF_UNIT_PENNSYLVANIA_NATIONAL_GUARD</Type>
	<fScale>0.44</fScale>
	<fInterfaceScale>1.0</fInterfaceScale>
	<NIF>Art/Units/Infantry/Infantry.nif</NIF>
	<KFM>Art/Units/Infantry/Infantry.kfm</KFM>
	<SHADERNIF>Art/Units/Unique/Pennsylvania/Guardsman/Infantry_FX.nif</SHADERNIF>
	<ShadowDef>
	<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
		<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
		<fShadowScale>0.9</fShadowScale>
	</ShadowDef>
	<fBattleDistance>0.35</fBattleDistance>
	<fRangedDeathTime>0.05</fRangedDeathTime>
	<bActAsRanged>1</bActAsRanged>
	<TrainSound>AS2D_UNIT_BUILD_UNIQUE_UNIT</TrainSound>
	<AudioRunSounds>
		<AudioRunTypeLoop/>
		<AudioRunTypeEnd/>
		</AudioRunSounds>
</UnitArtInfo>

I have copied all the Infantry files over to the Art/Units/Unique/Pennsylvania/Guardsman directory and have edited Infantry_128.dds in the Art/Units/Unique/Pennsylvania/Guardsman folder to be my new unit skin.

And in the game nothing shows. The unit button and stuff show up, but there's no unit.
 
i see your problem, in CIV4ArtDefines_Unit.xml you still link the .nif an .kfm files to the infantry files. you must link them to the new folders.

Assuming all the infantry files are in Art/Units/Unique/Pennsylvania/Guardsman, change your code to this:

Code:
<UnitArtInfo>
	<Type>ART_DEF_UNIT_PENNSYLVANIA_NATIONAL_GUARD</Type>
	<fScale>0.44</fScale>
	<fInterfaceScale>1.0</fInterfaceScale>
	<NIF>Art/Units/Unique/Pennsylvania/Guardsman/Infantry.nif</NIF>
	<KFM>Art/Units/Unique/Pennsylvania/Guardsman/Infantry.kfm</KFM>
	<SHADERNIF>Art/Units/Unique/Pennsylvania/Guardsman/Infantry_FX.nif</SHADERNIF>
	<ShadowDef>
	<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
		<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
		<fShadowScale>0.9</fShadowScale>
	</ShadowDef>
	<fBattleDistance>0.35</fBattleDistance>
	<fRangedDeathTime>0.05</fRangedDeathTime>
	<bActAsRanged>1</bActAsRanged>
	<TrainSound>AS2D_UNIT_BUILD_UNIQUE_UNIT</TrainSound>
	<AudioRunSounds>
		<AudioRunTypeLoop/>
		<AudioRunTypeEnd/>
		</AudioRunSounds>
</UnitArtInfo>

notice lines 6 and 7 has been changed. tell if it works now?
 
It worked! Thanks so much Sovarn. You're a lifesaver. After looking at XML files for days on end, it all starts to run together. A fresh set of eyes (plus a basketball-sized chunk of brain behind them) was the help I needed. I can't thank you enough.
 
Back
Top Bottom