[TUTORIAL] Reskinning Vanilla Graphics

Deliverator

Graphical Hackificator
Joined
Feb 12, 2008
Messages
4,806
Location
London, UK
Update: Don't have time to rewrite this tutorial ATM but if you want to do reskins use this version of NexusBuddy. Just open the GR2 you want to reskin, switch the textures on the materials to your new ones and save the gr2 with a new name.

This tutorial assumes the following:
1) You have installed the mod tools and have ModBuddy and Nexus working.
2) You have unpacked the FPK containing the art files - see here if you're not sure how to do this.
3) You have Paint.NET or Photoshop with the DDS plugin to do the actually reskinning.

Reskinning a Unit

1) Copy the following unpacked files from .../Resource/Common and .../Resource/DX9 to a working directory:



These are the GR2 model file, the two DDS texture files and the Civ 5 asset file (the fxsxml).

2) Do your reskinning! I used Paint.NET to make a simple redcoat texture saving with the following options. You can use the Photoshop DDS export if that's what you're used to. I saved the file as redcoat.dds.



3) Download lemmy101 and CaptainBinky's GrannyMaterialHacker from here. Copy the executable to your Nexus directory (this is Nexus/x86 on my Windows 7 64-bit machine).

4) Run the GrannyMaterialHacker.exe. Select u_american_minuteman.gr2 as both the Source GR2 and My GR2. Then navigate to the DIFF texture as shown and double click on it. Select the redcoat.dds created in step 2 to replace this texture. Click HACKIFY! and a new GR2 file will be created called u_american_minuteman_new.gr2.





5) In your working directory rename u_american_minuteman_new.gr2 to redcoat.gr2 and u_american_minuteman.fxsxml to redcoat.xml.

6) Edit the newly renamed redcoat.fxsxml, changing the second line to <Mesh file="redcoat.gr2"/> and the line that refers to U_American_Minuteman_DIFF.dds to <Texture file="redcoat.dds"/>.

7) Now you can open up the redcoat.fxsxml in the Nexus Asset Viewer and see the reskinned unit in the 3D View.



8) Now to make a simple mod to get the unit into the game. Create a new Project in ModBuddy. Select "Empty Mod" and give it a name. In the solution explorer, right click your mod pick Add Existing Item and add redcoat.fxsxml, redcoat.dds and redcoat.gr2.



9) Copy the xml file civ5artdefines_unitmembers.xml from ../Resource/Common. For testing purposes, edit the entries for the three different warrior art defines to point to redcoat.fxsxml like this (the entry originally being copied from the one for the Minuteman):

Code:
  <UnitMemberArtInfo>
    <Type>ART_DEF_UNIT_MEMBER_WARRIOR</Type>
    <fScale>0.14</fScale>
   [B][COLOR="Red"] <Granny>redcoat.fxsxml</Granny>[/COLOR][/B]
    <Combat>
      <Defaults>ART_DEF_TEMPLATE_SOLDIER</Defaults>
      <bHasShortRangedAttack>1</bHasShortRangedAttack>
      <bReformBeforeCombat>1</bReformBeforeCombat>
      <Weapon>
        <WeaponTypeTag>BULLET</WeaponTypeTag>
        <WeaponTypeSoundOverrideTag>BULLET</WeaponTypeSoundOverrideTag>
      </Weapon>
    </Combat>
    <MaterialTypeTag>CLOTH</MaterialTypeTag>
    <MaterialTypeSoundOverrideTag>FLESH</MaterialTypeSoundOverrideTag>
  </UnitMemberArtInfo>

9) Now use Add Existing Item to add the civ5artdefines_unitmembers.xml file to your mod.

10) Finally, set the Reload Unit System checkbox in the properties of the mod as shown.



11) Save your Project and then run Build -> Build Solution.

12) Activate your mod in the Mod Browser and start a game. Hey presto - your reskinned Minuteman is in the game!



Hopefully this will allow reskinners much more talented than myself to get to work.

This process should also work for Buildings and City Sets - basically anything where the DDS files can be opened OK (i.e. not the 3D Leaders).

Thanks to lemmy101 and CaptainBinky without whom this would not be possible.

Notes
1. You can put your art into subdirectories in your mod, without needing to change the <Granny> tag in the art defines from just the filename. The files will still be found.
 

Attachments

  • step5.jpg
    step5.jpg
    27.5 KB · Views: 8,967
  • step6.jpg
    step6.jpg
    11.8 KB · Views: 8,902
  • step7.jpg
    step7.jpg
    50.8 KB · Views: 9,048
  • step8.jpg
    step8.jpg
    25.5 KB · Views: 9,059
  • step1.jpg
    step1.jpg
    12.1 KB · Views: 8,930
  • step2.jpg
    step2.jpg
    44.4 KB · Views: 9,072
  • step3.jpg
    step3.jpg
    75.4 KB · Views: 9,000
  • step4.jpg
    step4.jpg
    36.9 KB · Views: 9,016
Excellent news! Reskinning was one of the basics of Civilization 4 modding, and I don't know why they've made it such a hassle with the fiver. They could easily have made it more user-friendly. Nonetheless - good job.
 
Thanks a lot :goodjob:

I suppose GIMP can be used as reskinning tool also, right?

Apart the complex flow and the many tools to install, I see a big trouble in the process: to make a reskin without having a mesh/model to immediately check your modifications. We should become "blind" reskinners :(
 
Apart the complex flow and the many tools to install, I see a big trouble in the process: to make a reskin without having a mesh/model to immediately check your modifications. We should become "blind" reskinners :(

It's not too bad. With each save of the texture you need to close Nexus, reopen Nexus and reload the model via the Asset Viewer. It's pretty quick, but not as nice as Nifskope which automatically updates when you save the texture. At least you don't have to reload the game in between changes - that really would be working blind.

The fact that 3D art modding is not going to be as easy for Civ5 as it was for Civ4 is something we'll just have to get used to...
 
I suppose GIMP can be used as reskinning tool also, right?(
Yes, I use GIMP (this is my first time reskinning), but you need to download a DDS plugin first (otherwise gimp doesn't recognize it). I have no idea where i got the plugin, but a google search should find it for you.
 
Help what does this error mean?


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.MethodAccessException: Firaxis.Framework.Granny.GrannyMaterial.GetMaterial()
at GrannyMaterialHacker.Form1.FixMaterials(IGrannyMaterial mat)
at GrannyMaterialHacker.Form1.button4_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4952 (win7RTMGDR.050727-4900)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
GrannyMaterialHacker
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Steam/steamapps/common/sid%20meier's%20civilization%20v%20sdk/Nexus/x86/GrannyMaterialHacker.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Firaxis.Framework
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Steam/steamapps/common/sid%20meier's%20civilization%20v%20sdk/Nexus/x86/Firaxis.Framework.DLL
----------------------------------------
Firaxis.Framework.Granny
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Steam/steamapps/common/sid%20meier's%20civilization%20v%20sdk/Nexus/x86/Firaxis.Framework.Granny.DLL
----------------------------------------
System.DirectoryServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.DirectoryServices/2.0.0.0__b03f5f7f11d50a3a/System.DirectoryServices.dll
----------------------------------------
System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.4926 built by: NetFXw7
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Firaxis.Framework.Granny.ImplWin32
Assembly Version: 1.0.0.0
Win32 Version:
CodeBase: file:///D:/Steam/steamapps/common/sid%20meier's%20civilization%20v%20sdk/Nexus/x86/Firaxis.Framework.Granny.ImplWin32.DLL
----------------------------------------
Firaxis.Framework.FirePlace
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Steam/steamapps/common/sid%20meier's%20civilization%20v%20sdk/Nexus/x86/Firaxis.Framework.FirePlace.DLL
----------------------------------------
msvcm90
Assembly Version: 9.0.30729.4974
Win32 Version: 9.00.30729.4974
CodeBase: file:///C:/Windows/WinSxS/x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4974_none_50940634bcb759cb/msvcm90.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

This appears when I get to the "HACKIFY" step of this tutorial
 
That's where it's attempting to use the patched version of the Firaxis Granny dlls and failing as they aren't patched. That exception is supposed to happen but it's meant to be catching it in cases where the files aren't patched. (I catch the exception outside the function it's crashing in) so it's odd you're getting that.

Try installing this:

http://www.theindiestone.com/lemmyandbinky.com/civ2/MaterialMapperNexusPatch.zip

see if that helps at all?
 
Sorry for taking so long to try again. I really appreciate your help and hope to be able to get this first step down.
I am using windows 7 64bit btw could that be the prob? Nexus v1.0.0.0

I applied the patch that u linked to and tried the tutorial steps again:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.MethodAccessException: Firaxis.Framework.Granny.GrannyMaterial.GetMaterial()
at GrannyMaterialHacker.Form1.FixMaterials(IGrannyMaterial mat)
at GrannyMaterialHacker.Form1.button4_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4952 (win7RTMGDR.050727-4900)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
GrannyMaterialHacker
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Steam/steamapps/common/sid%20meier's%20civilization%20v%20sdk/Nexus/x86/GrannyMaterialHacker.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Firaxis.Framework
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Steam/steamapps/common/sid%20meier's%20civilization%20v%20sdk/Nexus/x86/Firaxis.Framework.DLL
----------------------------------------
Firaxis.Framework.Granny
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Steam/steamapps/common/sid%20meier's%20civilization%20v%20sdk/Nexus/x86/Firaxis.Framework.Granny.DLL
----------------------------------------
System.DirectoryServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.DirectoryServices/2.0.0.0__b03f5f7f11d50a3a/System.DirectoryServices.dll
----------------------------------------
System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.4926 built by: NetFXw7
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Firaxis.Framework.Granny.ImplWin32
Assembly Version: 1.0.0.0
Win32 Version:
CodeBase: file:///D:/Steam/steamapps/common/sid%20meier's%20civilization%20v%20sdk/Nexus/x86/Firaxis.Framework.Granny.ImplWin32.DLL
----------------------------------------
Firaxis.Framework.FirePlace
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Steam/steamapps/common/sid%20meier's%20civilization%20v%20sdk/Nexus/x86/Firaxis.Framework.FirePlace.DLL
----------------------------------------
msvcm90
Assembly Version: 9.0.30729.4974
Win32 Version: 9.00.30729.4974
CodeBase: file:///C:/Windows/WinSxS/x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4974_none_50940634bcb759cb/msvcm90.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
 
I tried your step by step tutorial to create a recolor. I tried three different times to make sure I did not miss a step. But when I want to open the recolor in Nexus Asset Viewer I get an error report containing:

============================
Application: Nexus
User: Unkown (Not an in-house user.)
Time: Monday 1-11-2010 18:01:33

Runtime: 64 bit
OS: Windows 2008 ()
Machine: VASTE-PC

Exception: System.OverflowException
Source: System.Drawing
Thread: Main Thread
Description: Overloopfout.

Stack Trace:
bij System.Drawing.Graphics.CheckErrorStatus(Int32 status)
bij System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)
bij System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback)
bij System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttr)
bij Firaxis.Framework.DrawingHelper.DrawImage(Graphics g, Image image, Single x, Single y, Int32 width, Int32 height, ColorMatrix m)
bij Firaxis.Framework.DrawingHelper.DrawImageCentered(Graphics g, Image image, Single x, Single y, Color color)
bij Civ5NexusModes.AssetViewer.ScrollableItemTriggerTrack.PaintTrack(Object sender, ScrollableItemPaintEventArgs e)
bij Firaxis.Framework.TimeLineTrackPanel.PaintTrack(Graphics g, DisplayTreeNode node, Rectangle r)
bij Firaxis.Framework.TimeLineTrackPanel.PaintTracks(Graphics g)
bij System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
bij System.Windows.Forms.Control.WmPaint(Message& m)
bij System.Windows.Forms.Control.WndProc(Message& m)
bij System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bij System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
=====================

I installed the patch that lemmy101 suggested, but still the error is there. Can someone help me out?
 
I found out that the problem was not the GrannyMaterialHacker but the Asset Viewer form Nexus. I can use the Civilization 5 - Unit Viewer but once I open a fxsxml-file it crashes with the error I gave (even if I try to open a fxsxml-file from the Steam/steamapps/Common/Sid Meier's Civilization V\resource\Common directory).

I think it has something to do with the animation files. Cause when I open a still-file like harbor_anc.fxsxml then it doesn't give an error?

I hope someone can explain what I am doing wrong.
 
GrannyMaterialHacker and IndieStoneNexusBuddy won't install, when I run the exe files the cursor spins for a bit and then it says the program isn't responding. Why cant this be like civ4, where you just had to edit the dds file and put it in the right folder. RRRGGG!!!
 
I have a question about the civ5artdefines_unitmembers.xml. You copied the file from the resource folder and adjusted some setting to make it show up. But is it also possible to update the existing civ5artdefines_unitmembers.xml file with your own creation.

I also checked the Knight Templar by Jaythekiller. It also uses the complete file. Does that mean that you cannot use several unit-mods together?
 
I have a question about the civ5artdefines_unitmembers.xml. You copied the file from the resource folder and adjusted some setting to make it show up. But is it also possible to update the existing civ5artdefines_unitmembers.xml file with your own creation.

I also checked the Knight Templar by Jaythekiller. It also uses the complete file. Does that mean that you cannot use several unit-mods together?

The Art Defines XMLs are not modular - they work in a similar way to Civ 4 in that they complete overwrite the vanilla one. If you want to use different unit mods all you have to do is merge the new entries from the different civ5artdefines_unitmembers.xml into your own mod's single civ5artdefines_unitmembers.xml.
 
Hey

I've started work on my first mod and i run on another porblem (the other i solved with the help of tutorials and own time spend on trying different things and checking how it was done by someone else).

I've reskinned Hagia Sofia to Blue Mosque - really rough reskin because I've jus desaturated red bricks. The mod works fine, tme buttons and the wonder splash appears, but I have problem with other graphics.
1. The model doesn't appear on the map
2. The city dissapears after starting building the city - like on this screen:



I have used
hagia_sophia.gr2 , hagia_sophia.fxsxml ,hagia_sophia_diff.dds, hbhagiasophia_diff.dds asa baqse for texture and model

Here's prealpha mod if someone would like to check what's wrong.

http://www.mediafire.com/?bn3af9dp8k7l6dz

Any ide what i might did wrong?
 
See the post above yours in which is explained unit and unitmember files are not Modular. You have to add your additions in both files and add them to your mod. Because you set the mod to reload units all info on the art definition files is gone.
 
Top Bottom