Deliverator
Graphical Hackificator
This is a method for editing Civ4 nif files for use in Civ4Col using NifSkope.
This assumes that you already have mod set up and know your way around CIV4ArtDefines_Unit.xml and CIV4UnitInfos.xml. (I can explain this bit another time if people are unsure.)
Why can't I just use the current models?
Well, you can, but they may look wrong. People have said that the solution is to use the _fx version of the nif file, but this doesn't completely solve the issue. The _fx version is just a prettier version of the nif with extra layers of gloss/lighting. _fx does not mean Civ4Col compatible. See this screenshot of japanesesamurai_fx.nif in C4C:
I'm using the _fx.nif but I still have a yellow sword. The following method can be used to fix this, but it can also be used to migrate units that don't have a _fx NIF.
Editing Samurai for use in Civ4Col
1) Copy the entire samurai directory from the BTS Assets/Art/Units/Unique/Japan into Mods/<YourMod>/Assets/Art/Units. (You don't have to use the Samurai - this is just an example)
2) Open the copied japanesesamurai_fx.nif in NifSkope.
3) Under View in the Menu Bar make sure Block List and Block Details are checked and then select Show Blocks in List:
4) Scroll until you spot the element TeamColor.bmp then Right Click -> Block -> Remove:
5) In View switch back to Show Blocks in Tree. The 3D components of a NIF are either called NiTriShape or NiTriStrips (NiTriStrips is just a stripped version of NiTriShape - they basically have the same structure otherwise). We need to select the NiTriShape for the swords and edit some of its properties. The easiest way is simply to click on a sword in the 3D view. The Block List should automatically highlight the selected NiTriShape in blue. Using the little plus sign expand the tree until you see NiTexturingProperty, then expand that as well. Note the node number of the base NiSourceTexture - in this case the base texture is samurai_128.dds and the node number 42:
6) Set 'Has Decal 0 Texture' to 'no' by clicking on 'yes'. (The swords will turn white but don't worry). Set 'Has Base Texture' to 'yes' by clicking on 'no'. Finally, expand the BaseTexture node and enter the node number for the base texture - which we noted was 42. (On doing this the swords will turn back to the proper texture)
7) Finally save the file. File -> Save As... Providing you have made a copy of the NIF file in you Mod folder tree you can safely overwrite the existing .nif file with the edited one.
8) That's it! Now on loading up our mod - the samurai's sword is it's proper colour.
How does Team Color work?
Team Color in Civ4Col is applied by the shader. You can see that the samurai we just converted still has Team Color even though we have removed TeamColor.bmp:
Here's a little demonstration. I've ported the Aztec Jaguar from normal Civ4 into Civ4Col using the process just described.
Notice that the loincloth is team colour, but that the feathers are transparent. Why are some parts of the model transparent and some team colour? Here's why.
In aztec_jaguar_fx.nif, the NiTriShape for the Body has the shader set to TCiv4Skinning whereas the NiTriShape for the Feathers has the shader set to TCiv4SkinningNoTeamColor. If I swap these so the Body has TCiv4SkinningNoTeamColor and the Feathers have TCiv4Skinning this is the in game result:
Not very desirable in this case, but you take the point. In terms of model customization and texturing this gives me control over what is transparent and what is team color.
Unit Sound and Effects
If you're bringing across a Civ4 unit or a custom unit and want the sound and effects too (why wouldn't you?!) then the first thing you need to figure out is which sounds/effects go with the unit in question. This isn't always obvious as a lot of vanilla units share the same sounds. The sound and effects are associated with the KF animation files rather than the NIF. (An exception is the Civilization order and select sounds which are specified in CIV4CivilizationInfos.xml - CivilizationSelectionSound and CivilizationActionSound tags)
To determine which sounds a unit requires:
1) Open up a KF file in NifSkope and locate a node called NiTextKeyExtraData in the Block List (normally at the bottom of the list).
2) View Block Details for NiTextKeyExtraData and expand the Text Keys like so:
The Text Key Values correspond to entries in Audio3DScripts.xml such as:
These entries refer to entries in AudioDefines.xml such as:
The AudioDefines.xml refers the actual mp3 file location in the Filename tag. So in order to port unit sounds you will have to copy the relevant entries in Audio3DScripts.xml and AudioDefines.xml and copy the mp3 files into the Sound folder. It is not usually necessary to go through every single KF file for the unit as you will quickly figure out that the unit uses, for example, the Swordsman sounds and then you can just copy all the Swordsman stuff over. A certain number of Civ4 sounds are already included in Civ4Col too.
Effects (such as flying arrows and smoke) follow a similar pattern except that Effects are NIFs and associated DDS files which need to copied to your mod's Effects subdirectory. The XML in question is XML/Misc/CIV4EffectInfos.xml. Effects look like this in the Text Key values:
Effect:RifleBlast:EFFECT_RIFLEBLAST
Happy unit migration!
This assumes that you already have mod set up and know your way around CIV4ArtDefines_Unit.xml and CIV4UnitInfos.xml. (I can explain this bit another time if people are unsure.)
Why can't I just use the current models?
Well, you can, but they may look wrong. People have said that the solution is to use the _fx version of the nif file, but this doesn't completely solve the issue. The _fx version is just a prettier version of the nif with extra layers of gloss/lighting. _fx does not mean Civ4Col compatible. See this screenshot of japanesesamurai_fx.nif in C4C:
I'm using the _fx.nif but I still have a yellow sword. The following method can be used to fix this, but it can also be used to migrate units that don't have a _fx NIF.
Editing Samurai for use in Civ4Col
1) Copy the entire samurai directory from the BTS Assets/Art/Units/Unique/Japan into Mods/<YourMod>/Assets/Art/Units. (You don't have to use the Samurai - this is just an example)
2) Open the copied japanesesamurai_fx.nif in NifSkope.
3) Under View in the Menu Bar make sure Block List and Block Details are checked and then select Show Blocks in List:
4) Scroll until you spot the element TeamColor.bmp then Right Click -> Block -> Remove:
5) In View switch back to Show Blocks in Tree. The 3D components of a NIF are either called NiTriShape or NiTriStrips (NiTriStrips is just a stripped version of NiTriShape - they basically have the same structure otherwise). We need to select the NiTriShape for the swords and edit some of its properties. The easiest way is simply to click on a sword in the 3D view. The Block List should automatically highlight the selected NiTriShape in blue. Using the little plus sign expand the tree until you see NiTexturingProperty, then expand that as well. Note the node number of the base NiSourceTexture - in this case the base texture is samurai_128.dds and the node number 42:
6) Set 'Has Decal 0 Texture' to 'no' by clicking on 'yes'. (The swords will turn white but don't worry). Set 'Has Base Texture' to 'yes' by clicking on 'no'. Finally, expand the BaseTexture node and enter the node number for the base texture - which we noted was 42. (On doing this the swords will turn back to the proper texture)
7) Finally save the file. File -> Save As... Providing you have made a copy of the NIF file in you Mod folder tree you can safely overwrite the existing .nif file with the edited one.
8) That's it! Now on loading up our mod - the samurai's sword is it's proper colour.
How does Team Color work?
Team Color in Civ4Col is applied by the shader. You can see that the samurai we just converted still has Team Color even though we have removed TeamColor.bmp:
Here's a little demonstration. I've ported the Aztec Jaguar from normal Civ4 into Civ4Col using the process just described.
Notice that the loincloth is team colour, but that the feathers are transparent. Why are some parts of the model transparent and some team colour? Here's why.
In aztec_jaguar_fx.nif, the NiTriShape for the Body has the shader set to TCiv4Skinning whereas the NiTriShape for the Feathers has the shader set to TCiv4SkinningNoTeamColor. If I swap these so the Body has TCiv4SkinningNoTeamColor and the Feathers have TCiv4Skinning this is the in game result:
Not very desirable in this case, but you take the point. In terms of model customization and texturing this gives me control over what is transparent and what is team color.
Unit Sound and Effects
If you're bringing across a Civ4 unit or a custom unit and want the sound and effects too (why wouldn't you?!) then the first thing you need to figure out is which sounds/effects go with the unit in question. This isn't always obvious as a lot of vanilla units share the same sounds. The sound and effects are associated with the KF animation files rather than the NIF. (An exception is the Civilization order and select sounds which are specified in CIV4CivilizationInfos.xml - CivilizationSelectionSound and CivilizationActionSound tags)
To determine which sounds a unit requires:
1) Open up a KF file in NifSkope and locate a node called NiTextKeyExtraData in the Block List (normally at the bottom of the list).
2) View Block Details for NiTextKeyExtraData and expand the Text Keys like so:
The Text Key Values correspond to entries in Audio3DScripts.xml such as:
Code:
<Script3DSound>
<ScriptID>AS3D_UN_WARR_ATTK_VOX</ScriptID>
<SoundID>SND_WARR_ATTK_VOX</SoundID>
<SoundType>GAME_SFX</SoundType>
<iMinVolume>75</iMinVolume>
<iMaxVolume>100</iMaxVolume>
<iPitchChangeDown>-3000</iPitchChangeDown>
<iPitchChangeUp>3000</iPitchChangeUp>
<bLooping>0</bLooping>
<iMinTimeDelay>0</iMinTimeDelay>
<iMaxTimeDelay>0</iMaxTimeDelay>
<StartPosition>NONE</StartPosition>
<EndPosition>NONE</EndPosition>
<iMinVelocity>0</iMinVelocity>
<iMaxVelocity>0</iMaxVelocity>
<iMinDistanceFromListener>0</iMinDistanceFromListener>
<iMaxDistanceFromListener>0</iMaxDistanceFromListener>
<iMinDistanceForMaxVolume>500</iMinDistanceForMaxVolume>
<iMaxDistanceForMaxVolume>1000</iMaxDistanceForMaxVolume>
<iMinCutoffDistance>7000</iMinCutoffDistance>
<iMaxCutoffDistance>7000</iMaxCutoffDistance>
<bTaperForSoundtracks>0</bTaperForSoundtracks>
<iLengthOfSound>0</iLengthOfSound>
<fMinDryLevel>1.0</fMinDryLevel>
<fMaxDryLevel>1.0</fMaxDryLevel>
<fMinWetLevel>0.5</fMinWetLevel>
<fMaxWetLevel>0.5</fMaxWetLevel>
<iNotPlayPercent>0</iNotPlayPercent>
</Script3DSound>
Code:
<SoundData>
<SoundID>SND_WARR_ATTK_VOX</SoundID>
<Filename>Sounds/Units/WarrAttkVox</Filename>
<LoadType>DYNAMIC_RES</LoadType>
<bIsCompressed>1</bIsCompressed>
<bInGeneric>1</bInGeneric>
</SoundData>
Effects (such as flying arrows and smoke) follow a similar pattern except that Effects are NIFs and associated DDS files which need to copied to your mod's Effects subdirectory. The XML in question is XML/Misc/CIV4EffectInfos.xml. Effects look like this in the Text Key values:
Effect:RifleBlast:EFFECT_RIFLEBLAST
Happy unit migration!