Results 1 to 7 of 7

Thread: Garrison Script is not working

  1. #1

    Default Garrison Script is not working

    I tried to attack Mainz but the garrison did not appear there.

    Also I changed the script like this
    Spoiler Alert, click show to read: 
    monitor_event GeneralAssaultsResidence FactionIsLocal
    and TargetFactionType egypt
    and I_IsFactionAIControlled egypt
    and IsTargetRegionOneOf Erzbistum_Mainz
    and I_SettlementUnderSiege Mainz
    if I_TurnNumber < 50
    create_unit Mainz, Buergerwehr, num 4, exp 0, arm 0, wep 0
    create_unit Mainz, Grenadiere, num 1, exp 0, arm 0, wep 0
    create_unit Mainz, Musketiere, num 2, exp 0, arm 0, wep 0
    create_unit Mainz, Pikeniere, num 3, exp 0, arm 0, wep 0
    set_counter Mainz_siege 1
    end_if
    if I_TurnNumber > 49
    terminate_monitor
    end_if
    end_monitor

    Nothing happens.
    «Hunde, wollt ihr ewig leben?» Friedrich der Große, Schlacht von Kolin.

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

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

    Default Re: Garrison Script is not working

    If the attacking faction is 'local' then the defending faction will obviously AI controlled - no need for the condition.


    Did the script actually work? In other words - did the radar map restriction remain hidden? Any message in the log? In what turn did the attack happen, who was owner of Mainz?










  3. #3

    Icon1 Re: Garrison Script is not working

    1. Radar map working.
    2. Nothing interest in log.
    3. At start of game or later ~ 50-60th turns

    Reinstalled 1648 mod, but nothing happens with Garrison script.
    I'm using this script into my game as Pfalz:

    Spoiler Alert, click show to read: 
    declare_counter Mainz_siege


    monitor_conditions not I_SettlementUnderSiege Mainz
    set_counter Mainz_siege 0
    destroy_units egypt garnison
    end_monitor
    monitor_conditions I_SettlementUnderSiege Mainz
    and I_CompareCounter Mainz_siege = 0
    if I_SettlementOwner Mainz = egypt
    and I_FactionBesieging moors
    create_unit Mainz, MusketiereG, num 4, exp 0, arm 0, wep 0
    create_unit Mainz, PikeniereG, num 6, exp 0, arm 0, wep 0
    create_unit Mainz, BuergerwehrG, num 9, exp 0, arm 0, wep 0
    end_if
    set_counter Mainz_siege 1
    end_monitor


    But I have very strange thing with that script. If I try add Aschaffenburg_siege counter with monitor nothing happens with this city. Aschaffenburg's script work when I delete Mainz!

    For Catolic League I'm using this (for each city):
    Spoiler Alert, click show to read: 

    declare_counter Salzburg_siege

    monitor_conditions not I_SettlementUnderSiege Salzburg
    set_counter Salzburg_siege 0
    end_monitor
    monitor_conditions I_SettlementUnderSiege Salzburg
    and I_CompareCounter Salzburg_siege = 0
    if I_SettlementOwner Salzburg = milan
    and I_FactionBesieging moors
    create_unit Salzburg, Musketiere, num 2, exp 0, arm 0, wep 0
    create_unit Salzburg, Pikeniere, num 6, exp 0, arm 0, wep 0
    create_unit Salzburg, Buergerwehr, num 10, exp 0, arm 0, wep 0
    end_if
    set_counter Salzburg_siege 1
    end_monitor

    Unfortunatly Catolic League dont has garrison's units.
    Last edited by vonPeretz; February 12, 2020 at 05:27 AM.
    «Hunde, wollt ihr ewig leben?» Friedrich der Große, Schlacht von Kolin.

  4. #4

    Default Re: Garrison Script is not working

    Hi Gigantus,

    I played a Mainz campaign an when I was attacked by the AI, both Mainz and Aschaffenburg got garrison scripts and I had units appear in my army.
    I disbanded them after like 8 turns.

    Aschaffenburg got attacked again after a few more, turns and I got the garrison script again with units appearing in my army.

    However, when I attacked Frankfurt, belonging to the the Protestant Union, they did not (if I recall well) get a garrison script.

    > I thought the garrison script worked only for the AI
    > Why didn't Frankfurt, a capital city, get the Garrison Script?
    > What are the Garrison Script rules and requirements?

    Finally, the game is 12 turns per year, right? How do we know in which month we are?
    Because my game started in winter and on turn 11, the year changed to 1619 but only on the faction information window.
    On the Campaign UI however, the date remained 1618 AD until after turn 14 or 15.

    Is this a normal?

    Thanks and I appreciate your time.

    Cheers,

    DBW.
    Frei zu sein, bedarf ist wenig, nur wer frei ist, ist ein König.

    Current Hotseat:
    Britannia: The Isles of Chaos

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

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

    Default Re: Garrison Script is not working

    Yes the garrison script is only supposed to work for the AI and the units that got created (only in the attacked settlement) should be automatically disbanded once the faction is not under siege anywhere anymore.

    There is a glitch in the UI display of the year when using the 12 turn per year script. It should however reset itself later. The game mechanism is such that the new year (aging of characters) happens after the winter turn.










  6. #6

    Default Re: Garrison Script is not working

    Quote Originally Posted by Gigantus View Post
    Yes the garrison script is only supposed to work for the AI and the units that got created (only in the attacked settlement) should be automatically disbanded once the faction is not under siege anywhere anymore.

    There is a glitch in the UI display of the year when using the 12 turn per year script. It should however reset itself later. The game mechanism is such that the new year (aging of characters) happens after the winter turn.
    Thanks Gigantus.

    Well I, not the AI got the Garrison script in both Mainz and Aschaffenburg.
    And the troops did not disband in the next few turns and I had to disband them myself.

    What do you think, is there is a bug/problem?
    Frei zu sein, bedarf ist wenig, nur wer frei ist, ist ein König.

    Current Hotseat:
    Britannia: The Isles of Chaos

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

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

    Default Re: Garrison Script is not working

    While I can't seem to find the cause I suspect a logic error somewhere in the script, eg one of the conditions doesn't do what it's supposed to do or invalidates another condition.










Posting Permissions

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