Page 1 of 13 1234567891011 ... LastLast
Results 1 to 20 of 248

Thread: Garrison Script v1.3 >>> NO TURN LAG <<<

  1. #1

    Default Garrison Script v1.3 >>> NO TURN LAG <<<

    TSARSIES
    GARRISON SCRIPT
    VERSION 1.3

    Now compatible with the latest RR\RC

    In an Attempt to make the AI harder and more challenging i present to you, the Stainless Steel Garrison Script. Enabling the AI to fortify itself much better. Prepare for battle, because no settlement will be easy pickings now!

    Compatibility with other mods?
    It will work with any mod that does not change settlement names or Edit the slave faction name or alter unit names.
    RR\RC players should use the Version 1.3
    You don't need RR\RC for Version 1.2


    Latest Version


    1.3
    >>> NO TURN LAG <<<
    Many possible spawn variations PER SETTLEMENT
    The AI may surprise you and rally more troops to its aid just before the battle begins.
    More than 150 unit types used in the various spawn variations across the map from settlement to settlement and year to year.

    HOW TO INSTALL
    Open the attached garrison_script.txt and copy the entire script (select all - copy), Open your campaign_script.txt in your SS6.X\data\world\maps\campaign\imperial_campaign folder, scroll to the very bottom, above the wait monitors and in the space just above that, paste the entire script which you copied from the attached garrison script.
    Do the same for the Late Era Campaign.

    Thanks, and enjoy


    Garrison Script for Stainless Steel
    Version 1.2
    I apologize for the long time it has taken me to finish this Release. With personal issues and other complications i have finally been able to release this. I do not guarantee it to be perfect but it is definitely alot more polished then my previous scripts.
    The script runs with no turn lag, every settlement is included, more then 150 unit varieties included and hundreds of variation in possible spawns across the map.

    Version 0.9a was the basis that i worked from and i simply added to it, therefore no turn lag should apply. Your suggestions to improve this system are more then welcome!
    I have associated each level of the spawned units type\quality\variance\upgrades directly to the events file. Therefore, expect to see units spawning along the same time frame as used by PB's RR\RC mod. I have also used the On-line Royal Military Academy to aid in regional based unit type selection. Alot of cross referencing has been done and if you notice any peculiarities, please let me know

    Games Time Span;
    1080 - 1560 = yrs

    Armor\Weapon Upgrade
    The following dates have been used to estimate the AI's (and Players) Armor Upgrades.
    Spawned units will not gain any upgrades until the specified date has arrived. The arrival of each date does not guarantee that spawned units will have the associated upgrade, It just means that they can start spawning with an armor upgrade.

    Approx. 1265 - Heavy Armorer Arm +1
    Approx. 1362 - Plate Armorer Arm +2
    Approx. 1444 - Gothic Armorer Arm +3

    *Note; Weapon upgrades have been substituted for experience.

    Settlement Upgrade Estimations
    Sets Maximum Spawn Variety (3-18 units)
    Note: Later dates can still spawn the earlier date numbers (Quality and Quantity). (3 units could still spawn in 1338). You will rarely see more then 12 units spawn, as each 'phase' is based on percentages. Spawning of huge armies is extremely rare but can happen. (Example; there is only a 5% chance that 18 units will spawn and the year must be no earlier then 1400). The way i have written the system you should not experience any overkill, but with that said, its not entirely unlikely...

    Game Start - Less than Castle\Stone Wall - 3-9 Units Max
    Approx. 1214 - Castle\Stone Wall - 6-12 Units Max
    Approx. 1300 - Fortress\Large Stone Wall - 9-15 Units Max
    Approx. 1400 - Citadel\Huge Stone Wall - 12-18 Units Max

    How does it work?
    With this system in place you can expect a much more varied approach to garrison spawns. I have attached the experience of units with the event system, which in turn is the deciding factor in what types of units and their quality that can spawn. Meaning Longbow units will not spawn for London's defense no earlier then 1214. Later in your campaign you can expect garrisons to have some, or alot, of experience behind them. No more fighting untrained men!!!

    Every settlement under this system will be slightly different, The type and quality of units spawned will depend on regional and historical ownership. For the most part, you will see alot of difference in the types of units spawned from settlement to settlement. In general however, units spawned will be regional based. (meaning if the Moors control London, English Longbows could\would still spawn).

    There is an added chance (minor) that a cavalry unit will spawn in a settlements defense along with 2 trebuchets. The quality and type of cavalry is different for each settlement Dependant on regional ownership. So expect to see the possibility of boyar sons to spawn at the last moment for Russian provinces and then mailed knights for north western European settlements etc (this may need to be edited for the Late Era Campaign)...

    Compatibility
    This mod is NOT compatible with any mod that CHANGES unit names or removes the standard Stainless Steel factions for another. IF you give me a list of ALL units taken out of SS and what units/s they were substituted for i can easily upload a version of the garrison script which is compatible, same goes for settlement name changes. Any Further additions i make to this mod will be simple to implement as i have planned the script in a way that allows for easy substitution/addition of elements etc. Thats the plan anyway

    About 150 units from the export_descr_unit.txt file have been used.
    This mod does NOT in any way make the AI smarter, it simply gives the AI a boost to it's defenses when you siege an AI settlement. That boost could be small, or huge. The AI will retain all units that spawn in its defense, so you can expect retaliation if you fail an assault.

    Suggestions or Ideas???

    All ideas suggestions comments welcome...

    EDIT: Rebel settlements are not affected, only Faction owned settlements can spawn a garrison.

    You Have Been Warned!
    Last edited by Tsarsies; March 28, 2009 at 03:49 PM.

  2. #2
    MORBIDYAM's Avatar Semisalis
    Join Date
    Oct 2007
    Location
    Somewhere in the bowels of Texas...
    Posts
    433

    Default Re: Garrison Script

    well your script sounds excellent, though it would be cool if you fail against the rebels, or lift the siege an ai army is scripted to maybe go after one of your cities, so that there are some reprecussions, I'd help you if I knew anything about modding or scripting
    Quote Originally Posted by Master Zuma View Post
    he don't download my mod and say that there are stuff from DLV and BC maybe he Nostradamus
    tAnGeRiNeS fOr ThOuGhT? i ThInK NOT!


  3. #3

    Default Re: Garrison Script

    Ideas and suggestions are as valuable as actually scripting it in my opinion. well, good ideas anyway lol.

    You suggested having the ai go after the players settlements, that is somthing i would like to work on after the garrison script. Spawning whole armies (rebellions and faction armies alike) designed specifially to hunt the player.

    Depending on life and my work schedule i hope to have a first release ready in 2 days or less...
    ...longbows, in skilled hands, could reach further than trebuchets...

  4. #4
    MORBIDYAM's Avatar Semisalis
    Join Date
    Oct 2007
    Location
    Somewhere in the bowels of Texas...
    Posts
    433

    Default Re: Garrison Script

    Thats cool, I really appreciate your work. btw where do you learn how to script and stuff because I've always wanted to learn myself but I have no idea where you would even begin, because I feel guilty just making a billion demanding suggestions and not suggesting anything myself or having any idea how realistic my suggestions actually are.

    I remember the distant past when RTS games used to have scenario editors, I used to love those and wish MTW had one, seems like modding would be alot easier for lay people like me.
    Quote Originally Posted by Master Zuma View Post
    he don't download my mod and say that there are stuff from DLV and BC maybe he Nostradamus
    tAnGeRiNeS fOr ThOuGhT? i ThInK NOT!


  5. #5

    Default Re: Garrison Script

    I taught myself by looking at other peoples scripts and just trying stuff out, trial and error. If you really want to learn id suggest going to http://www.twmodsquad.com/ , there are quite a few helpful tutorials on that site along with very helpful people who frequent the site. It is a site run and owned by GreenEyedDvl who i must say has taught me alot. There are also an abundant amount of tutorials on this site in other forums. Alpaca has a thread dedicated to scripting ( http://www.twcenter.net/forums/showthread.php?t=91698 ), it is insightful and very well written. The 2 of them are like geniuses when it comes to scripting!. There are various files in MTW that require a different kind of approach while still using a similar knowledge base. as an example, coding the traits is slightly different to editing the campign script, Byg is probrably the most knowledgable person on here regarding anything to do with traits and\or ancilliaries.

    Hope that helps you.
    ...longbows, in skilled hands, could reach further than trebuchets...

  6. #6

    Default Re: Garrison Script

    Tsarsies, thanks for planning for a much needed Garrsion script for SS. Your idea is good, I would much like to see it extend to all cities rather than just the capital in your final release.

    Spawning from mercenery is ok, what about spawning from the available unit pool in the given castle/town? The type of military building in the settlement determines the quality of the spawned troops etc.

    I'm excited and can't wait for the release

  7. #7

    Default Re: Garrison Script

    I do plan on the final release affecting every settlement. Im sure pople worried about the turn time wont be interested in the final release tho, but i want to try to give everyone an option to have a garrison script whether or not they mind waiting at turn end or not... but yes, i plan on the final release to include all settlments.

    The only problem with using the recruit pool for the settlment based on buildings present etc is there is ALOT to test before even spawning a unit. example, you would need to test what faction it was, what buildings are present (some factions have different buildings, so there is multiple conditions to test there), what year or turn number it is to spawn a valid unit, ... so there would be too many conditions per monitor making the script far too long.

    Using the mercenary pools only (based off of greeneyedvls script) it automatically shortens the script because the units are pre set in there regions, you dont need to test what faction is present, just as long as it isnt the player or slave faction, and you also dont need to worry about what building is present... basically, the local populace gather enough coin to hire some mercenary defenders to aid them in the upcoming battle, so to speak.

    I do however plan to have multiple versions, depending on ones choice of difficulty (saves having un-needed script for your campaign).

    and some settlements will get faction specific units if that faction holds that settlment, but those settlments will be far and few between (and needs discussion on which those settlments should be)... Jerusalem would be one for example.
    ...longbows, in skilled hands, could reach further than trebuchets...

  8. #8

    Default Re: Garrison Script

    I see, then I agree we should just use the mercenary pool for now. If the turns wait time is not too long then it can be improved further.

    How does the settlement determine how many mercenary to spawn in a siege?
    Last edited by PeteAce; May 16, 2008 at 03:30 AM.

  9. #9

    Default Re: Garrison Script

    I was going to base that purely on the players difficulty setting, and therefore have multiple versions to install depending on the players choice of difficulty. It would shorten the script for each person as you wouldn't have need of the settings for other difficulties.

    Could base it on settlement upgrade levels, but would require 10 monitors for each settlement, requiring roughly 10 lines of code for each monitor(1990 monitors, 19,900 lines of code!). That would not necessarily slow the game down, but when you add in additional scripts it could very well slow it down. (my campaign script is 4.2MB with 81000 lines of code and i have possibly a 30-60 second turn lapse).

    I was planning on having 1 monitor for each settlement, 2 monitors for capitals. The capitals would spawn units every-turn to keep a desired minimum defense, regardless of faction relations. Every settlement including capitals, would then gain units once faction relations with the player become hostile or war. This would allow for backstabbing to occur and keep the AI reasonably defended when threatened by the player.

    Depending on difficulty i was thinking the following guidelines for unit spawn...
    easy - no units, if you want to play easy then you wouldn't be interested in making the game harder, right? lol
    medium - 2-3 units (1 missile\2 infantry no exp\upgrades)
    hard - 4-6 (2 missile\3-4 infantry 1 exp\little or no upgrades)
    very hard -7-10 (3-4 missile\4-6 infantry 2-3 exp\some upgrades)

    Not taking into account units already there, and any surplus units would not spawn.

    of course, its all open for change and additions etc etc. Which is why i wanted to get a discussion going for it in this thread, may resort back to the ideas in the original script yet. I just want to gather ideas and get a nice balanced script to play with and then take it from there...
    ...longbows, in skilled hands, could reach further than trebuchets...

  10. #10
    Gorrrrrn's Avatar Citizen
    Join Date
    Jan 2007
    Location
    here
    Posts
    5,546

    Default Re: Garrison Script

    Quick question:

    how do you intend stopping the AI from using the garrison outside the settlement?

    From previous discussions it was considered that it's impossible to immobilise units (ie stop them from moving out of the city.)

  11. #11

    Default Re: Garrison Script

    Tsarsies
    In my experience its best just to give one script to players. You can easily terminate the wrong difficulty monitors so speed will not be an issue.

    To err is human, but to really foul things up you need a computer.
    Paul Ehrlich

  12. #12
    godspeed's Avatar Libertus
    Join Date
    Sep 2006
    Location
    Florida
    Posts
    62

    Default Re: Garrison Script

    Tsarsies,

    Even with using the merc pool won't there still be limitations on which units can be spawned? Some of the merc units are tied to events and conditions which may require extra test. If so, then one solution may be to create garrison units in the EDU which can't be recruited in the EDB. The units could be based on militia and mercs. To make room in the EDU, the artillery units could be combined. I was planning on giving that try anyway to allow people (with more creative skills than me) to add even more unique units to SS.

    Have you considered randomizing the garrison spawning event to simulate the locals not having enough money (or time to rally to the defense)?

  13. #13

    Default Re: Garrison Script

    One thing I did discuss with KK was creating garrison units in the EDU and models files which would only be spawned by script. As such you can spawn them for the siege and then kill them off afterwards. You have to do it this way as the kill units command kills all units of that type. I imagined one unit like the cross, which as artillery whould stay in the settlement and stop people exploiting the Ai sallying forth, and have a bonus vs cavalry. The rest would be a spear militia type unit, as represents armed citizens.

    To err is human, but to really foul things up you need a computer.
    Paul Ehrlich

  14. #14
    godspeed's Avatar Libertus
    Join Date
    Sep 2006
    Location
    Florida
    Posts
    62

    Default Re: Garrison Script

    And I thought I had an original idea. Silly me. Good to hear you and KK are on top of things. How far did you get with that? If you think it is worth doing I can help with reworking the current EDU and modeldb to make the room for the new units.

  15. #15

    Default Re: Garrison Script

    Quote Originally Posted by Quark View Post
    As such you can spawn them for the siege and then kill them off afterwards.
    Quark, I really like this idea. IMO the whole point of the Garrison Script is to help AI defend their settlements, nothing more. As a player, I can decide to backstab or launch a sneak attack on a neutral or friendly faction, that way the original script idea would not have spawned any units.

    I briefly tested how DLV's Garrison Script work, they would spawn on siege, but would not disappear after siege. If I siege again, new spawned units would be added on top of the old spawned units which doesn't really make sense. Plus the AI could move the spawned units outside of the settlement for other than the defending purpose.

    Would it be easier or faster to write a script for AI to spawn units only when besieged by player? Once the siege is over, any remaining units created by the script would be disbanded. The number of spawned units depends on the importance of the settlement.
    Last edited by PeteAce; May 16, 2008 at 09:41 AM.

  16. #16

    Default Re: Garrison Script

    By only using the merc pools you would be limited to the types of units that you could spawn. counters, event timers etc wouldnt be a problem in spawning a unit, even if it requires , say, gunpowder to be discovered you could spawn Arquebusiers (if you so wished), at the start of the game there are welsh longbow in welsh territory and longbow units are not available at the start.

    Im not against using a long or longer script, as long as it works as desired. So randomizing the spawns wouldnt be hard to impliment, if that was the case. Each settlment would have different units spawned regardless, but it would be possible to randomize those spawnings.

    It would be possible (and easy to impliment) a script that once the units are spawned will not spawn any more for a period of time. That would negate the issue of sieging a settlment again to only have spawned units ontop of spawned units.

    As already stated, the kill_unit command kills off all instances of that unit. I have personally never seen the AI use merc units so killing off the spawned units might not be such a bad idea. It could, on rare occasions hurt the player for it would kill his units of that type aswell, which is the only real issue i see. There is a command called 'destroy_units', which is based off of one of 3 things, faction, attribute or type. this to me is much better then kill_unit as it can be set to only effect a single faction or even only effect merc units (and it is rather versitile). you can create completly new attributes (in the EDU only, doesnt effect anything other then to call upon it in script). i have tested it and it works without issues...

    I am personally not too worried if the AI uses the spawned units after the siege, even though the units were spawned specifically for the siege. The AI would not be able to move them out 'during' the siege and would have to use them for the siege , if that makes sense... besides, a script that aids the AI in anyway is worthwhile, if the AI gains a few extra units out of it, thats good isnt it, cause it creates a stronger AI... but im open to killing off units after a siege if that is the desired result...

    hope i didnt miss anyones question
    ...longbows, in skilled hands, could reach further than trebuchets...

  17. #17

    Default Re: Garrison Script

    Quote Originally Posted by Tsarsies View Post
    I am personally not too worried if the AI uses the spawned units after the siege, even though the units were spawned specifically for the siege. The AI would not be able to move them out 'during' the siege and would have to use them for the siege , if that makes sense... besides, a script that aids the AI in anyway is worthwhile, if the AI gains a few extra units out of it, thats good isnt it, cause it creates a stronger AI... but im open to killing off units after a siege if that is the desired result...
    Yes, either way works for me as long as the AI gets the cheat . I still prefer the killing off spawn units, and respawn when besieged again. In real life merc get paid to get their work done, then leave. Plus that would also eliminate any possibility of AI using them 'after' the siege to attack other AI faction.

  18. #18

    Default Re: Garrison Script

    there are 2 commands for killing off units, one kills off every instance of the unit map wide, the other can be set to various conditions (faction, attribute, type). I dont like the idea of having to call on the faction, specifically because i dont want to have to check what faction is being attacked by the player in every monitor. type is out becuase it would kill ALL units of said type. Attribute is the best bet, as it can be easily modified. although a comnbination of 2 of them would work equally well. Ive been testing various scripts to see which is best and will post anything i deem interesting or what ever.
    ...longbows, in skilled hands, could reach further than trebuchets...

  19. #19

    Default Re: Garrison Script

    Tsarsies
    There is a paricular exploit that some people use where they attack a settlement with a cavalry/general unit, wait for Ai to sally forth, run away and then run back to win via the clock. By placing a cross like unit to guard the gates I hoped to cut down on this behaviour. The other choice was to reduce the size of the battle map, but I do not know how to do that yet.

    The reason why I chose kill over destroy, was simply because of monitors and player attacking more than one faction in a turn. Also it made the economy easier as not lumbering the Ai with units it could not support.

    I prefer the monitor event, over condition idea as a) less impact on turn speed, b) it takes some time to rally the defences, c) I like using spies to open gates and surprise the enemy (a lot of forts fell from within, rather than without), and feel this is a valid use for them.

    To err is human, but to really foul things up you need a computer.
    Paul Ehrlich

  20. #20
    godspeed's Avatar Libertus
    Join Date
    Sep 2006
    Location
    Florida
    Posts
    62

    Default Re: Garrison Script

    How many times does a settlement survive a siege? Not very often. The script only fires when humans siege an AI settlement, right? That's why I think killing or not killing the remaining garrison units is not going to have much impact on the campaign. If a settlement does survive a siege, the AI doesn't do a very good job of recognizing that it needs to regarrison. So why not let the AI keep the units and if the AI moves out the units, so be it. The AI needs all the help it can get. Human players regarrison and even use those units at times for other duties. Seeing that most sieged settlements fall, how many units are we talking about anyway?

    If economic impact is of concern then allow those garrison units to be totally free to the AI. Of course this means special garrison units in the EDU which are called by the script. If the premise of the script is that the locals rally to defend themselves, then there is no need to charge the AI faction for recruitment either.

    For the siege exploit, maybe increasing the hold plaza timer to some really high value would help. Say 60 minutes in the battle_config.xml. That should be plenty of time for the army to get back to fight that general. I am not an expert on siege warfare, but how often did sieged settlements really sally out (especially against calvary armies)? If not very often, maybe increasing the sally out strength ratio to some really high value to force an assault on the settlement would help.

Page 1 of 13 1234567891011 ... LastLast

Posting Permissions

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