Custom Leaderhead Development Thread

Waking up to some good news over here.

CONFIRMED:

http://forums.civfanatics.com/showpost.php?p=9791194&postcount=99

We can now add new units that are reskinned versions of existing units. Weee! Progress!

Cool, I started out trying to do this yesterday but I didnt get any luck. I wanted to reskin the paratrooper as a temporary replacement for the marine unit I am looking to include in the game. But I am guessing that it requires the gr2 extractor.

The way I tried to do it was to copy the gr2 file and rename it. I then left all animations pointed to the original ones while the texture was referring to the new one. Unfortunatley, this did not work and in Nexus, it would still show the old skin.

Bout to download the new tool and mess around with it. Thanks Lemmy.

EDIT: nvm found it
 
Version 2 of the tool is done.

This version adds mesh -> material bindings. The old version just assigns every material in the file to every mesh. Which is fine for single materials, but not so fine for objects with multiple meshes or multiple materials. The new version looks like this:

weee2.jpg


The new section in the middle (marked Advanced use) you can safely ignore when you are doing things like unit reskinning where only one material is used and just go click HACKIFY! The tool still assigns every material to every mesh. Just using this you can select each mesh and 'unbind' materials from it, so as to configure which of your materials are assigned to which of your meshs more effectively.

Link is here: http://www.theindiestone.com/lemmyandbinky.com/civ2/GrannyMaterialHackerv2.zip
 
Just wanted to add this so people would know....when first running the program, you have to select the main Civ 5 directory, NOT the assets folder. This ended up causing a problem with both nexus and lemmy's granny reskinner. If you have already made this mistake, follow these steps:

1. Press start the start button and type in regedit.
2. Under HKEY_CURRENT_USER\SOFTWARE\FIRAXIS\TOOLS you will see a file called ToolAssetPath. Open it and you will be able to change the directory.
3. Change it to the main folder of your civ install. Like C:\Program Files\Sid Meier's Civilization V\

Wanted to give everyone a heads up.
 
Ok so I've been trying this with no luck. My new unit comes up in the actual game, but the texture is still the original one. Here is what I did using your program.



So I opened the marine.fxsxml and edited a line to point to the marine.gr2. I then opened it from nexus and it showed me this.



This is what the fxsxml file looks like:
Spoiler :
<Asset>
<Mesh file="marine.gr2"/>
<Animation file="Paratrooper_IdleA.gr2" ec="1000"/>
<Animation file="Paratrooper_FidgetA.gr2" ec="1040"/>
<Animation file="Paratrooper_IdleA_Trans_IdleB.gr2" ec="1020"/>
<Animation file="Paratrooper_IdleB.gr2" ec="2000"/>
<Animation file="Paratrooper_FidgetB.gr2" ec="2040"/>
<Animation file="Paratrooper_IdleB_Trans_IdleA.gr2" ec="2020"/>
<Animation file="Paratrooper_Fortify.gr2" ec="1500"/>
<Animation file="Paratrooper_Fortify_Idle.gr2" ec="1520"/>
<Animation file="Paratrooper_Fortify_Idle_Fidget.gr2" ec="1540"/>
<Animation file="Paratrooper_Fortify_Idle_Trans_Combat_Ready_Idle.gr2" ec="1560"/>
<Animation file="Paratrooper_Fortify_Idle_Trans_IdleA.gr2" ec="1580"/>
<Animation file="Paratrooper_Combat_Ready.gr2" ec="1600"/>
<Animation file="Paratrooper_Combat_Ready_Idle.gr2" ec="1620"/>
<Animation file="Paratrooper_Combat_Ready_Idle_Trans_IdleA.gr2" ec="1640"/>
<Animation file="Paratrooper_Run.gr2" ec="1400"/>
<Animation file="Paratrooper_Stop_Run.gr2" ec="1440"/>
<Animation file="Paratrooper_Charge_Run.gr2" ec="1120"/>
<Animation file="Paratrooper_Charge_Attack.gr2" ec="1140"/>
<Animation file="Paratrooper_AttackA.gr2" ec="1100"/>
<Animation file="Paratrooper_AttackB.gr2" ec="2100"/>
<Animation file="Paratrooper_Attack_City.gr2" ec="1160, 1180"/>
<Animation file="Paratrooper_Victory.gr2" ec="1800"/>
<Animation file="Paratrooper_Bombard_Defense.gr2" ec="1280"/>
<Animation file="Paratrooper_Bombard_Defense_Idle.gr2" ec="1285"/>
<Animation file="Paratrooper_Bombard_Defense_Idle_Trans_IdleA.gr2" ec="1290"/>
<Animation file="Paratrooper_DeathA.gr2" ec="1200"/>
<Animation file="Paratrooper_DeathA_Idle.gr2" ec="1220"/>
<Animation file="Paratrooper_DeathB.gr2" ec="2200"/>
<Animation file="Paratrooper_DeathB_Idle.gr2" ec="2220"/>
<Animation file="Paratrooper_Stop_Run_B.gr2" ec="2440"/>
<Animation file="Paratrooper_Shuffle.gr2" ec="1450"/>
<Texture file="Unit_Environment_Dull.dds"/>
<Texture file="Unit_Environment_Sharp.dds"/>
<Texture file="Unit_Irradiance.dds"/>
<Texture file="marine_diff.dds"/>
<Texture file="marine_sref.dds"/>
<AnimGraph file="IDLE_OFFSET_CONTINUE_TRUE_GRAPH.dge"/>
<AnimGraph file="FORTIFY_FIDGET_GRAPH.dge"/>
<AnimGraph file="ENTER_FORTIFY.dge"/>
<AnimGraph file="LEAVE_BOMBARD_DEFEND_TRANS_IDLE_A_GRAPH.dge"/>
<AnimGraph file="DEATH_FINAL_GRAPH.dge"/>
<AnimGraph file="BOMBARD_DEFEND_LOOP_GRAPH.dge"/>
<AnimGraph file="ENTER_BOMBARD_DEFEND_GRAPH.dge"/>
<AnimGraph file="DEATH_GRAPH.dge"/>
<AnimGraph file="LEAVE_COMBAT_READY.dge"/>
<AnimGraph file="ENTER_COMBAT_READY_GRAPH.dge"/>
<AnimGraph file="FORTIFY_LEAVE_GRAPH.dge"/>
<AnimGraph file="COMBAT_READY_GRAPH.dge"/>
<AnimGraph file="FORTIFY_GRAPH.dge"/>
<AnimGraph file="TRANSITIONS_FOR_IDLES.dge"/>
<AnimGraph file="STOP_RUNNING.dge"/>
<AnimGraph file="IDLE_GRAPH.dge"/>
<AnimGraph file="FIDGETS_GRAPH.dge"/>
<AnimGraph file="MELEE_ATTACKS.dge"/>
<AnimGraph file="RUN_CHARGE_SHUFFLE_LOOP.dge"/>
<AnimGraph file="ATTACK_TO_RUN_CHARGE_SHUFFLE.dge"/>
<AnimGraph file="ATTACK_CITY_TO_RUN_CHARGE_SHUFFLE.dge"/>
<AnimGraph file="START_RUN_CHARGE_SHUFFLE.dge"/>
<AnimGraph file="SHUFFLE_STOP_GRAPH.dge"/>
<AnimGraph file="RUN_CHARGE_SHUFFLE_TO_SHUFFLE_RUN_CHARGE.dge"/>
<StateMachine file="1_OMNI_STATE_01.fsmxml"/>
<TimedTrigger file="FX_Triggers_Paratrooper.ftsxml"/>
<BoneUsage>
<Bone name="Base HumanSpine2"/>
<Bone name="gun"/>
<Bone name="Base HumanSpine1"/>
</BoneUsage>
</Asset>


If I link it back to the original texture, it works. If I overwrite the original texture with mine, it also works. :mad:

EDIT: I figured it out. I used the original paratrooper_sref.dds file and everything worked this time.
 
I used the same image, just under a different name. It may have been because maybe it wasnt saved in the correct format. All works now though and I dont mind if this is the case. As long as we can finally get some custom art working.

Still havent tried importing my model in yet, but technically it should work even without animations, right? Also would you mind telling me which decompilers you used to view the dll's?
Thanks and great work!
 
Still havent tried importing my model in yet, but technically it should work even without animations, right?
Yeah should work fine. :)

Also would you mind telling me which decompilers you used to view the dll's?Thanks and great work!

Reflector, along with ILDASM and ILASM to decompile / compile to/from intermediate language.
 
Reflector, along with ILDASM and ILASM to decompile / compile to/from intermediate language.

Thanks....also i've finally tried to see if it will allow me to add the texture on to my character but I keep getting an unhandled exception error.

Spoiler :
************* Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at GrannyMaterialHacker.Form1.DiscoveredParams_MouseDoubleClick(Object sender, MouseEventArgs e)
at System.Windows.Forms.Control.OnMouseDoubleClick(MouseEventArgs e)
at System.Windows.Forms.ListBox.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)


I get this whenever browse for the texture to be added and press open.
 
Hmm...Doesnt allow me to browse for the texture anymore on my model. But it does work on original game assets. The other thing that is wierd is that it shows that it contains building meshes.



Ill also post the files I was using in case it helps.
 

Attachments

That's odd. :S I've uploaded a new copy. Try that but make sure you start from a freshly exported exporter.temp.gr2 and a fresh copy of modern.gr2 (unpacked or from backup) to make sure no broken data is getting through. Also try and make sure you close down the app and reload it inbetween different attempts. There may be bugs due to residual material references hanging around in memory if you hackify multiple times in one session.
 
still no luck, doesnt let me browse...i will try to see if I can get it working on a different model later on and ill let you know how it comes out.
 
Ahh. :D

From the screenshot it looks like you're doing it wrong. In the top slot wants to go something like Rifleman.gr2, not your own model, then change the texture on it (the top file should always be an unaltered firaxis model not one of yours). You need the unaltered Firaxis model to steal the materials off, and your 'modern' would go in the bottom 'My GR2' field, when you click 'HACKIFY!' you will get a modern_new.gr2 with the new textures on.
 
I created it through nexus by importing the FBX. The original fbx should be in there too.

thanks....:-D ill try it right now.

EDIT: It works!! bout to put it in the game and give it a try. Is there a limit to how big a texture file can be?
 
Back
Top Bottom