PDA

View Full Version : Armour Upgrade System



Rhyfelwyr
06-16-2007, 21:00
When a blacksmith upgrades a units armour, does it upgrade, say all light mail armoured troops in the settlement, to heavy mail. Or, would it be triggered for individual units. For example, the first level blacksmith might read:

Peasants +1 armour
Peasant Archers +1 armour

Just wondering for a mod I am working on...

Kobal2fr
06-16-2007, 21:46
Not sure what you want to know exactly. But armour upgrades work that way : each unit type has an "armour_ug_levels" line in the export_descr_units.txt that dictates their starting armour type, how many upgrades they can get and which level of blacksmith gives it to them.

Example :
Peasants 0,1
Peasant Archers 0,1,2
Armored Sarges 2,3

etc..., 0 being naked, 1 leather, 2 light mail etc...

Rhyfelwyr
06-16-2007, 21:51
For example, the Highland Nobles read


type Highland Nobles
dictionary Highland_Nobles ; Highland Nobles
category infantry
class heavy
voice_type Heavy
banner faction main_infantry
banner holy crusade
soldier Highland_Nobles, 48, 0, 1.2
attributes sea_faring, hide_forest, hardy, can_withdraw
formation 1.2, 1.2, 2.4, 2.4, 4, square
stat_health 1, 0
stat_pri 14, 6, no, 0, 0, melee, melee_blade, slashing, sword, 25, 1.3
;stat_pri_ex 0, 0, 0
stat_pri_attr no
stat_sec 0, 0, no, 0, 0, no, melee_simple, blunt, none, 25, 1
;stat_sec_ex 0, 0, 0
stat_sec_attr no
stat_pri_armour 5, 4, 0, metal
;stat_armour_ex 5, 7, 0, 0, 4, 0, 0, metal
stat_sec_armour 0, 0, flesh
stat_heat 4
stat_ground 1, -2, 3, 2
stat_mental 9, normal, trained
stat_charge_dist 30
stat_fire_delay 0
stat_food 60, 300
stat_cost 1, 490, 175, 90, 70, 490, 4, 120
armour_ug_levels 2, 3
armour_ug_models Highland_Nobles, Highland_Nobles_ug1
ownership scotland
era 1 scotland
era 2 scotland
;unit_info 14, 0, 9

The number 2 is bold above shows they have light mail armour. Is the 3 following it code for the level of blacksmith that upgrades to the next armour model? Is the 3 the actual code itself?

Kobal2fr
06-16-2007, 22:00
3 tells the game that any blacksmith building at or above level 3 can upgrade it, yes, and Highland_Nobles_ug1 tells the game which model to upgrade them to.

And no, it's not the actual code for the process, the EDU merely lists variables and stats, not how they are used by which function where to do what, sadly.
Would make our modding work a lot easier though, wouldn't it ? :grin: