Hi everyone, this is my first tutorial, and i will show you how to add the free upkeep ability to any building or units you want.
WARNING!
Before doing anything, be sure to backup the 2 files we are going to modify, export_descr_unit.txt, and export_descr_buildings.txt
Step I
In the export_descr_unit.txt, found in your data folder( you need to have unpacked first), or in a mod's data folder, open this file.
Now you want to add the free_upkeep_unit attribute to one of them. Here is a unit without it:
Code:
type Desert Archers
dictionary Desert_Archers ; Desert Archers
category infantry
class missile
voice_type Light
banner faction main_missile
banner holy crusade
soldier Desert_Archers, 48, 0, 0.8
attributes sea_faring, hide_forest, very_hardy, can_withdraw
formation 1.2, 1.2, 2.4, 2.4, 3, square
stat_health 1, 0
stat_pri 7, 1, arrow, 160, 30, missile, missile_mechanical, piercing, none, 25, 1
;stat_pri_ex 0, 0, 0
stat_pri_attr no
stat_sec 6, 1, no, 0, 0, melee, melee_blade, piercing, sword, 25, 1
;stat_sec_ex 0, 0, 0
stat_sec_attr no
stat_pri_armour 0, 3, 3, flesh
;stat_armour_ex 0, 4, 0, 0, 3, 3, 3, flesh
stat_sec_armour 0, 0, flesh
stat_heat 0
stat_ground 1, 2, -2, -2
stat_mental 3, normal, untrained
stat_charge_dist 30
stat_fire_delay 0
stat_food 60, 300
stat_cost 1, 390, 100, 65, 50, 390, 4, 90
armour_ug_levels 0, 1
armour_ug_models Desert_Archers, Desert_Archers_ug1
ownership moors, egypt, slave
era 0 moors, egypt
era 1 moors, egypt
era 2 moors, egypt
;unit_info 6, 7, 6
You need to add this line in the highlighted attributes section:
And here is how it looks with this attribute added:
Code:
type Desert Archers
dictionary Desert_Archers ; Desert Archers
category infantry
class missile
voice_type Light
banner faction main_missile
banner holy crusade
soldier Desert_Archers, 48, 0, 0.8
attributes sea_faring, hide_forest, very_hardy, can_withdraw, free_upkeep_unit
formation 1.2, 1.2, 2.4, 2.4, 3, square
stat_health 1, 0
stat_pri 7, 1, arrow, 160, 30, missile, missile_mechanical, piercing, none, 25, 1
;stat_pri_ex 0, 0, 0
stat_pri_attr no
stat_sec 6, 1, no, 0, 0, melee, melee_blade, piercing, sword, 25, 1
;stat_sec_ex 0, 0, 0
stat_sec_attr no
stat_pri_armour 0, 3, 3, flesh
;stat_armour_ex 0, 4, 0, 0, 3, 3, 3, flesh
stat_sec_armour 0, 0, flesh
stat_heat 0
stat_ground 1, 2, -2, -2
stat_mental 3, normal, untrained
stat_charge_dist 30
stat_fire_delay 0
stat_food 60, 300
stat_cost 1, 390, 100, 65, 50, 390, 4, 90
armour_ug_levels 0, 1
armour_ug_models Desert_Archers, Desert_Archers_ug1
ownership moors, egypt, slave
era 0 moors, egypt
era 1 moors, egypt
era 2 moors, egypt
;unit_info 6, 7, 6
Do this with as many units as you want to have the have free upkeep in castles.
Step II
Now let's move on to buildings.
Open export_descr_buildings.txt, found in the same folder with the above file.
Here is how a building's( literally, a large city's) entry looks unmodified:
Code:
material stone
construction 4
cost 9600
settlement_min large_city
upgrades
{
}
}
}
plugins
{
}
}
building core_castle_building
{
convert_to core_building
levels motte_and_bailey wooden_castle castle fortress citadel
{
motte_and_bailey castle requires factions { northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, }
{
capability
{
recruit_pool "Hobilars" 1 0.2 2 0 requires factions { england, }
recruit_pool "Border Horse" 1 0.2 2 0 requires factions { scotland, }
recruit_pool "Mounted Sergeants" 1 0.2 2 0 requires factions { france, hre, milan, venice, papal_states, sicily, Normans, }
recruit_pool "Scouts" 1 0.2 2 0 requires factions { denmark, }
recruit_pool "Jinetes" 1 0.2 2 0 requires factions { spain, portugal, }
recruit_pool "Polish Shooters" 1 0.2 2 0 requires factions { poland, }
recruit_pool "Kazaks" 1 0.2 2 0 requires factions { russia, }
recruit_pool "Magyar Cavalry" 1 0.2 2 0 requires factions { hungary, }
recruit_pool "Skythikon" 1 0.2 2 0 requires factions { byzantium, }
recruit_pool "Desert Cavalry" 1 0.2 2 0 requires factions { moors, }
recruit_pool "Arab Cavalry" 1 0.2 2 0 requires factions { egypt, }
recruit_pool "Turkomans" 1 0.2 2 0 requires factions { turks, }
recruit_pool "Mongol Horse Archers" 1 0.2 2 0 requires factions { mongols, }
recruit_pool "Turkish Horse Archers" 1 0.2 2 0 requires factions { timurids, }
recruit_pool "Theigns" 1 0.2 2 0 requires factions { Saxons, }
recruit_pool "Peasants" 0 0.000001 0.999 0 requires factions { england, france, hre, denmark, spain, portugal, milan, venice, papal_states, Normans, Saxons, }
recruit_pool "Highland Rabble" 0 0.000001 0.999 0 requires factions { scotland, }
recruit_pool "Southern Peasants" 0 0.000001 0.999 0 requires factions { sicily, byzantium, }
recruit_pool "EE Peasants" 0 0.000001 0.999 0 requires factions { poland, russia, hungary, }
recruit_pool "ME Peasants" 0 0.000001 0.999 0 requires factions { moors, egypt, turks, mongols, timurids, }
wall_level 0
tower_level 1
law_bonus bonus 1
recruitment_slots 1
Ok, see the last 4 lines, they are somehow the attributes of the building, upgrade, however you want to call it. What we nned to do is to add this line to it:
Code:
free_upkeep bonus #
# is a number of your choice, put any number you want, up to 6, I think. It defines how many units the building can support with free upkeep. I have put 1 for the purposes of the Tutorial.
So I modified this building entry to have free upkeep for units and it looks like this:
Code:
material stone
construction 4
cost 9600
settlement_min large_city
upgrades
{
}
}
}
plugins
{
}
}
building core_castle_building
{
convert_to core_building
levels motte_and_bailey wooden_castle castle fortress citadel
{
motte_and_bailey castle requires factions { northern_european, mesoamerican, middle_eastern, eastern_european, greek, southern_european, }
{
capability
{
recruit_pool "Hobilars" 1 0.2 2 0 requires factions { england, }
recruit_pool "Border Horse" 1 0.2 2 0 requires factions { scotland, }
recruit_pool "Mounted Sergeants" 1 0.2 2 0 requires factions { france, hre, milan, venice, papal_states, sicily, Normans, }
recruit_pool "Scouts" 1 0.2 2 0 requires factions { denmark, }
recruit_pool "Jinetes" 1 0.2 2 0 requires factions { spain, portugal, }
recruit_pool "Polish Shooters" 1 0.2 2 0 requires factions { poland, }
recruit_pool "Kazaks" 1 0.2 2 0 requires factions { russia, }
recruit_pool "Magyar Cavalry" 1 0.2 2 0 requires factions { hungary, }
recruit_pool "Skythikon" 1 0.2 2 0 requires factions { byzantium, }
recruit_pool "Desert Cavalry" 1 0.2 2 0 requires factions { moors, }
recruit_pool "Arab Cavalry" 1 0.2 2 0 requires factions { egypt, }
recruit_pool "Turkomans" 1 0.2 2 0 requires factions { turks, }
recruit_pool "Mongol Horse Archers" 1 0.2 2 0 requires factions { mongols, }
recruit_pool "Turkish Horse Archers" 1 0.2 2 0 requires factions { timurids, }
recruit_pool "Theigns" 1 0.2 2 0 requires factions { Saxons, }
recruit_pool "Peasants" 0 0.000001 0.999 0 requires factions { england, france, hre, denmark, spain, portugal, milan, venice, papal_states, Normans, Saxons, }
recruit_pool "Highland Rabble" 0 0.000001 0.999 0 requires factions { scotland, }
recruit_pool "Southern Peasants" 0 0.000001 0.999 0 requires factions { sicily, byzantium, }
recruit_pool "EE Peasants" 0 0.000001 0.999 0 requires factions { poland, russia, hungary, }
recruit_pool "ME Peasants" 0 0.000001 0.999 0 requires factions { moors, egypt, turks, mongols, timurids, }
wall_level 0
tower_level 1
law_bonus bonus 1
recruitment_slots 1
free_upkeep bonus 1
Now, you have added this special ability to this building. Do this to as many buildings as you want.
Ending Notes
So, if you read this little tutorial closely, you should be able to add free upkeep to any unit and building you want. Good luck!