Nice, okay
.
You should actually do it, it makes a lot of things appear easier afterwards
.
But so you've probably already seen, a lot of these things involve copying and changing some names. If you add a new civ, you take an existing civ entry, copy it, and change the top entry in "type", and that's the basis. That didn't do too much, but it's a new civ entry.
The same for units
.
In Assets\XML\Units\UnitInfos.xml you can find the entries for units.
One looks e.g. like this one for the jaguar:
to add a new unit, just copy this entry, and change UNIT_AZTEC_JAGUAR to something else, UNIT_MY_NEW_UNIT, or whatever you like. So the basis is done. You have a new unit, which looks like the jaguar, and has all the same stats, but it is a new unit.
Since it has UNITCLASS_SWORDSMAN, it is a replacement for the swordsman. To make it a replacement for another unit, put another unitclass in there. It should be a replacement for the infantry? Put UNITCLASS_INFANTRY there. Or whatever, just as example.
If you look through the entry, you can probably figure out what most of the entries mean.
Some important ones:
PHP:
<PrereqTech>TECH_IRON_WORKING</PrereqTech>
[...]
<iCost>35</iCost>
[...]
<iMoves>1</iMoves>
[...]
<iCombat>5</iCombat>
First: Needed technology
Second: Needed hammers. That scales with the speed, so use standard if you want to test something, else you might get confused.
Third: Movement points of the unit.
Fourth: Strength of the unit.
Most of the other stuff should also be easy to figure out. Or take a look at
the modiki. Or ask
.
So, now we assume you changed some things to your liking. Next part, how to change the look.
If you look through the unit entry, you'll find this part:
PHP:
<UnitMeshGroups>
<iGroupSize>3</iGroupSize>
<fMaxSpeed>1.75</fMaxSpeed>
<fPadTime>1</fPadTime>
<iMeleeWaveSize>3</iMeleeWaveSize>
<iRangedWaveSize>0</iRangedWaveSize>
<UnitMeshGroup>
<iRequired>3</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_AZTEC_JAGUAR</EarlyArtDefineTag>
</UnitMeshGroup>
</UnitMeshGroups>
What does this say? It says, that it will display 3 (iGroupSize) graphics of the type ART_DEF_UNIT_AZTEC_JAGUAR (not sure what iRequired, just make it the same like iGroupSize; ignore the rest).
The number might be different, e.g. you normally see only one ship or only one nuke, so they have there a 1.
So, but where is ART_DEF_UNIT_AZTEC_JAGUAR? That's an entry in Assets\XML\Art\ArtDefines_units.xml. All the unit art definitions are in that file.
If you take a look at that file now, you will see:
PHP:
<UnitArtInfo>
<Type>ART_DEF_UNIT_AZTEC_JAGUAR</Type>
<Button>,Art/Interface/Buttons/Units/Jaguar.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,4,4</Button>
<fScale>0.44</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/Units/Unique/Aztec/Jaguar/Aztec_Jaguar.nif</NIF>
<KFM>Art/Units/Unique/Aztec/Jaguar/Aztec_Jaguar.kfm</KFM>
<SHADERNIF>Art/Units/Unique/Aztec/Jaguar/Aztec_Jaguar_FX.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
<fShadowScale>1.0</fShadowScale>
</ShadowDef>
<fBattleDistance>0.4</fBattleDistance>
<fRangedDeathTime>0.31</fRangedDeathTime>
<bActAsRanged>0</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIQUE_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
</UnitArtInfo>
which is the entry for the art.
Copy it, and replace ART_DEF_UNIT_AZTEC_JAGUAR with your new name. That HAS to be the same like in the UnitInfos.xml, so change it there too
.
So, what's important there? This part:
PHP:
<NIF>Art/Units/Unique/Aztec/Jaguar/Aztec_Jaguar.nif</NIF>
<KFM>Art/Units/Unique/Aztec/Jaguar/Aztec_Jaguar.kfm</KFM>
<SHADERNIF>Art/Units/Unique/Aztec/Jaguar/Aztec_Jaguar_FX.nif</SHADERNIF>
So, there's a Aztec_Jaguar.nif file in the folder Art/Units/Unique/Aztec/Jaguar/.
If you want to add a new unit, download one here, and create a folder in the Art folder (somewhere in it, doesn't matter where), and unzip all the files into it.
You will also find .nif files in there. Put now the folder in the NIF entry, and point it to the biggest .nif file in that folder (normally also named in the right way).
In the SHADERNIF entry put the same (unless there is a big *unitname*_fx.nif in the folder, then use that one).
For the KFM entry, there are 2 possibilites:
- There is a .kfm file in the folder (ignore the .kf files), then use that .kfm
- There is no .kfm file in the folder. Then take a look at where you got the unit from. It should say which animation (= .kfm file) the unit should use. E.g. if it used the animations from the jaguar, then i could let that entry stay there. If it was...whatever, infantry, then you would have to search in the file for the infantry entry, and copy whatever is written there in the .kfm entry. That works, the .kfm file does not have to be in the same folder.
And now...save it.
You unit should now hopefully look different.
Now, last part.
The unit is alreay a UU, because it replaces the swordsman, infantry, whatever. But it is nowhere said, for which civ that UU is.
That's done in Assets\XML\Civilizations\CivilizationInfos.xml.
If you look through the civ entries, you'll find e.g. this here:
PHP:
<Units>
<Unit>
<UnitClassType>UNITCLASS_SWORDSMAN</UnitClassType>
<UnitType>UNIT_AZTEC_JAGUAR</UnitType>
</Unit>
</Units>
That's the only part, which defines to where a UU belongs. So, that part is from the aztec civ, and you see, it has the jaguar as UU replacement for the swordsman. Change the entries to the name of your new unit, and what it replaces, then you're done.
Okay, more or less done. You can always change stats, and your unit will need a button, and maybe some other things, but this is the basis.
Try it, and report back how it works
.