
Originally Posted by
Sorceri
Could you possibly put some detailed instructions on the download post for 4.0 on how to change the upkeeps? I know that I won't be playing on anything other than M/M, and I am NOT comfortable with how to change code. I wouldn't even know how to begin. Thanks.
There is no easy way of changing upkeep without changing code. Fortunately, the code is easy to change, so that's not a problem. Just make sure you back up your original files before you make any changes. Data\export_descr_units.txt (EDU) is the file we're looking at.
At the beginning of the EDU, there is some commentary explaining how the file works.
Code:
; stat_charge_distance Distance from the enemy that the unit will begin charging
; stat_fire_delay Ectra delay over that imposed by animation, hetween volleys
;
; stat_food No longer used
; stat_cost Number of turns to build,
; Cost of unit to construct
; Cost of upkeep
; Cost of upgrading weapons
; Cost of upgrading armour
; Cost for custom battles
; stat_ownership List of factions and cultures that may have this unit
The part in red is what we're looking for. Now let's look at a typical unit, and see how that works. I'll use the briton peasants from vanilla, as that's the only install I have on my desktop at the moment.
Code:
type barb peasant briton
dictionary barb_peasant_briton ; Barbarian Peasants
category infantry
class light
voice_type Light_1
soldier barb_peasant, 60, 0, 0.7
attributes sea_faring, hide_improved_forest
formation 1.2, 1.8, 2.4, 2.4, 6, horde
stat_health 1, 0
stat_pri 1, 0, no, 0, 0, melee, simple, piercing, knife, 25 ,1
stat_pri_attr no
stat_sec 0, 0, no, 0, 0, no, no, no, none, 25 ,1
stat_sec_attr no
stat_pri_armour 3, 1, 0, leather
stat_sec_armour 0, 0, flesh
stat_heat 2
stat_ground 2, -2, 3, 2
stat_mental 0, low, untrained
stat_charge_dist 30
stat_fire_delay 0
stat_food 60, 300
stat_cost 1, 150, 100, 20, 30, 150
ownership britons
As you can see, there are six entries under stat cost, corresponding to the description at the beginning. The unit takes 1 turn to build, costs 150 denarii to build, 100 denarii per turn upkeep, 20 denarii to upgrade weapons, 30 to upgrade armour, and 150 denarii in custom battles. If we want to change the upkeep to 120 denarii per turn, we'd therefore change the third entry on that line, so it would read thus.
stat_cost 1, 150, 120, 20, 30, 150
Now just save that file, and you've successfully done your first bit of coding.