A little tut
how to add units to the mod, step by step.
Adding units have two aspects that need to be done.
- First you need to add the unit to the own battle section.
- Second, to have the unit later in campaign, you also need to add the unit to one building, so it can be recruited in game.
For now this tut I will only talk about the first.
A pitfall on adding new units is also, that the number of units a mod can have, is limited: If you go over that number , it will result in a crash and (if you have enabled '
-show_err' to your games shortcut) an error message.
Ok, let's start!
There are two text files that need to be edited to get new units in game, both are in
\data in your mod folder.
The files are:
descr_model_battle.txt and
export_descr_unit.txt
The easiest way is you copy and duplicate an unit entry and rename it:
Let's take the RTW barb. standard bearer and put it into our mod.
Open the descr_model_battle.txt (in RTW!) and search the barb_standard:
'
type barb_standard
skeleton fs_standard_bearer
indiv_range 40
texture gauls, data/models_unit/textures/officer_barb_standard_gaul.tga
texture britons, data/models_unit/textures/officer_barb_standard_briton.tga
texture germans, data/models_unit/textures/officer_barb_standard_german.tga
texture dacia, data/models_unit/textures/officer_barb_standard_dacia.tga
texture scythia, data/models_unit/textures/officer_barb_standard_scythia.tga
model_flexi data/models_unit/officer_barb_standard_400.cas, 8
model_flexi data/models_unit/officer_barb_standard_300.cas, 15
model_flexi data/models_unit/officer_barb_standard_200.cas, 30
model_flexi data/models_unit/officer_barb_standard_100.cas, 40
model_flexi data/models_unit/officer_barb_standard_70.cas, max
model_sprite 60.0, data/sprites/warband_woad_sprite.spr
model_sprite britons, 60.0, data/sprites/parthia_east_heavy_cataphract_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5
'
We now put this into our mod (which is BI yet, so we have to rename factions and we use our own textures)and rename it:
'
type
vik_standard
skeleton fs_standard_bearer
indiv_range 40
texture vandals, data/models_unit/textures/unit_vik_standard_carls.tga
texture romano_british, data/models_unit/textures/unit_vik_standard_mercia.tga
texture ostrogoths, data/models_unit/textures/unit_vik_standard_mercia.tga
texture slave, data/models_unit/textures/unit_vik_standard_mercia.tga
model_flexi data/models_unit/officer_barb_standard_400.cas, 8
model_flexi data/models_unit/officer_barb_standard_300.cas, 15
model_flexi data/models_unit/officer_barb_standard_200.cas, 30
model_flexi data/models_unit/officer_barb_standard_100.cas, 40
model_flexi data/models_unit/officer_barb_standard_70.cas, max
model_sprite 60.0, data/sprites/warband_woad_sprite.spr
model_sprite vandals, 60.0, data/sprites/parthia_east_heavy_cataphract_sprite.spr
model_tri 400, 0.5f, 0.5f, 0.5
'
Make sure you really have already those textures and the faction- and filenames are correct, or it might result in a crash again.
This should be enought to get our unit into game via the 'officer' slot in
export_descr_unit.txt.
To see that unit in battles you go to one of our units and add that standard bearer to a unit, let's say we add the standard-bearer to the 'costal levys':
'
type coastal levies
dictionary coastal_levies ; Coastal Levies
category infantry
class spearmen
voice_type Light_1
soldier coastal_levies, 55, 0, 1.3
officer vik_standard
attributes sea_faring, hide_forest, can_sap, very_hardy
formation 1.2, 1.2, 2, 2, 7, square, shield_wall ;
stat_health 4, 0
stat_pri 42, 9, no, 0, 0, melee, simple, piercing, spear, 1 ,1
stat_pri_attr light_spear, spear_bonus_12,
ap
stat_sec 0, 0, no, 0, 0, no, no, no, none, 1 ,1
stat_sec_attr no
stat_pri_armour 20, 20, 23, leather
stat_sec_armour 0, 0, flesh
stat_heat 5
stat_ground 1, -2, 3, 2
stat_mental 15, normal, trained
stat_charge_dist 60
stat_fire_delay 0
stat_food 60, 300
stat_cost 2, 437, 184, 40, 60, 350
ownership slave, romano_british
'
That should do it.
If you check your costal levys unit in romano-british faction in battle now (not in campaign! only in own battle) there should be a standard bearer in the unit now.
If this works, you could try to create a unit with our standard bearers (sure its nonsense to have such, but it can demonstrate how to do it).
Go in
export_descr_unit.txt now, copy one unit there and rename it.
Lets say we copy our costal levys unit and change some parts:
'
type
coastal levies2
dictionary coastal_levies ; Coastal Levies
category infantry
class spearmen
voice_type Light_1
soldier
vik_standard, 55, 0, 1.3
attributes sea_faring, hide_forest, can_sap, very_hardy
formation 1.2, 1.2, 2, 2, 7, square, shield_wall ;
stat_health 4, 0
stat_pri 42, 9, no, 0, 0, melee, simple, piercing, spear, 1 ,1
stat_pri_attr light_spear, spear_bonus_12, ap
stat_sec 0, 0, no, 0, 0, no, no, no, none, 1 ,1
stat_sec_attr no
stat_pri_armour 20, 20, 23, leather
stat_sec_armour 0, 0, flesh
stat_heat 5
stat_ground 1, -2, 3, 2
stat_mental 15, normal, trained
stat_charge_dist 60
stat_fire_delay 0
stat_food 60, 300
stat_cost 2, 437, 184, 40, 60, 350
ownership slave, romano_british
'
If you (and I) made no errors you should have a unit with standard bearers now in your own battle when you choose your Romano-british faction.
Here is more tuts, including how to create a new skin for a unit:
http://www.twcenter.net/forums/showt...units+tutorial