Results 1 to 8 of 8

Thread: IsSettlementGarrisoned

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Burebista's Avatar Electro Artifacts AP
    Join Date
    Oct 2004
    Location
    East
    Posts
    1,401

    Icon1 IsSettlementGarrisoned

    monitor_event IncomingMessage I_WonBattle
    and not IsSettlementGarrisoned Jerusalem
    console_command create_unit Jerusalem "Mercenary Spearmen" 1
    console_command create_unit Jerusalem "Free Company Men at Arms" 3
    end_monitor

    Hi there,

    I'm trying to make a script to avoid having the city empty for AI after unwanted sallyout - can anyone help me better define IsSettlementGarrisoned ?-it does not seem to work.

    Thanks
    Modding Arts Inc.

    SS City Reinforcement Script - (*SS 6.2 any mod comptible)

  2. #2
    Swagger's Avatar Imperial Coffee-Runner
    Join Date
    Apr 2007
    Location
    Portugal
    Posts
    12,453

    Default Re: IsSettlementGarrisoned

    try this:

    monitor_event IncomingMessage I_WonBattle
    and not IsSettlementGarrisoned
    and SettlementName Jerusalem
    console_command create_unit Jerusalem "Mercenary Spearmen" 1
    console_command create_unit Jerusalem "Free Company Men at Arms" 3
    end_monitor
    Under the Patronage of the Dreadful cedric37!
    Ancs Guide, Emergent Factions , Yes/No Events |L'Outremer for Modders| Swagger's Skymod


  3. #3
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: IsSettlementGarrisoned

    Of course it won't work in that monitor, the condition IsSettlementGarrisoned has the requirement of the event exporting settlement, which the event IncomingMessage does not export, so it will not work.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  4. #4
    Burebista's Avatar Electro Artifacts AP
    Join Date
    Oct 2004
    Location
    East
    Posts
    1,401

    Default Re: IsSettlementGarrisoned

    declare_counter nowc 0

    monitor_event UngarrisonedSettlement SettlementName Gaza
    set_counter nowc 1
    end_monitor

    monitor_event IsSettlementGarrisoned SettlementName Jerusalem
    if I_CompareCounter nowc >= 1
    console_command create_unit Jerusalem "Mercenary Spearmen" 1
    console_command create_unit Jerusalem "Free Company Men at Arms" 3
    end_monitor

    Then this should work but it does not - I'm lost trying in the last 48h all possible combinations.

    an interesting note is that the blow works fine if you want to make troops in AI cities but it does not trigger when the AI is wiped out when they sallyout

    monitor_event UngarrisonedSettlement SettlementName Gaza
    if I_CompareCounter nowc >= 1
    console_command create_unit Jerusalem "Mercenary Spearmen" 1
    console_command create_unit Jerusalem "Free Company Men at Arms" 3
    end_monitor

    many thanks guys
    Modding Arts Inc.

    SS City Reinforcement Script - (*SS 6.2 any mod comptible)

  5. #5
    Burebista's Avatar Electro Artifacts AP
    Join Date
    Oct 2004
    Location
    East
    Posts
    1,401

    Default Re: IsSettlementGarrisoned

    also this does not work and it should

    declare_counter nowc 0

    monitor_event UngarrisonedSettlement SettlementName Gaza
    set_counter nowc 1
    end_monitor

    monitor_conditions IsSettlementGarrisoned SettlementName Jerusalem
    if I_CompareCounter nowc >= 1
    console_command create_unit Jerusalem "Mercenary Spearmen" 1
    console_command create_unit Jerusalem "Free Company Men at Arms" 3
    end_monitor

    I think some old conditions are no longer valid.
    Last edited by Burebista; December 04, 2009 at 01:10 AM.
    Modding Arts Inc.

    SS City Reinforcement Script - (*SS 6.2 any mod comptible)

  6. #6
    Burebista's Avatar Electro Artifacts AP
    Join Date
    Oct 2004
    Location
    East
    Posts
    1,401

    Default Re: IsSettlementGarrisoned

    THIS WORKS, THIS WORKS! let me see if it would apply in an AI sallyout

    declare_counter nowc 0

    monitor_event UngarrisonedSettlement SettlementName Gaza
    set_counter nowc 1
    end_monitor

    monitor_event IncomingMessage I_WonBattle
    if I_CompareCounter nowc >= 1
    console_command create_unit Gaza "Mercenary Spearmen" 1
    console_command create_unit Gaza "Free Company Men at Arms" 3
    end_if
    end_monitor
    Modding Arts Inc.

    SS City Reinforcement Script - (*SS 6.2 any mod comptible)

  7. #7
    Burebista's Avatar Electro Artifacts AP
    Join Date
    Oct 2004
    Location
    East
    Posts
    1,401

    Default Re: IsSettlementGarrisoned

    even if it is listed as monitor condition is still not works

    Anyway I kept working on the block solution for AI unwanted sallyout and human exploit and it now works in totally acceptable terms - more than 48 hours of work (vacantion) the testing was a pain.

    ;==================== eaBurebista's AI SallyOut Empty City Reinforcement ====================

    declare_counter nowc 0

    monitor_event UngarrisonedSettlement SettlementName Jerusalem
    and not FactionIsLocal
    set_counter nowc 1
    end_monitor

    monitor_event PostBattle I_WonBattle
    if I_CompareCounter nowc = 1
    console_command create_unit Jerusalem "Mercenary Spearmen" 1
    console_command create_unit Jerusalem "Free Company Men at Arms" 3
    end_if
    set_counter nowc 0
    end_monitor

    monitor_event FactionTurnEnd FactionIsLocal
    set_counter nowc 0
    end_monitor

    ;===============================================================================

    Last edited by Burebista; December 04, 2009 at 04:46 AM.
    Modding Arts Inc.

    SS City Reinforcement Script - (*SS 6.2 any mod comptible)

  8. #8
    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: IsSettlementGarrisoned

    I think the problem was that IsSettlementGarrisoned is a condition and not an event.
    UngarrisonedSettlement is an event, that's why it works.










Posting Permissions

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