Page 2 of 2 FirstFirst 12
Results 21 to 29 of 29

Thread: Creating a World - Instant garrisons and their disbandment

  1. #21
    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,132
    Blog Entries
    35

    Default Re: Creating a World - Instant garrisons and their disbandment

    The spawned garrison units require the 'garrison' attribute in their EDU entry. Please be aware that the destroy_units command will remove ALL units of that faction with that attribute, which means you should only spawn dedicated units, eg they should not be recruitable otherwise.

    Your script also allows spawning of garrisons for the player (missing local_faction condition) but the removal is only for the AI (local_faction condition).
    Last edited by Gigantus; March 11, 2022 at 09:36 PM.










  2. #22

    Default Re: Creating a World - Instant garrisons and their disbandment

    I provided a copy of the EDU entry too using the garrison attribute and I still encounter the same issue (see below). As for your second point could you provide me an example, please? Sorry I am new to this, but I appreciate your help.

    Your script also allows spawning of garrisons for the player (missing local_faction condition) but the removal is only for the AI (local_faction condition)."



    Code:
    ;;;French Garrison;;;
    
    type             CrossbowmenG
    dictionary       Crossbowmen      ; Crossbowmen
    category         infantry
    class            missile
    voice_type       Light
    banner faction   main_missile
    banner holy      crusade
    soldier          Crossbowmen, 80, 0, 0.8
    attributes       sea_faring, hide_forest, can_withdraw, crossbow, garrison, free_upkeep_unit, no_custom
    formation        1.2, 1.2, 2.4, 2.4, 3, square
    stat_health      1, 0
    stat_pri         9, 1, crossbow_bolt, 120, 30, missile, missile_mechanical, piercing, none, 25, 1
    ;stat_pri_ex      0, 0, 0
    stat_pri_attr    ap
    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  5, 3, 0, metal
    ;stat_armour_ex   5, 7, 0, 0, 3, 0, 0, metal
    stat_sec_armour  0, 0, flesh
    stat_heat        4
    stat_ground      1, -2, 3, 2
    stat_mental      3, normal, trained
    stat_charge_dist 30
    stat_fire_delay  18
    stat_food        60, 300
    stat_cost        1, 330, 0, 65, 50, 330, 4, 80
    armour_ug_levels 2, 3
    armour_ug_models Crossbowmen, Crossbowmen_ug1
    ownership        france, slave
    era 1            france
    era 2            france
    info_pic_dir	 data\ui\unit_info\france\crossbowmen_info.tga
    ;unit_info        6, 9, 8
    
    
    
    
    type             Pike MilitiaG
    dictionary       Pike_Militia      ; Pike Militia
    category         infantry
    class            spearmen
    voice_type       Light
    banner faction   main_spear
    banner holy      crusade
    soldier          Pike_Militia, 100, 0, 1
    attributes       sea_faring, hide_forest, can_withdraw, free_upkeep_unit, pike, garrison, free_upkeep_unit, no_custom
    formation        1.2, 1.2, 2.4, 2.4, 8, square, phalanx
    stat_health      1, 0
    stat_pri         9, 3, no, 0, 0, melee, melee_blade, piercing, spear, 25, 1
    ;stat_pri_ex      0, 0, 0
    stat_pri_attr    spear, long_pike, spear_bonus_8
    stat_sec         8, 2, 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, 0, flesh
    ;stat_armour_ex   0, 4, 5, 7, 1, 0, 0, flesh
    stat_sec_armour  0, 0, flesh
    stat_heat        2
    stat_ground      1, -2, 3, 2
    stat_mental      5, normal, highly_trained
    stat_charge_dist 40
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        1, 150, 0, 75, 60, 150, 4, 30
    armour_ug_levels 0, 1, 2, 3
    armour_ug_models Pike_Militia, Pike_Militia_ug1, Pike_Militia_ug2, Pike_Militia_ug3
    ownership        france, hre, spain, papal_states
    ;unit_info        7, 0, 1
    
    
    type             Dismounted Chivalric KnightsG
    dictionary       Dismounted_Chivalric_Knights      ; Dismounted Chivalric Knights
    category         infantry
    class            heavy
    voice_type       Heavy
    banner faction   main_infantry
    banner holy      crusade
    soldier          Dismounted_Chivalric_Knights, 60, 0, 1.2
    attributes       sea_faring, hide_forest, hardy, can_withdraw, garrison, free_upkeep_unit, no_custom
    formation        1.2, 1.2, 2.4, 2.4, 3, square
    stat_health      1, 0
    stat_pri         13, 3, no, 0, 0, melee, melee_blade, piercing, sword, 25, 1
    ;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  10, 5, 6, metal
    ;stat_armour_ex   8, 9, 0, 0, 8, 6, 6, metal
    stat_sec_armour  0, 0, flesh
    stat_heat        6
    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        2, 610, 0, 90, 70, 610, 4, 150
    armour_ug_levels 4, 5
    armour_ug_models Dismounted_Chivalric_Knights, Dismounted_Chivalric_Knights_ug1
    ownership        france, spain
    era 1            france, spain
    era 2            france
    info_pic_dir	 data\ui\unit_info\spain\Dismounted_Chivalric_Knights_info.tga
    ;unit_info        13, 0, 22

  3. #23
    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,132
    Blog Entries
    35

    Default Re: Creating a World - Instant garrisons and their disbandment

    Reading the garrison removal section again it appears I made a logic error, possibly because the faction (egypt) wasn't playable in 1648 if memory serves.

    If the garrison spawn is possible for player and AI alike then so must the removal of it. However: garrison spawns are not designed to be used for the player as they are solely a help for the AI. Which means the spawn section will need to have a 'not player' condition, the removal section does not require one but can remain as only the AI is supposed to get the spawn in the first place.

    Here is the correction (both monitors):
    Code:
        monitor_event GeneralAssaultsResidence TargetFactionType france
             and I_IsFactionAIControlled france        ; besieged faction is AI controlled
            and IsTargetRegionOneOf Normandie
    I will amend the code in the opening post accordingly.


    In your case I am assuming that the besieged faction was the player and hence the removal (for the AI only) did not take place.
    Last edited by Gigantus; March 11, 2022 at 11:06 PM.










  4. #24

    Default Re: Creating a World - Instant garrisons and their disbandment

    Hmm.

    I applied the new section of script as suggested above, but the units are still not destroyed at the end of turn. To be clear the script is being used for the AI which is France, and the player is England. So, the player (England) is attacking the AI (France) and after an unsuccessful siege the AI (France) garrison does not disband and reinforces the AI armies. Thank you for the help!

    Code:
        
        monitor_event GeneralAssaultsResidence TargetFactionType france
    	and I_IsFactionAIControlled france
            and IsTargetRegionOneOf Normandie
            and I_SettlementUnderSiege Caen

  5. #25
    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,132
    Blog Entries
    35

    Default Re: Creating a World - Instant garrisons and their disbandment

    Let's have a look a the triggers and counters:

    The siege counters get set to zero at the turn end of the next AI faction's turn, which will be france if england is the attacker and had no luck in the siege.

    The units get disbanded with that zero counter at the start of france's turn - which will be one turn later.

    An unfortunate co-incidence if the attacker is the faction just before the attacked, eg the disbanding will be delayed by one turn. In all other cases the disbanding will take place at the next turn of the attacked faction.
    Last edited by Gigantus; March 12, 2022 at 12:22 AM.










  6. #26

    Default Re: Creating a World - Instant garrisons and their disbandment

    Quote Originally Posted by Gigantus View Post
    An unfortunate co-incidence if the attacker is the faction just before the attacked, eg the disbanding will be delayed by one turn. In all other cases the disbanding will take place at the next turn of the attacked faction.
    Resolved! This was the issue. I just needed to test one more turn and the garrison units will be disbanded even if they reinforce an already existing army for the AI.

    Thank you for the help, much appreciated!

  7. #27
    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,132
    Blog Entries
    35

    Default Re: Creating a World - Instant garrisons and their disbandment











  8. #28

    Default Re: Creating a World - Instant garrisons and their disbandment

    Follow up question.

    Does the garrison script work for named forts too? Or only settlements?

  9. #29
    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,132
    Blog Entries
    35

    Default Re: Creating a World - Instant garrisons and their disbandment

    Forts do not have names, which means you can't spawn armies into them. Nor can you define them sufficiently in the first place.

    Short answer: no.










Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

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