kiwitt
Road to War Modder
I am currently adding 200+ unique units to my game. This is what I do.
Create a Template file for the type of unit you are working. e.g Fighter
- CIV4CivilizationInfos.xml
CIV4UnitInfos.xml
CIV4ArtDefines_Unit.xml
TextFile.XML
Then copy and paste the templates into the relevant files and edit the parameters to the settings I require.
Then just simply replace "abc" with the three letter code I have chosen for the Civilization.
Note: The hardest part of this is not the actual coding but the research (It has taken me 6 months to do all the 30+ nations in my mod) in to all the unique units performance parameters and scaling them to Civ 4.
See this tutorial based on this one
Create a Template file for the type of unit you are working. e.g Fighter
- CIV4CivilizationInfos.xml
Code:
<Unit>
<UnitClassType>UNITCLASS_WW2_FIGHTER</UnitClassType>
<UnitType>UNIT_WW2_FIG1_abc</UnitType>
</Unit>
Code:
<UnitInfo>
<Class>UNITCLASS_WW2_FIGHTER</Class>
<Type>UNIT_WW2_FIG1_abc</Type>
<UniqueNames/>
<Special>NONE</Special>
<Capture>NONE</Capture>
<Combat>UNITCOMBAT_AIR</Combat>
<Domain>DOMAIN_AIR</Domain>
<DefaultUnitAI>UNITAI_DEFENSE_AIR</DefaultUnitAI>
<Invisible>NONE</Invisible>
<SeeInvisible>NONE</SeeInvisible>
<Description>TXT_KEY_UNIT_WW2_FIG1_abc</Description>
...
... Not complete <UnitInfo> template
...
<UnitMeshGroups>
<iGroupSize>1</iGroupSize>
<fMaxSpeed>10.0</fMaxSpeed>
<fPadTime>1</fPadTime>
<iMeleeWaveSize>1</iMeleeWaveSize>
<iRangedWaveSize>1</iRangedWaveSize>
<UnitMeshGroup>
<iRequired>1</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_WW2_FIG1_abc</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
<FormationType>FORMATION_TYPE_DEFAULT</FormationType>
<HotKey/>
<bAltDown>0</bAltDown>
<bShiftDown>0</bShiftDown>
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<FreePromotions/>
<LeaderPromotion>NONE</LeaderPromotion>
<iLeaderExperience>0</iLeaderExperience>
<bDCMAirBomb1>1</bDCMAirBomb1>
<bDCMAirBomb2>0</bDCMAirBomb2>
<bDCMAirBomb3>0</bDCMAirBomb3>
<bDCMAirBomb4>1</bDCMAirBomb4>
<bDCMAirBomb5>0</bDCMAirBomb5>
<bDCMFighterEngage>1</bDCMFighterEngage>
</UnitInfo>
Code:
<UnitArtInfo>
<Type>ART_DEF_UNIT_WW2_FIG1_abc</Type>
<Button>Art/Interface/Buttons/Units/Fighter1.dds</Button>
<fScale>0.35</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/UnitsHist/ Nif File </NIF>
<KFM>Art/Units/Fighter/Fighter.kfm</KFM>
<SHADERNIF>Art/UnitsHist/ Nif FX File </SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/FighterShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
<fShadowScale>0.75</fShadowScale>
</ShadowDef>
<iDamageStates>4</iDamageStates>
<fBattleDistance>0.35</fBattleDistance>
<fRangedDeathTime>0.31</fRangedDeathTime>
<bSmoothMove>1</bSmoothMove>
<bActAsRanged>0</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
<PatrolSound>AS3D_UN_FIGHTER_PATROL</PatrolSound>
<SelectionSound>AS3D_UN_FIGHTER_COMMAND_PATROL</SelectionSound>
<ActionSound>AS3D_UN_FIGHTER_COMMAND_PATROL</ActionSound>
</UnitArtInfo>
Code:
<TEXT>
<Tag>TXT_KEY_UNIT_WW2_FIG1_abc</Tag>
<English>Fighter II Sqn</English>
<French>Fighter II Sqn</French>
<German>Fighter II Sqn</German>
<Italian>Fighter II Sqn</Italian>
<Spanish>Fighter II Sqn</Spanish>
</TEXT>
Then copy and paste the templates into the relevant files and edit the parameters to the settings I require.
Then just simply replace "abc" with the three letter code I have chosen for the Civilization.
Note: The hardest part of this is not the actual coding but the research (It has taken me 6 months to do all the 30+ nations in my mod) in to all the unique units performance parameters and scaling them to Civ 4.
See this tutorial based on this one