How to: create custom unit skins on a mac

Flintlock1415

Emperor
Joined
Feb 24, 2008
Messages
1,057
Location
MN
I have been interested in finding out how create new units of my own using my mac, and after discovering that I couldn't make new unit models I found a compromise: unit skinning.
I had planned on making a tutorial for anyone who is interested for a while, and just decided to make time to do so.

NOTE: This is only for skinning (basically recoloring) units and not new unit models. I Believe this method can be used for other applications i.e. building and leaderhead skins, (probably even flags/buttons, but that is a bit more complex) but have only used this for units.

Now, lets get started

Applications Needed

1. Macapaka by AlanH
needed for extracting the art files, instructions in thread

2. GraphicConverter
needed to converter dds files to png
NOTE: This is only a demo version (costs about $30 US) and loads after a 30 second wait, but will work for this and I don't believe the trial ever ends. (I've been using the demo for nearly 200 days and it still works.)

3. GIMP
Needed to edit the png files.

4. SquishDDS
Needed to convert .png file back into .dds (download the third item in brown lettering)
Alternate Link

Tutorial

After extracting the .fpk files, go into CivilzationIV/Assets/Art/Units and pick a unit folder that you want to skin. Then make a duplicate of the unit's dds file i.e. bear.dds or warrior_128.dds. (some units have a dds file w/ a number after it, use that file.) Drag the duplicate file to your desktop and change the from bear copy.dds to bear.dds (the file needs to keep the same name as the original)

IMPORTANT!-NEVER alter the original game files, always make a duplicate and alter that.

Now, open the file in GraphicConverter and save it as a .png file. Then open up GIMP (Photoshop also works, but the GIMP works fine and is free)

Then paint the file as you desire it to look. This will take some guesswork to figure out how the file is laid out but isnt *too* difficult.

After you have the file looking the way you want, then save it (obviously) and then open it up in SquishDDS and export the file as a .dds file.
Your setup should look like this:

Quality: High
(unchecked) Weight color by alpha
Metric: Perceptual
Output Format: DXT 3 (uncheck)--> Generate mitmaps


and click Convert to DDS...
You're done!

Adding to the game

To have the file replace the original skin (in game), simply drop your finished file into your Documents/CivilizationIV/CustomAssets/Art/Units/ folder path and drop the skin into the corresponding folder.

To actually make a separate unit, there are many tutorials available in the Creation/Customization forum. (I used Sovarn's tutorial here) this requires XML work, but it is a very easy to learn language.

I hope this helps anyone interested, and please tell me if I missed anything!:)
 
I've figured out how to make buttons, quite easily too.
First, go into Documents/CivilizationIV/Assets/Art/Interface/Buttons/Buildings, duplicate a button (cmd-click-> Duplicate), and drag it to the desktop.

Convert it to a png with GraphicConverter and rename it whatever you would like. Open the .png file in Gimp. Choose file-> Open as Layers... and select your image that you want to make into a button. A square image turns out the best, but it doesn't really matter.

Next, go to layer-> Scale Layer.. and resize it to 58*58. Then go to Layer-> Transparency-> Add Alpha Channel. Postition your layer in the center of the button and using the eraser tool shave off the corners and any excess so the button's border is showing. cmd click the layer and select merge down when you're finished.

Save the file and open it in SquishDDS. Set it up exactly like this:



(Check weight color by alpha, DXT3 format, UNcheck generate mipmaps.)
convert it to a dds and you're done! :goodjob:
 

Attachments

  • Button Settings.png
    Button Settings.png
    46.6 KB · Views: 825
Choose file-> Open as Layers... and select your image. A square image turns out the best, but it doesn't really matter.

Just to make it clearer, you might want to say the image you want to turn into a button instead of your image. I found it a bit confusing for a while.

Great work on both topics though!!!
 
Hello!

I tried to create customised buttons but I have a probleme during the game.

As you can see on this screenshot, the new unit with his own button appear in the civilopedia correctly :


For an exemple, here an american grenadier, I have no problem when I upgrade an unit to an american grenadier. I can use it in the game. I just have one problem when the unit is out of view on the map. As you can see on this screenshot, a circle button is missing and I just have a pink circle on my screen.
http://img4.hostingpics.net/pics/533024Capturedcran20110110132111.png

But when I want to build a new unit with customised button, Civilization crashes immediatly. Does anyone know how to fix this bug?

Here, you can see my "CIV4ArtDefines_Unit.xml" file concerning my american grenadier :
<UnitArtInfo>
<Type>ART_DEF_UNIT_GRENADIER_AMERICAN</Type>
<Button>,Art/Interface/Buttons/Units/Button_Grenadier_American.dds</Button>
<fScale>0.44</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/Units/Grenadier_American/brazil_grenadier.nif</NIF>
<KFM>Art/Units/Grenadier/Grenadier.kfm</KFM>
<SHADERNIF>Art/Units/Grenadier_American/brazil_grenadier.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
<fShadowScale>0.95</fShadowScale>
</ShadowDef>
<fBattleDistance>0.35</fBattleDistance>
<fRangedDeathTime>0.31</fRangedDeathTime>
<bActAsRanged>1</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
</UnitArtInfo>
 
Hello again,

Someone answered my question in the general customisation forum. My mistake was in my CIV4ArtDefines_Unit.xml file. This is the correct line for the button :
<Button>Art/Interface/Buttons/Units/Button_Grenadier_American.dds</Button>
I just need to remove the comma after <Button>.
 
Top Bottom