Results 1 to 20 of 21

Thread: Question about Garrison Script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    pilatus's Avatar Civis
    Join Date
    Aug 2006
    Location
    Germany, Munich
    Posts
    156

    Default Question about Garrison Script

    i've done a garrison script for all important and capital citys for factions and important free civ citys in rsII 2.1
    but it ctd in campaign when the egypt besieges petra and there are already too many units >20 placed in the city
    is there a command which can provide that the ai places too many units or something else??

    this is the code for the petra garrison script against egypt
    HTML Code:
    monitor_event SettlementTurnEnd SettlementName Petra
       and not SettlementIsLocal
       and I_CharacterTypeNearTile egypt general, 2 339, 48
          if I_SettlementOwner Petra = slave
          and I_FactionBesieged slave
             console_command create_unit Petra "nabatean horse archer" 1 2 1 1
             console_command create_unit Petra "thorakitai arabes" 2 2 0 0
             console_command create_unit Petra "nabatean archer" 1 2 1 0
             console_command create_unit Petra "eastern skirmisher" 2 2 1 1
           end_if
    end_monitor
    monitor_event SettlementTurnEnd SettlementName Petra
       and not SettlementIsLocal
       and I_CharacterTypeNearTile egypt family, 2 339, 48
          if I_SettlementOwner Petra = slave
          and I_FactionBesieged slave
             console_command create_unit Petra "nabatean horse archer" 1 2 1 1
             console_command create_unit Petra "thorakitai arabes" 2 2 0 0
             console_command create_unit Petra "nabatean archer" 1 2 1 0
             console_command create_unit Petra "eastern skirmisher" 2 2 1 1
           end_if
    end_monitor
    thank you in advance!
    Last edited by pilatus; August 15, 2011 at 03:00 PM.

  2. #2
    pilatus's Avatar Civis
    Join Date
    Aug 2006
    Location
    Germany, Munich
    Posts
    156

    Default Re: Question about Garrison Script

    if people are interested i will post the final script in the submod section
    but before that.. my little problem has to be solved

  3. #3

    Default Re: Question about Garrison Script

    Take your problem to the mod workshop im sure they can sort you out there...

  4. #4
    pilatus's Avatar Civis
    Join Date
    Aug 2006
    Location
    Germany, Munich
    Posts
    156

    Icon5 Re: Question about Garrison Script

    @Nakharar: can i port the thread by myself tp the mod workshop ??

    just one additional question:
    i guess the placement outside the city will solve the problem
    BUT what will happen if there is already a army on the place i want to spawn the army ? ctd?

    HTML Code:
    ;;;new;;;
     
    monitor_event SettlementTurnEnd SettlementName Palmyra
       and not SettlementIsLocal
       and I_CharacterTypeNearTile armenia general, 2 364, 89
          if I_SettlementOwner Palmyra = slave
          and I_FactionBesieged slave
     console_command kill_character "Nidintu-Bel"
     spawn_army
            faction slave
             character Nidintu-Bel, general, age 32, x 365, y 89
      unit  palmyran cataphract    exp 2 armour 2 weapon_lvl 1
      unit  palmyran phalangites    exp 2 armour 2 weapon_lvl 1
      unit  palmyran phalangites    exp 2 armour 2 weapon_lvl 1
      unit  persian sparabara    exp 2 armour 2 weapon_lvl 1
      unit  persian sparabara    exp 2 armour 2 weapon_lvl 1
      unit  eastern skirmisher    exp 2 armour 2 weapon_lvl 1
      unit  eastern skirmisher    exp 2 armour 2 weapon_lvl 1
      unit  babylon horse archer    exp 2 armour 2 weapon_lvl 1
      unit  babylon horse archer    exp 2 armour 2 weapon_lvl 1
     end_if
    end_monitor
     
    monitor_event SettlementTurnEnd SettlementName Palmyra
       and not SettlementIsLocal
       and I_CharacterTypeNearTile armenia family, 2 364, 89
          if I_SettlementOwner Palmyra = slave
          and I_FactionBesieged slave
     console_command kill_character "Nidintu-Bel"
     spawn_army
            faction slave
             character Nidintu-Bel, general, age 32, x 365, y 89
      unit  palmyran cataphract    exp 2 armour 2 weapon_lvl 1
      unit  palmyran phalangites    exp 2 armour 2 weapon_lvl 1
      unit  palmyran phalangites    exp 2 armour 2 weapon_lvl 1
      unit  persian sparabara    exp 2 armour 2 weapon_lvl 1
      unit  persian sparabara    exp 2 armour 2 weapon_lvl 1
      unit  eastern skirmisher    exp 2 armour 2 weapon_lvl 1
      unit  eastern skirmisher    exp 2 armour 2 weapon_lvl 1
      unit  babylon horse archer    exp 2 armour 2 weapon_lvl 1
      unit  babylon horse archer    exp 2 armour 2 weapon_lvl 1
     end_if
    end_monitor

  5. #5
    Primo's Avatar Protector Domesticus
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    4,007

    Default Re: Question about Garrison Script

    Quote Originally Posted by pilatus View Post

    just one additional question:
    i guess the placement outside the city will solve the problem
    BUT what will happen if there is already a army on the place i want to spawn the army ? ctd?
    It will be spawned over the other, like the army already there is under a trapdoor and your new army stays on it - it canīt do anything, and canīt be attacked, either. But no ctd.

    HTML Code:
    ;;;new;;;
     
    monitor_event SettlementTurnEnd SettlementName Palmyra
       and not SettlementIsLocal
       and I_CharacterTypeNearTile armenia general, 2 364, 89
          if I_SettlementOwner Palmyra = slave
          and I_FactionBesieged slave
     console_command kill_character "Nidintu-Bel"
     spawn_army
            faction slave
              character Nidintu-Bel, general, age 32, x 365, y 89
      unit  palmyran cataphract    exp 2 armour 2 weapon_lvl 1
      unit  palmyran phalangites    exp 2 armour 2 weapon_lvl 1
      unit  palmyran phalangites    exp 2 armour 2 weapon_lvl 1
      unit  persian sparabara    exp 2 armour 2 weapon_lvl 1
      unit  persian sparabara    exp 2 armour 2 weapon_lvl 1
      unit  eastern skirmisher    exp 2 armour 2 weapon_lvl 1
      unit  eastern skirmisher    exp 2 armour 2 weapon_lvl 1
      unit  babylon horse archer    exp 2 armour 2 weapon_lvl 1
      unit  babylon horse archer    exp 2 armour 2 weapon_lvl 1
     end_if
    end_monitor
     
    monitor_event SettlementTurnEnd SettlementName Palmyra
       and not SettlementIsLocal
       and I_CharacterTypeNearTile armenia family, 2 364, 89
          if I_SettlementOwner Palmyra = slave
          and I_FactionBesieged slave
     console_command kill_character "Nidintu-Bel"
     spawn_army
            faction slave
             character Nidintu-Bel, general, age 32, x 365, y 89
      unit  palmyran cataphract    exp 2 armour 2 weapon_lvl 1
      unit  palmyran phalangites    exp 2 armour 2 weapon_lvl 1
      unit  palmyran phalangites    exp 2 armour 2 weapon_lvl 1
      unit  persian sparabara    exp 2 armour 2 weapon_lvl 1
      unit  persian sparabara    exp 2 armour 2 weapon_lvl 1
      unit  eastern skirmisher    exp 2 armour 2 weapon_lvl 1
      unit  eastern skirmisher    exp 2 armour 2 weapon_lvl 1
      unit  babylon horse archer    exp 2 armour 2 weapon_lvl 1
      unit  babylon horse archer    exp 2 armour 2 weapon_lvl 1
     end_if
    end_monitor
    Change to:
    Code:
             character Nidintu-Bel, general, age 32, , x 365, y 89
    At least I think it will work then.

  6. #6
    TheRomanRuler's Avatar Campidoctor
    Join Date
    Dec 2010
    Location
    Finland
    Posts
    1,965

    Default Re: Question about Garrison Script

    Quote Originally Posted by Nakharar View Post
    Take your problem to the mod workshop im sure they can sort you out there...
    Apologies for anyone who's message i may miss or not be able to answer

  7. #7
    Brusilov's Avatar Local Moderator
    Citizen

    Join Date
    Sep 2005
    Location
    Dublin, ROI
    Posts
    18,588

    Default Re: Question about Garrison Script

    I've moved the thread from the RSII forum to the Rome Workshop 'text editing and scripting' sub-fourm.

    Local Forum Moderator (Total War: Eras Technical Help, Shogun 2: Total War, RSII, RTR, World Of Tanks) - please no PMs

    War Thunder TWC Player Names: here


  8. #8
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: Question about Garrison Script

    You can access the new army from the armies scroll, even if it spawns on top of another army.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  9. #9
    Primo's Avatar Protector Domesticus
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    4,007

    Default Re: Question about Garrison Script

    Quote Originally Posted by HouseOfHam View Post
    You can access the new army from the armies scroll, even if it spawns on top of another army.
    Yes, but can it actually do anything?

  10. #10
    pilatus's Avatar Civis
    Join Date
    Aug 2006
    Location
    Germany, Munich
    Posts
    156

    Default Re: Question about Garrison Script

    Thank you all!

    Quote Originally Posted by HouseOfHam View Post
    You can access the new army from the armies scroll, even if it spawns on top of another army.
    This means that if the ai army (x faction) besieges a city and there will be a spawned ai army (y faction) on the same place and there will be no ctd ?? what happens with the army (faction x) ? The new spawned army (y faction) can attack the other without problems?

    Change to:

    Code:
    character Nidintu-Bel, general, age 32, , x 365, y 89
    At least I think it will work then.
    Are you sure? i have to test but i think it works with one semicolon, too...

  11. #11
    Primo's Avatar Protector Domesticus
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    4,007

    Default Re: Question about Garrison Script

    Quote Originally Posted by pilatus View Post
    Thank you all!



    This means that if the ai army (x faction) besieges a city and there will be a spawned ai army (y faction) on the same place and there will be no ctd ?? what happens with the army (faction x) ? The new spawned army (y faction) can attack the other without problems?
    I tested it and House of Ham was right - the player can access the army, and it works like normal, and can even attack the other one. For the ai there is absolutely no difference.
    Quote Originally Posted by pilatus View Post
    Are you sure? i have to test but i think it works with one semicolon, too...
    Its not about the second comma (not semicolon), it is about the Space between them. It is always made that way, even in descr_strat. No one really knows why it is there - but I guess it is the rest of the non-implented feature supply.
    Last edited by Primo; August 17, 2011 at 04:33 AM.

  12. #12
    pilatus's Avatar Civis
    Join Date
    Aug 2006
    Location
    Germany, Munich
    Posts
    156

    Default Re: Question about Garrison Script

    I recently read in the scripting tutorial forum that if i want to spawn an army for the slave faction it will ctd ... ??
    Will that mean that my script will not work..because i want to "spawn" armys for slave faction owned cities... i tested it with the "console_command create_unit" and it worked...

  13. #13
    Primo's Avatar Protector Domesticus
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    4,007

    Default Re: Question about Garrison Script

    Quote Originally Posted by pilatus View Post
    I recently read in the scripting tutorial forum that if i want to spawn an army for the slave faction it will ctd ... ??
    Will that mean that my script will not work..because i want to "spawn" armys for slave faction owned cities... i tested it with the "console_command create_unit" and it worked...
    Iīm not sure what you have read but this is not true. Iīve successfully spawned Spartacus for slaves once, and there was no ctd.

  14. #14
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: Question about Garrison Script

    yes
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  15. #15
    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: Question about Garrison Script

    Have you run your script through my script editor, see the link in my sig?
    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

  16. #16

    Default Re: Question about Garrison Script

    One question: aren't the two conditions

    if I_SettlementOwner Palmyra = slave
    and I_FactionBesieged slave

    the same thing? I mean, it says the same thing twice, of course the faction besieged is the same as the owner!


  17. #17
    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: Question about Garrison Script

    Quote Originally Posted by Spartan 666 View Post
    One question: aren't the two conditions

    if I_SettlementOwner Palmyra = slave
    and I_FactionBesieged slave

    the same thing? I mean, it says the same thing twice, of course the faction besieged is the same as the owner!
    Not necessarily, in fact those conditions don't mean that Palmyra is slave owned and besiged. As long as any slave owned settlement is besiged the second condition will be true, even if it isn't Palmyra.
    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

  18. #18

    Default Re: Question about Garrison Script

    You're absolutely right! Fool me...


Posting Permissions

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