Results 1 to 4 of 4

Thread: How to make units "unique"?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default How to make units "unique"?

    In kingdoms crusade there were some units that were "unique" meaning that one can only have one of them at a time.
    Is there any way to put this into the export_descr_unit file?

  2. #2
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: How to make units "unique"?

    I think you might have to script some stuff in campaign_script, or descr_strat, and you might want to do something in EDB. So no, it can't be done via EDU.

    Give a better description of what you want exactly and I or someone else will explain how to get it.
    Last edited by Taiji; February 22, 2012 at 02:16 AM.

  3. #3

    Default Re: How to make units "unique"?

    You can do this with any unit with some simple scripting...You can use this a guidline script for each unit you want to be unique...Here's an example of the script to write in campaign_script file...Obviously you can change or add more unit's if desired....
    Code:
    ;------------------- RECRUITMENT - UNIQUE UNITS -------------------;    
    
    ;Only one unique unit can exist at a time
    
    ;Jerusalem
        ;Marshall of the Templars
        ;Constable of Jerusalem
        
    ;Antioch
        ;Marshall of the Hospitallers
        ;Canons of the Holy Sepulcher
    
    ;Test if the unit doesn't exist at start of turn
        ;Increment event counter - allows recruitment
            
        set_event_counter no_templar_marshall 0
        set_event_counter no_jerusalem_constable 0
        set_event_counter no_hospitaller_marshall 0
        set_event_counter no_canon_sepluchre 0
        
        monitor_event FactionTurnStart FactionType jerusalem
            and I_EventCounter no_templar_marshall == 0
             and not I_UnitExists jerusalem Marshall of the Templars
            add_events
                event    counter    no_templar_marshall
                 date    0
             end_add_events
         end_monitor
    
        monitor_event FactionTurnStart FactionType jerusalem
            and I_EventCounter no_jerusalem_constable == 0
             and not I_UnitExists jerusalem Constable of Jerusalem
            add_events
                event    counter    no_jerusalem_constable
                 date    0
             end_add_events
         end_monitor
    
        monitor_event FactionTurnStart FactionType antioch
            and I_EventCounter no_hospitaller_marshall == 0
             and not I_UnitExists antioch Marshall of the Hospitallers
            add_events
                event    counter    no_hospitaller_marshall
                 date    0
             end_add_events
         end_monitor
    
        monitor_event FactionTurnStart FactionType antioch 
            and I_EventCounter no_canon_sepluchre == 0
             and not I_UnitExists antioch Canons of the Holy Sepulcher
            add_events
                event    counter    no_canon_sepluchre
                 date    0
             end_add_events
         end_monitor
    
    ;Test if the unit exists at start of turn
        ;Decrement event counter - stops recruitment
        
        monitor_event AddedToTrainingQueue UnitType Marshall of the Templars
            and I_EventCounter no_templar_marshall == 1
            set_event_counter no_templar_marshall 0
        end_monitor
    
        monitor_event AddedToTrainingQueue UnitType Constable of Jerusalem
            and I_EventCounter no_jerusalem_constable == 1
            set_event_counter no_jerusalem_constable 0
         end_monitor
    
        monitor_event AddedToTrainingQueue UnitType Marshall of the Hospitallers
            and I_EventCounter no_hospitaller_marshall == 1
            set_event_counter no_hospitaller_marshall 0
         end_monitor
         
        monitor_event AddedToTrainingQueue UnitType Canons of the Holy Sepulcher
            and I_EventCounter no_canon_sepluchre == 1
            set_event_counter no_canon_sepluchre 0
         end_monitor
    And this is an example of what your entries in the EDB should look like;

    Code:
    recruit_pool "Constable of Jerusalem"  0   0.1   0.999  0   requires factions { jerusalem, }  and event_counter  no_jerusalem_constable 1 
    recruit_pool "Marshall of the Hospitallers"  0   0.1   0.999  0   requires factions { antioch, }  and event_counter  no_hospitaller_marshall 1
    recruit_pool "Marshall of the Templars"  0   0.1   0.999  0  requires  factions { jerusalem, }  and event_counter no_templar_marshall 1 
    recruit_pool "Canons of the Holy Sepulcher"  0   0.1   0.999  0   requires factions { antioch, }  and event_counter no_canon_sepluchre 1

  4. #4
    Vegas_Bear's Avatar Biarchus
    Join Date
    Sep 2005
    Location
    Las Vegas, NV
    Posts
    605

    Default Re: How to make units "unique"?

    I think he is referring to the 'unique_unit' attribute for the unit in the EDU. Example from Crusades -

    Spoiler Alert, click show to read: 
    type Constable of Jerusalem
    dictionary Constable_of_Jerusalem ; Constable of Jerusalem
    category cavalry
    class heavy
    voice_type Heavy
    banner faction main_cavalry
    banner holy crusade_cavalry
    soldier Constable_of_Jerusalem, 48, 0, 1
    mount mailed horse
    mount_effect elephant -4, camel -4
    attributes sea_faring, hide_forest, hardy, can_withdraw, can_formed_charge, knight, unique_unit
    formation 2, 4.4, 3, 6, 3, square, wedge
    stat_health 1, 0
    stat_pri 11, 7, no, 0, 0, melee, melee_blade, piercing, spear, 25, 1
    ;stat_pri_ex 0, 0, 0
    stat_pri_attr no
    stat_sec 12, 3, no, 0, 0, melee, melee_blade, blunt, mace, 25, 1
    ;stat_sec_ex 0, 0, 0
    stat_sec_attr ap
    stat_pri_armour 6, 5, 6, metal
    ;stat_armour_ex 6, 0, 0, 0, 5, 6, 4, metal
    stat_sec_armour 0, 0, flesh
    stat_heat 7
    stat_ground 0, -2, -10, 2
    stat_mental 11, impetuous, highly_trained
    stat_charge_dist 45
    stat_fire_delay 0
    stat_food 60, 300
    stat_cost 1, 1380, 375, 115, 270, 1380, 1, 410
    armour_ug_levels 3
    armour_ug_models Constable_of_Jerusalem
    ownership jerusalem
    era 0 jerusalem
    era 1 jerusalem
    ;unit_info 11, 0, 17
    recruit_priority_offset 35


    I hope this is what you were looking for,

    VB

Posting Permissions

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