Results 1 to 14 of 14

Thread: Giving Units and Buildings the Free Upkeep Ability

  1. #1
    Soulghast's Avatar RAWR!
    Join Date
    Oct 2006
    Location
    Athens, Greece
    Posts
    3,912

    Icon2 Giving Units and Buildings the Free Upkeep Ability

    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:
    Code:
    free_upkeep_unit


    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!
    Last edited by Soulghast; March 09, 2007 at 04:41 AM.
    Ex-Curator
    Under the Patronage of Perikles
    Patron of Desperado † and Astaroth


    R.I.P Calvin

  2. #2

    Default Re: Tutorial: Giving Units and Buildings the Free Upkeep Ability

    This works for me. But...
    It turns out the unit is kept free in the town only if it can also be recruited there. For example in your tutorial if you added the free_upkeep_unit attribute to Desert Archers they won't be kept free in your modified Motte and Bailey, as they can't be recruited there. Say you recruited them elswhere and brought them to your Motte and Bailey.
    Is there any way to override this? To make every unit with free_upkeep_unit attribute cost 0 while they are in any town or castle that supports free upkeep?
    Regards

  3. #3

    Default Re: Tutorial: Giving Units and Buildings the Free Upkeep Ability

    where are export_descr_unit.txt and export_descr_buildings.txt files? I can't find them in Medieval II data folder, please tell me where are they.

  4. #4
    malcolm mcdowell's Avatar Miles
    Join Date
    Oct 2007
    Location
    Bonnie Scotland
    Posts
    311

    Default Re: Tutorial: Giving Units and Buildings the Free Upkeep Ability

    you first have to use the unpacker - its in the tools folder i think.

    on a different note, is it possible to have units that can only have free upkeep in cities/castles?

  5. #5

    Default Re: Tutorial: Giving Units and Buildings the Free Upkeep Ability

    After changing this value for wall types, the building info card does not update to reflect the change. How do I change the value on the info card?

    EDIT: Nevermind, my .cfg was pointing to a different mod folder. The change is made automatically.
    Last edited by Romulus Augustus; February 23, 2008 at 04:10 PM. Reason: New Information

  6. #6

    Default Re: Tutorial: Giving Units and Buildings the Free Upkeep Ability

    Quote Originally Posted by Jahoo View Post
    This works for me. But...
    It turns out the unit is kept free in the town only if it can also be recruited there. For example in your tutorial if you added the free_upkeep_unit attribute to Desert Archers they won't be kept free in your modified Motte and Bailey, as they can't be recruited there. Say you recruited them elswhere and brought them to your Motte and Bailey.
    Is there any way to override this? To make every unit with free_upkeep_unit attribute cost 0 while they are in any town or castle that supports free upkeep?
    Regards
    I just got into EDU modding recently. I was wondering if anyone figured out how to make units qualfiy as free upkeep units in settlements that can't recruit them?

  7. #7
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Tutorial: Giving Units and Buildings the Free Upkeep Ability

    This is not possible. But you can modify the recruitment of this unit in the settlement that is not intended to have it, but to offer free_upkeep for it, that the unit would never be recruitable (for example, maximum number set to 0.9).

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  8. #8

    Default Re: Tutorial: Giving Units and Buildings the Free Upkeep Ability

    Awesome thanks. I wanted to make generals qualify as free upkeep, seeing as I use them as population boosters and figured they should qualify towards the free upkeep limit.

  9. #9
    Leeham991's Avatar Campidoctor
    Join Date
    Oct 2008
    Location
    The United Kingdom of Great Britain and Northern Ireland
    Posts
    1,893

    Default Re: Tutorial: Giving Units and Buildings the Free Upkeep Ability

    Using this method could you in theory keep an entire army free in a city? Say adding 6 slots to huge walls, 6 slots to the army barracks, 2 for the sword guild, ect ect ect.
    I like pie.

  10. #10
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Tutorial: Giving Units and Buildings the Free Upkeep Ability

    Quote Originally Posted by sumaznguy View Post
    Awesome thanks. I wanted to make generals qualify as free upkeep, seeing as I use them as population boosters and figured they should qualify towards the free upkeep limit.
    I always give bodyguards 0 upkeep because you cannot disband them.

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  11. #11

    Default Re: Tutorial: Giving Units and Buildings the Free Upkeep Ability

    got a question, I downloaded stainless steel RR/RC and decided to mod the unit's stat, desc_mount and desc_character files, without using the unpacker
    so now I got a CTD in campaign battle.

    My question is, now that I have the unpacker, do I just need to unpack all and everything is fine or do I have to reinstall Medieval 2, unpack all, then install SS RR/RC then mod stuff?

  12. #12
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Tutorial: Giving Units and Buildings the Free Upkeep Ability

    Re-install SS RR/RC, that's all. And next time make back ups before you start modifying files.










  13. #13

    Default Re: Giving Units and Buildings the Free Upkeep Ability

    I changed a general's bodyguard and was wondering what was so expensive. turns out I never did this. thanks a bunch!

  14. #14

    Default Re: Giving Units and Buildings the Free Upkeep Ability

    You actually can give free upkeep without allowing a unit to be recruit-able in a building, a method discovered by euskingc. Add recruitment lines as normal, but make the starting pool, refresh and pool limit 0. For example:

    Code:
    recruit_pool "celtiberian cavalry skirmisher"  0  0.00  0  0  requires factions { f_arevaci, } 
    recruit_pool "celtiberian infantry gaesamica"  0  0.00  0  0  requires factions { f_arevaci, }
    recruit_pool "iberian infantry iovamann"  0  0.00  0  0  requires factions { f_arevaci, }
    recruit_pool "iberian infantry shepherd slinger"  0  0.00  0  0  requires factions { f_arevaci, }
    The unit doesn't appear on the roster, cannot be recruited in that building, but will receive the benefit of free upkeep if garrisoned there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •