Results 1 to 16 of 16

Thread: Garrison Script Explained

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Garrison Script Explained

    I have recently returned to modding and re-downloaded this mod. Such a great mod!. But i wanted to explain to the community exactly how the garrison script works. In its current state it is not living up to its potential. The script i wrote can do so much more and i would like to explain how you can achieve it. I have not given any examples, but i could if asked.

    You will likely require some scripting knowledge to under stand this.

    Currently there is not much chance of variety in the spawns. The same units spawn every time and only the number of them vary. With the current script it is possible for as many as 21 units to spawn and as many as 3 trolls (20% chance for that!) - 21 units is impossible as an army can only hold 20. but the script will attempt to spawn 21. Thats a little excessive in my opinion. It means 20% of the time you attack that settlement there will be a full army of 20!

    Spoiler Alert, click show to read: 

    Code:
    declare_counter UExp
    declare_counter UWepArm
    declare_counter PT
    These are used later in the script and i will explain them at that point. Basically they control the variety and number of units that can spawn.

    Code:
    ;Unique Counters per Settlement
    declare_counter Belfalas_Siege
    declare_counter Anorien_Siege
    ...
    These counters will determine if a settlement is under siege or not. If set to 1 or higher they are being or have been sieged recently. Any time you declare a counter it is set to 0. You will note that in that list some settlements are missing. KK selected the settlements he felt required assistance.

    Code:
    declare_counter Belfalas_Defense
    declare_counter Anorien_Defense
    declare_counter Bree_Defense
    ...
    These counters will determine a settlements defense level. 11, 12, 21 or 22. It is better explained later on.

    Code:
    declare_counter Belfalas_Local
    declare_counter Anorien_Local
    declare_counter Bree_Local
    ...
    These counters determine whether the settlement is player owned or AI owned. This garrison script spawns units for both AI vs AI and Player vs AI, but uses a somewhat different system for both. These counters help determine how to spawn the units.

    Code:
    monitor_event FactionTurnStart FactionIsLocal
    and I_TurnNumber < 1
     set_counter UExp 1
     set_counter UWepArm 1
    terminate_monitor
    end_monitor
    This is the first monitor of the script and merely sets the Exp and Armor levels of units for the first turn (i originally wrote the script to include experience and armor upgrades).

    Code:
     
    monitor_event SettlementTurnStart SettlementIsLocal
     and SettlementName Belfalas
     set_counter Belfalas_Local 1
    end_monitor
     
    repeated for each settlement AND,
     
    monitor_event SettlementTurnEnd SettlementIsLocal
     and SettlementName Belfalas
     set_counter Belfalas_Local 1
    end_monitor
    These monitors, one for each settlement, check if the settlement is the players on his/her turn start and turn end, if so, set the counter to 1.

    Code:
     
    monitor_event SettlementTurnStart not SettlementIsLocal
     and SettlementName Belfalas
     set_counter Belfalas_Local 0
    end_monitor
     
    repeated for each settlement ANS,
     
    monitor_event SettlementTurnEnd not SettlementIsLocal
     and SettlementName Belfalas
     set_counter Belfalas_Local 0
    end_monitor
    These monitors do the same except on the AI's turn and checks if it is belonged to the AI. NOTE: A settlement could in fact change control multiple times during a turn. You may own it on your turn, but faction2 may take it from you on his and faction3 may take it from them on his turn. These monitors merely ensure that who ever owns it on THIS current turn is the one who owns it. The counters are updated at the start and the end of every factions turn!

    Code:
    monitor_event PreFactionTurnStart FactionIsLocal
    inc_counter Belfalas_Siege -1
    inc_counter Anorien_Siege -1
    ...
    inc_counter Westfold_Siege -1
     set_counter PT 0
    end_monitor
    This monitor decreases the siege counter every turn by 1. When a settlement is besieged and the script spawns units it sets the siege counter to 10. Units will only spawn if the siege counter is below 0. Meaning units can only spawn once ever 10 turns for this settlment.
    This monitor also sets PT to 0. (PT means nothing, i simply couldnt think of a word to describe what it does at the time). PT is the counter that determines the number of times to 'repeat' the spawn. I explain it later...

    Code:
     
    monitor_event PreFactionTurnStart FactionIsLocal
     generate_random_counter random_exp 1 2
      if I_EventCounter random_exp = 1
      set_counter UExp 1
      end_if
      if I_EventCounter random_exp = 2
      set_counter UExp 2
      end_if
    end_monitor
    monitor_event PreFactionTurnStart FactionIsLocal
     generate_random_counter random_armwep 1 2
      if I_EventCounter random_armwep = 1
      set_counter UWepArm 1
      end_if
      if I_EventCounter random_armwep = 2
      set_counter UWepArm 2
      end_if
    end_monitor
    These 2 monitors set the random 'variety' you can expect to see in spawns.
    generate_random_counter random_exp 1 2
    this command generates a random counter (you name it what u want, i named it random_exp and random_armwep as it randomly gives a value to the UExp and UWepArm counters). the values 1 2 is what is being randomized. Its either a 1 or a 2. You could set it to 1 10 and the value will be a random number between 1 and 10. For purposes of this script we only require a 1 or a 2.

    Code:
    monitor_event FactionTurnStart FactionIsLocal
     if I_CompareCounter UExp = 1
      and I_CompareCounter UWepArm = 1
    set_counter Belfalas_Defense 11
    set_counter Anorien_Defense 11
    ...
    This monitor and its IF statements take the random variety counters and determine a settlements defense level for the turn. Every turn the defense level is ranomized in this way. Hence the defence levels of 11, 12, 21 and 22. When i wrote this script for Stainless steel each settlement had 1-6 (11, 12, 13, 14, 15, 16, 21, 22, 23... etc up to 66) for an extremely wide variety of spawns. These defense values are better explained further down.

    Code:
    ;For Player vs AI
    monitor_event ScrollOpened ScrollOpened siege_scroll  
     generate_random_counter random_variety 1 100
     
      if I_EventCounter random_variety < 6
      set_counter PT 0
      end_if
    ...
    This monitor is for when the player sieges and AI faction. It ultimately sets the PT counter. Which i explained earlier is the counter that determines how many times to repeat the spawn. Which will make more sense later.

    Code:
    ;For AI vs AI
    monitor_event PreFactionTurnStart not FactionIsLocal  
     generate_random_counter random_variety_AI 1 100
     
      if I_EventCounter random_variety_AI < 1
      set_counter PT 0
      end_if 
    ...
    Same as above but this is for the AI vs AI sieges.

    Now we get into the beef of the script. This is where it all comes together and our garrison script comes to life. All done in just a few monitors. I will explain this line by line.

    This is the first monitor:

    monitor_event ButtonPressed ButtonPressed siege_maintain_button
    This part of the script will only fire when the player selects to maintain the siege. Assualting the walls immidiatly will result in fewer spawns. It simulates the local settlement able to muster up the locals to help defend.

    if I_SettlementUnderSiege Anorien
    This checks which settlement is in question. There is an IF statement for each settlement.

    and I_SettlementOwner Anorien = sicily
    This condition ensures that the settlement in question is controlled by the correct faction (else you can end up with silver surfers being spawned if the faction doesnt have access to the units). IF a unit is available to EVERY faction, you dont need to declare this.

    and I_CompareCounter Anorien_Siege < 1
    As stated before, the siege counter will allow/stop a spawn. Only if the counter is below 1 (0 or below) will the spawn occur. Once the spawn occurs it is set to 10 and slowly decreases 1 per turn. It takes turns (2 and a half yrs for 4tpy) for a settlment to again muster the locals into a garrison force.

    and I_CompareCounter Anorien_Local = 0
    This counter ensures that the settlement is not the players.

    Code:
    while I_CompareCounter PT < 1
    The rest of this IF statement is enclosed in a WHILE statement. While the PT counter is less then 1 it will continue to spawn units. The rest of this IF statment also contains additional IF statements inside it. You can write IF statements inside IF statements. As long as u keep track of it.

    if I_CompareCounter Anorien_Defense = 11
    create_unit Anorien, Gondor Spearmen, num 1, exp 0, arm 0, wep 0
    create_unit Anorien, Gondor Archers, num 1, exp 0, arm 0, wep 0
    create_unit Anorien, Gondor Trebuchet, num 1, exp 0, arm 0, wep 0
    create_unit Anorien, Gondor Infantry, num 1, exp 0, arm 0, wep 0
    create_unit Anorien, Dismounted Kofm, num 1, exp 0, arm 0, wep 0
    inc_counter PT 1
    set_counter Anorien_Siege 10
    end_if
    There is an if statement like this for each of the defense counters we set earlier. 11, 12, 21 and 22. This is suppose to be the variety of the units. But if you look at the script, you will notice they are all the same for each settlement and each defense level. So its pointless. Either remove a unit from each level and add numbers or experience etc to create the variety it is suppose to.

    11 - is suppose to spawn the least resistance. So i would recommend just one unit with no experience.
    12 - is suppose to be adequate defense. I would recommend 2 units with no experience.
    21 - is suppose to be moderate. I would recommend 3 units with no experience.
    22 - is suppose to be elite. I would recommend 3 units WITH some experience.

    Keep in mind you also have the PT while statement, which doubles, even triples the units spawned. So the above example could likely spawn 15 units! If you use my recommendations you get a variety to the units that spawn. They arnt alwys the same. (you could get from 1 unit with no exp up to 12 units with some exp) If you look at my garrison script for Stainless Steel (my sig) you would notice that i have included DATES into the script. Actual events. That determine roughly at what year certain units and thier equipment (such as gothic armor) become available and then spawns them in the script based on those values. That way you dont get a late era unit spawning on turn 3 for example.

    In this part of the script we also increase the PT counter by one. Up until it equals one which is when the spawn stops. We also set the siege counter to 10 for this settlement. No spawns can occur for atleast 10 turns. This could be changed to 20, or 30 or 40 or whatever. 40 would represent 10 yrs in TATW at 4tpy.

    The next monitor:
    monitor_event ButtonPressed ButtonPressed siege_assault_button
    Is exactly the same as the above one, except it fires when you select siege and assault the settlement. You will note, the only difference here is what the siege counter is set to, its half that if you maintined the siege. This is to represent the town being able to respawn again in a short time. Ideally, this monitor should spawn LESS units then if you maintained the siege, so once again, the 'variety' i spoke of should be re evaluated.

    The final monitor spawns units for AI vs AI. It does not take into consideration a faction maintaining the siege or assaulting. If an AI faction assaults immediatly, then no units will spawn for the AI faction. Hence in the script there are 2 open areas to complete, siege units 3 and 4.


    I hope that helps people understand how the script works and what it is suppose to do. I have been planning on updating the script to give a much better variety across the board. Which in my opinion, would increase the playability. Its nice to know the AI is a challenge, but its annoying if you know that 20 units are going to spawn and then come after you every 10 turns, yes?
    ...longbows, in skilled hands, could reach further than trebuchets...

  2. #2
    Hero of the West's Avatar Artifex
    Join Date
    Jan 2010
    Location
    The Netherlands
    Posts
    1,640

    Default Re: Garrison Script Explained

    balancement from both the money and garisson script could be redone better.. it's not right how the ai gets masses of units only to go bankrupt get the moneyscript.. receive money and buy more units to go bankrupt on more upkeep.. etc etc

  3. #3

    Icon1 Re: Garrison Script Explained

    Tsarsies: Do you have any plans to use the ‘destroy_units’ command in your new garrison scripting?
    Spoiler Alert, click show to read: 
    Code:
    campaign_script:
    
    	monitor_event FactionTurnStart FactionType sicily
    		and I_TurnNumber >= 1
    		destroy_units sicily garrison_unit
    	end_monitor
    
    	monitor_event FactionTurnEnd FactionType sicily
    		and I_SettlementOwner Anorien = sicily
    		create_unit Anorien, Dismounted Kofm, num 6, exp 1, arm 0, wep 0
    		create_unit Anorien, Militia Archers, num 3, exp 1, arm 0, wep 0
    	end_monitor
    
    export_descr_unit:
    
    type             Dismounted Kofm
    dictionary       Dismounted_Kofm      ; Gondor Militia
    category         infantry
    class            heavy
    voice_type       Heavy
    banner faction   main_infantry
    banner holy      crusade
    soldier          Norse_Swordsmen, 60, 0, 1
    officer	         gondor_captain_early_flag
    mount_effect     elephant +2
    attributes       sea_faring, hide_forest, can_withdraw, free_upkeep_unit, garrison_unit
    formation        1.2, 1.2, 2.4, 2.4, 4, square
    stat_health      1, 3
    stat_pri         7, 3, no, 0, 0, melee, melee_blade, piercing, sword, 25, 1
    stat_pri_attr    no
    stat_sec         0, 0, no, 0, 0, no, melee_simple, blunt, none, 0, 1
    stat_sec_attr    no
    stat_pri_armour  4, 2, 4, metal
    stat_sec_armour  0, 0, flesh
    stat_heat        4
    stat_ground      0, -1, 0, -2
    stat_mental      10, normal, trained
    stat_charge_dist 15
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        1, 410, 180, 75, 75, 410, 4, 100
    armour_ug_levels 2, 3
    armour_ug_models dismounted_kofm, dismounted_kofm_ug1
    ownership        sicily
    era 0            sicily
    era 1            sicily
    era 2            sicily
    recruit_priority_offset    7
    
    
    type             Militia Archers
    dictionary       Militia_Archers      ; Militia Archers
    category         infantry
    class            missile
    voice_type       Heavy
    banner faction   main_missile
    banner holy      crusade
    soldier          militia_archers, 60, 0, 1
    officer	         gondor_captain_early_flag
    mount_effect     elephant +3
    attributes       sea_faring, hide_forest, can_withdraw, free_upkeep_unit, garrison_unit
    formation        1.2, 1.2, 2.4, 2.4, 4, square
    stat_health      1, 3
    stat_pri         6, 2, arrow, 150, 30, missile, missile_mechanical, piercing, none, 0, 1
    stat_pri_attr    no
    stat_sec         4, 2, no, 0, 0, melee, melee_blade, piercing, sword, 25, 1
    stat_sec_attr    no
    stat_pri_armour  4, 3, 0, metal
    stat_sec_armour  0, 0, flesh
    stat_heat        4
    stat_ground      0, -1, 0, -2
    stat_mental      8, normal, trained
    stat_charge_dist 15
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        1, 380, 170, 75, 75, 380, 4, 100
    armour_ug_levels 2, 3
    armour_ug_models militia_archers, militia_archers_ug1
    ownership        sicily
    era 0            sicily
    era 1            sicily
    era 2            sicily
    recruit_priority_offset    5

  4. #4
    Foederatus
    Join Date
    Mar 2010
    Location
    uk
    Posts
    31

    Default Re: Garrison Script Explained

    Maybe if the garrison script is updated someone could make it so the garrison which spawns when sieged, dispands when the siege is lifted? Because when I first played the mod as SE I tried to siege dol guldor with a small force to match the garrison, script kicked in, they beat me and then had a full mordor stack marching through mirkwood.
    Also my view of it was that the garrison script is the population of the settlement rising up to defend thier town, so surely it would be more suitable if it was just militia or basic troops which spawn as opposed to trolls etc.

  5. #5

    Default Re: Garrison Script Explained

    I agree, it should be mainly militia units spawned for the defense, and those units should also be destroyed after the siege is over. It is how the original idea for the script was meant to be. But i am not a unit skinner or modeler so i have no idea how to make units specifically for the garrison script. If thier were units specifically for the garrison script then thats exactly what i would do, remove them after the siege...

    You cant just use units that are already in the game as they are likely also in the EDB. Garrison units should not be recruitable. This thread started by Rozanov esplains it in more detail.

    I dont know what the current unit limit is for TATW, the hardcoded limit is 500 units in the EDU. If someone wanted to duplicate some of the units in the EDU and make garrison units i would happily rewrite the script to include the destroy unit command. Just let me know if anyone wishes to do that and ill tell you the units i would require duplicated and ill rewrite the script...
    ...longbows, in skilled hands, could reach further than trebuchets...

  6. #6

    Default Re: Garrison Script Explained

    Rep!
    I now understand this formidable script much better.
    (*And I can stop wondering what PT means!)
    Somewhat strange that KK included the same units for every defense counter.
    Maybe he just wanted to make it more predictable and lower the chance of good units to spawn?
    But he could have done this without great parts of the script by just excluding the defense counters at all and set solely one list of units, couldn't he?
    I think I saw a post or submod somewhere in the TA forum where someone did rewrite the units with different sets for all defense counters.
    I'll have a look, maybe I'll find it again.

    Cheers,
    cg
    "Do you want Total War?"

  7. #7

    Default Re: Garrison Script Explained

    I actually rewrote the script for TATW 1.2 early last year. Which would still be compatable with TATW 1.4 (just the garrison script, not the whole campaign script) - aslong as the units used havent been removed from the edu.

    I plan to rewrite the script regardless if someone offers to clone some edu units for me or not.

    The defense counters can be extended to what ever value you desire. The more creative you are in what can spawn the wider variety you can have and the harder it is to determine what will spawn.

    I am sure KK left the defense counters all the same as he had a bunch of other stuff going on when the mod was still in beta. This script isnt the easiest to wrap ones head around. My unit limitations script is pretty detailed too. Which includes the population control script.
    ...longbows, in skilled hands, could reach further than trebuchets...

  8. #8

    Icon1 Re: Garrison Script Explained

    Tsarsies: Here are two duplicate units for the Sicily faction. I have tested them in a custom battle and on the campaign map as well, with no errors. See the attachment.

    export_descr_unit:
    Spoiler Alert, click show to read: 
    Code:
    type             Garrison Infantry
    dictionary       Garrison_Infantry      ; Garrison Infantry
    category         infantry
    class            heavy
    voice_type       Heavy
    banner faction   main_infantry
    banner holy      crusade
    soldier          Norse_Swordsmen, 60, 0, 1
    officer	         gondor_captain_early_flag
    mount_effect     elephant +2
    attributes       sea_faring, hide_forest, can_withdraw, no_custom, garrison_unit
    formation        1.2, 1.2, 2.4, 2.4, 4, square
    stat_health      1, 3
    stat_pri         7, 3, no, 0, 0, melee, melee_blade, piercing, sword, 25, 1
    stat_pri_attr    no
    stat_sec         0, 0, no, 0, 0, no, melee_simple, blunt, none, 0, 1
    stat_sec_attr    no
    stat_pri_armour  4, 2, 4, metal
    stat_sec_armour  0, 0, flesh
    stat_heat        4
    stat_ground      0, -1, 0, -2
    stat_mental      10, normal, trained
    stat_charge_dist 15
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        0, 0, 0, 75, 75, 410, 4, 100
    armour_ug_levels 2, 3
    armour_ug_models dismounted_kofm, dismounted_kofm_ug1
    ownership        sicily
    era 0            sicily
    era 1            sicily
    era 2            sicily
    recruit_priority_offset    7
    
    
    type             Garrison Archers
    dictionary       Garrison_Archers      ; Garrison Archers
    category         infantry
    class            missile
    voice_type       Heavy
    banner faction   main_missile
    banner holy      crusade
    soldier          militia_archers, 60, 0, 1
    officer	         gondor_captain_early_flag
    mount_effect     elephant +3
    attributes       sea_faring, hide_forest, can_withdraw, no_custom, garrison_unit
    formation        1.2, 1.2, 2.4, 2.4, 4, square
    stat_health      1, 3
    stat_pri         6, 2, arrow, 150, 30, missile, missile_mechanical, piercing, none, 0, 1
    stat_pri_attr    no
    stat_sec         4, 2, no, 0, 0, melee, melee_blade, piercing, sword, 25, 1
    stat_sec_attr    no
    stat_pri_armour  4, 3, 0, metal
    stat_sec_armour  0, 0, flesh
    stat_heat        4
    stat_ground      0, -1, 0, -2
    stat_mental      8, normal, trained
    stat_charge_dist 15
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        0, 0, 0, 75, 75, 380, 4, 100
    armour_ug_levels 2, 3
    armour_ug_models militia_archers, militia_archers_ug1
    ownership        sicily
    era 0            sicily
    era 1            sicily
    era 2            sicily
    recruit_priority_offset    5

    export_units:
    Spoiler Alert, click show to read: 
    Code:
    ¬----------------
    {Garrison_Infantry}	Gondor Militia
    {Garrison_Infantry_descr}
    Consisting of volunteers who wish to do their part in Gondor's defense, these militiamen are pretty well motivated and equipped, which somewhat compensates for their rudimentary training. As is they are excellent for police duties and dettering small groups of raiders, but a good commander may be able to use them in more serious engagements as well, for they can prove to be quite resilient with their solid shields and swords.
    {Garrison_Infantry_descr_short}
    Strong militia units with solid shields and swords.
    ¬----------------
    {Garrison_Archers}	Archer Militia
    {Garrison_Archers_descr}
    Consisting of volunteers who wish to do their part in Gondor's defense, these militiamen are pretty well motivated and equipped, which somewhat compensates for their rudimentary training. As is they are excellent for police duties and deterring small groups of raiders, but a good commander may be able to use them in more serious engagements as well, for they can prove to be quite effective in a defending position with their well-timed volleys.
    {Garrison_Archers_descr_short}
    Militia units equipped with simple bows and a short sword.
    Last edited by TNZ; April 12, 2010 at 03:05 AM.

  9. #9

    Default Re: Garrison Script Explained

    The problem with using duplicate units for each faction is you end up wasting space in the EDU. 12 factions will be 24 units (if you used a spear and archer for garrison).

    The idea for duplicate units is to be used by multiple factions. There fore, being a fantasy mod, would require garrison units for the men factions, elf factions, dwarf factions and orc factions. (unless you want orcs defending for elves - is my point). So thats 4 duplicate units (8 if u include an archer unit). The script would be duplicated for each 'race'. If it was written for a normal Medieval mod, you would use units for each culture.

    But then again, it depends on how many unit slots are available to still be used. If TATW doesnt use all 500 spots in the EDU then its not a problem using units for each faction. How many units does TATW use?
    ...longbows, in skilled hands, could reach further than trebuchets...

  10. #10
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: Garrison Script Explained

    Quote Originally Posted by Tsarsies View Post
    The problem with using duplicate units for each faction is you end up wasting space in the EDU. 12 factions will be 24 units (if you used a spear and archer for garrison).

    The idea for duplicate units is to be used by multiple factions. There fore, being a fantasy mod, would require garrison units for the men factions, elf factions, dwarf factions and orc factions. (unless you want orcs defending for elves - is my point). So thats 4 duplicate units (8 if u include an archer unit). The script would be duplicated for each 'race'. If it was written for a normal Medieval mod, you would use units for each culture.

    But then again, it depends on how many unit slots are available to still be used. If TATW doesnt use all 500 spots in the EDU then its not a problem using units for each faction. How many units does TATW use?
    The vanilla 1.4.1 uses 258 (if I've counted right) units in the EDU.
    Probably the 1.5 release will add roughly around 20 more units (reworked Eriador + Arnor re-established + Fellowship of the Ring)
    So even if you take additional unit-mods into consideration, there will be enough slots left.


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  11. #11

    Icon1 Re: Garrison Script Explained

    Tsarsies: Yes, you would want the duplicate units to be usable by as many factions as possible, but with the limit being 500 units I see no reason why you could not have 28 units just for the garrison script.

    The units I posted were just the duplicate units I made to test an idea I had for a garrison script. This script creates units in a settlement when a faction ends its turn and destroys these units at the start of the faction’s next turn:
    Spoiler Alert, click show to read: 
    Code:
    	monitor_event FactionTurnStart FactionType sicily
    		and IsFactionAIControlled
    		and I_TurnNumber >= 1
    		destroy_units sicily garrison_unit
    	end_monitor
    
    	monitor_event FactionTurnEnd FactionType sicily
    		and IsFactionAIControlled
    		and I_SettlementOwner Anorien = sicily
    		create_unit Anorien, Garrison Infantry, num 6, exp 1, arm 0, wep 0
    		create_unit Anorien, Garrison Archers, num 3, exp 1, arm 0, wep 0
    	end_monitor

  12. #12

    Default Re: Garrison Script Explained

    Ok... well that is good. Plenty of units to use.

    As the garrison script enables quite a bit of variety it may be an idea to use a few units for each faction. And seeing as thier are some 200+ free slots. It would allow for a rather varied spawn...
    ...longbows, in skilled hands, could reach further than trebuchets...

  13. #13

    Default Re: Garrison Script Explained

    hey i'm trying to make a garisson script 4 retrofit and the 4 kingdoms campaigns, but it seems that if i simply copy all the garrison section in the campaign_script of tatw and change the units and settlements nothing happens. i don't think it's a sintax mistake because i've only changed things not meddled with the actual layout of the script. please give me some help because i couldn't find any other garrison script as fast as this, i dunno why btw. so my question is: is there any other part from tha campaign_script of tatw that i should transform and import into my campaign_script or only the garrisons cript section is enough?

  14. #14
    Baron Samedi's Avatar Citizen
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    1,414

    Default Re: Garrison Script Explained

    Quote Originally Posted by alexgold View Post
    hey i'm trying to make a garisson script 4 retrofit and the 4 kingdoms campaigns, but it seems that if i simply copy all the garrison section in the campaign_script of tatw and change the units and settlements nothing happens. i don't think it's a sintax mistake because i've only changed things not meddled with the actual layout of the script. please give me some help because i couldn't find any other garrison script as fast as this, i dunno why btw. so my question is: is there any other part from tha campaign_script of tatw that i should transform and import into my campaign_script or only the garrisons cript section is enough?
    Just copying the garrison script section should be enough. I don't see why it couldn't work. If you experience an error or something like this, you just need to take a look @ your system.log. If you made just one spelling error in a unit- or settlement-name, the whole script might not work. I also suggest you begin small and test it first on one settlement and if it works you can add more and more settlements to the script.
    Under the patronage of MasterBigAb

  15. #15

    Default Re: Garrison Script Explained

    Quote Originally Posted by alexgold View Post
    hey i'm trying to make a garisson script 4 retrofit and the 4 kingdoms campaigns, but it seems that if i simply copy all the garrison section in the campaign_script of tatw and change the units and settlements nothing happens. i don't think it's a sintax mistake because i've only changed things not meddled with the actual layout of the script. please give me some help because i couldn't find any other garrison script as fast as this, i dunno why btw. so my question is: is there any other part from tha campaign_script of tatw that i should transform and import into my campaign_script or only the garrisons cript section is enough?
    The Garrison Script Section itself should be enough. Unless on releases since i last saw they have moved counters out of that section... Because the counters could be read if need be by any other script, if one wanted to do that...

    First thing u will want to do is make sure all the Settlements in question are valid. Make sure the units in the script are in the EDU in question. Don't forget to ensure the FACTIONS are correct AND are set up correctly for each Settlement

    Don't forget to change the names of the counters that refer to the settlements, otherwise the script might be hard to read and follow (whether its working or not). Keep in mind that this particular script does not cover all settlements.

    Useless info that might help...
    whenever i write a script i always test it in parts. Make sure the individual parts work on thier own. You can do this by pre setting counters at turn start to make certain parts of the script fire. To ensure it actually gets read and works u can add this to that part of the script...
    add_money england 50000
    Or whatever the syntax is and whatever faction YOU are playing (not testing). IF your treasury gains that money, the script is working and there is no need to check the log every single time. IF u dont get the money, then check the log. It will tell u on what line the engine stopped reading before discarding the script. (The game can load and play with or without a campaign_script)... You simply check that line in the script and fix it...


    Feel free to private message me if you want more help or advice on getting the script working. Its a mighty detailed script with a lot of potential
    ...longbows, in skilled hands, could reach further than trebuchets...

  16. #16

    Default Re: Garrison Script Explained

    I don't think you need to duplicate units. I don't remember Rozanov ever mentioning that, and he used destroy_units.

Posting Permissions

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