Results 1 to 9 of 9

Thread: tipe of...garrison script for sieges

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    HELLEKIN's Avatar Miles
    Join Date
    Nov 2007
    Location
    LISBON - PORTUGAL
    Posts
    396

    Default tipe of...garrison script for sieges

    hello guys,i was thinking how to make something like this...every time a town or castle of a certain faction is under siege a garrison of 2 units of archers will be automaticaly added has a garrison reinforcement(exemple...people from town or castle that take up arms to defend their homes).i know itīs a script stuff....but iīm 0 in scripting can someone help...or is this possible?Itīs for vanilla game,many thanks in advance and happy new year to all
    Homo Homini Lupus

  2. #2
    Moon's Avatar Centenarius
    Join Date
    Oct 2008
    Location
    The dark side
    Posts
    878

    Default Re: tipe of...garrison script for sieges


  3. #3
    AJStoner's Avatar Lord of Entropy
    Join Date
    Dec 2010
    Location
    Currently exiled to Florida
    Posts
    1,746

    Default Re: tipe of...garrison script for sieges

    I use a similar system in my mod. Here is an example of one settlement's Garrison Script. The "Townfolk" and "Townfolk Archers" are special peasant units only generated through this script in my mod. I like this script set up because it's low mass.

    Script Example:

    ;##################### Siege Levy Script #####################

    declare_counter Kirkwall_siege

    ;;;;;; Kirkwall ;;;;;;;;;;
    monitor_event CharacterTurnEndInSettlement not IsUnderSiege IsGovernor
    and SettlementName Kirkwall
    set_counter Kirkwall_siege 0
    end_monitor
    monitor_event CharacterTurnEndInSettlement IsUnderSiege IsGovernor
    and SettlementName Kirkwall
    and SettlementLoyaltyLevel > loyalty_disillusioned
    and I_CompareCounter Kirkwall_siege = 0
    and SettlementBuildingExists = wooden_pallisade
    create_unit Kirkwall, Townfolk, num 2, exp 0, arm 0, wep 0
    set_counter Kirkwall_siege 1
    end_monitor
    monitor_event CharacterTurnEndInSettlement IsUnderSiege IsGovernor
    and SettlementName Kirkwall
    and SettlementLoyaltyLevel > loyalty_disillusioned
    and I_CompareCounter Kirkwall_siege = 0
    and SettlementBuildingExists = wooden_wall
    create_unit Kirkwall, Townfolk, num 3, exp 0, arm 0, wep 0
    create_unit Kirkwall, Townfolk Archers, num 1, exp 0, arm 0, wep 0
    set_counter Kirkwall_siege 1
    end_monitor
    monitor_event CharacterTurnEndInSettlement IsUnderSiege IsGovernor
    and SettlementName Kirkwall
    and SettlementLoyaltyLevel > loyalty_disillusioned
    and I_CompareCounter Kirkwall_siege = 0
    and SettlementBuildingExists = stone_wall
    create_unit Kirkwall, Townfolk, num 4, exp 0, arm 0, wep 0
    create_unit Kirkwall, Townfolk Archers, num 2, exp 0, arm 0, wep 0
    set_counter Kirkwall_siege 1
    end_monitor
    monitor_event CharacterTurnEndInSettlement IsUnderSiege IsGovernor
    and SettlementName Kirkwall
    and SettlementLoyaltyLevel > loyalty_disillusioned
    and I_CompareCounter Kirkwall_siege = 0
    and SettlementBuildingExists = large_stone_wall
    create_unit Kirkwall, Townfolk, num 6, exp 0, arm 1, wep 0
    create_unit Kirkwall, Townfolk Archers, num 2, exp 1, arm 0, wep 0
    set_counter Kirkwall_siege 1
    end_monitor
    monitor_event CharacterTurnEndInSettlement IsUnderSiege IsGovernor
    and SettlementName Kirkwall
    and SettlementLoyaltyLevel > loyalty_disillusioned
    and I_CompareCounter Kirkwall_siege = 0
    and SettlementBuildingExists = huge_stone_wall
    create_unit Kirkwall, Townfolk, num 6, exp 1, arm 0, wep 0
    create_unit Kirkwall, Townfolk Archers, num 4, exp 2, arm 0, wep 0
    set_counter Kirkwall_siege 1
    end_monitor
    ;;;;;;;;;;;;;;;;;;;;;

    *MEMBER OF THE HOUSE OF HADER* *UNDER THE CRUEL & MERCILESS PATRONAGE OF y2day*

  4. #4
    HELLEKIN's Avatar Miles
    Join Date
    Nov 2007
    Location
    LISBON - PORTUGAL
    Posts
    396

    Default Re: tipe of...garrison script for sieges

    Thanks to all " another case solved..." many thanks for once more help
    Homo Homini Lupus

  5. #5
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: tipe of...garrison script for sieges

    Little tip: using custom attributes for garrison units allows you to disband them after a siege, else you might end up just giving the AI additional troops for free.










  6. #6
    HELLEKIN's Avatar Miles
    Join Date
    Nov 2007
    Location
    LISBON - PORTUGAL
    Posts
    396

    Default Re: tipe of...garrison script for sieges

    hi Gigantus,how can i do that?Script? scripts persue me ,but its the better way isnīt it?
    Homo Homini Lupus

  7. #7
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: tipe of...garrison script for sieges

    You will have to create a monitor to check if the settlement is NOT under siege, basically the reverse of the condition in the script example by AJStoner.
    Add to it the use of the 'destroy_unit' command:

    destroy_unit [faction_name] [custom_attribute]

    In the EDU you add that custom attribute to the special garison unit, eg 'Townfolk Archers' like in the example.










  8. #8
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: tipe of...garrison script for sieges

    Beware that destroy_unit kills all units of that type/attribute in the whole faction. If two settlements were under siege and they both had these temporary garrisons then, when the first siege ends, you will also be killing the other settlement's garrison.

  9. #9
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: tipe of...garrison script for sieges

    Sorry, forgot about that - it requires a test if a settlement of that faction is under siege. Due to the required scripting you might want to apply it only for a few selected settlement. Check in the 1648 script for ;=== Garnisons Skript ===










Posting Permissions

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