Results 1 to 20 of 20

Thread: S2R+ | Scripting

  1. #1

    Default S2R+ | Scripting

    I know you said you didn't want to use scripting... But I have discovered how to create units for the AI at game start, and I have had a good play through so far where the Major Clans have not fallen to minor aggression. (2-3 units should be enough for each major faction that is not the player - this is how I have it set up)

    I am using shroud removal to make sure it is successful, and as always, am testing it as Chosokabe.

  2. #2
    TW Modder Since 2005 Member DaVinci's Avatar
    Join Date
    May 2005
    Location
    Hamburg, Germany/EU
    Posts
    848

    Default Re: Shogun 2 Realism + | Release & Discussion Thread

    @ tan zhi han

    I have just read your scripting tutorial for S2, well done.

    Now what we could do together after S2R+ 1.79 provides the goal without scripting you aimed for via scripting is another kind of script addition though, just not additional start-units for majors, but ie. in-campaign events, major uprisings or whatever, or complete other events ie. flavour reports of history events in Japan and also we could try to make events that give info about a Daimjo has just died and so on.

    As you are by far more literated with the Senguko period as i'm, i let you suggest some options which could be implemented via script, enhance the realism and provide interesting gameplay. Let's discuss it here :)

    Btw., if you wanna join the S2R+ one-man show to team up for that mod, we can even have a dev forum and hosted mod status here on Org, if desired and/or needed.
    Last edited by DaVinci; 04-23-2011 at 09:12.
    TWC Wiki: List of TW Modding Contributions 2005-2011
    Release 12.2012: Third Age TW Realism+
    Release 04.2013: Rise of the Samurai Realism+


    Support: Greenpeace
    LIVING ...WITH... WAR
    What's really more disappointing than dis-information and non-education?
    A certain degree of intentional ignorance paired with obvious stupidy /DV

  3. #3

    Default Re: Shogun 2 Realism + | Release & Discussion Thread

    So with this scripting would it be possible to get a system in place that ties the number of samurai a faction can have to, lets say, provencis owned? Or perhaps biuldings or technlolgoy? If this could be done then I think you would have not ony the most advanced recrutment mechanic in S2TW mods but also one of the most intresting mods to play for the game.

    One thing I think could be better, and I know is a lot less experimental as far as technical moding goes, is the recrutment cost system. It seems to me that samurai class units should be cheeper to recrut and costly to maintain. The logic here is that these are profesional warriors who are trained by their family or in a school and are then sworn into service of a local lord. This being the reality the local lord wouldn't need to drop a bunch of cash in order to have the person trained and equiped, sence they come with no assembily required if you'll allow a pun. On the back end though a lord would have to pay the samurai, or aquire for him at cost, enuf to maintain a lifestyle befiting of what amounts to a minor noble. So you see, the majority of the cost would be on the back end with samurai. Ahigaru would be fairly simular I think, though not as expencive obviously. The only differance is that sence the ashigaru were trained by their lords, well his staff more like than not, their front end cost would be a little more. The end result of a change like this would be armies that are a bit easyer on the poketbook to raise but difficult to maintain for long periods of time. This, in turn, forces the player to think more long term in their recrutment policy and will give the smaller factions the ability to afford some samurai and that will cause a bit more chalange.

    All in all I like where you are going with things here. Definatly one of the most fun mods for the game.

  4. #4
    TW Modder Since 2005 Member DaVinci's Avatar
    Join Date
    May 2005
    Location
    Hamburg, Germany/EU
    Posts
    848

    Default Re: Shogun 2 Realism + | Release & Discussion Thread

    Certainly a lot is possible if it is similar to RTW-M2TW scripting (where i was partly quite active with, and know what is possible). I'm personally not enough in the scripting lua language to say anything reliable, haven't ever applied or analysed it.

    As for dependence on buildings and technology, there wouldn't be big difference to the current normal recruitment imo. or let me say i see rather disadvantages, if this would be the only criteria, if one spawns certain units and troop amounts along buildings and technology, the spawn is then the difference, and thus the player might be taken away from possible micromanagement of the recruitment, and possibly the AI would have issues to make the right decision about it, if it is overall possible that AI can decide if it would like to accept a unit spawn-offer intelligently.

    I guess a script that limits recruitment along number of owned regions should be possible, and even wouldn't be that much work, the amount of work is then dependent on the possible units, and as we have not that much different ones in S2, it is relative less work, but needs though faction consideration, which increases again the workload.

    The region dependence is interesting though, so that certain regions allow certain recruitment, where the whole regional infrastructure is a requirement and background, this per special historical locality-traits.

    Anyways, such scripting would be murder work. I personally won't do that (the work), but if ie. tan zhi han volunteers for such a project, or has alternative ideas, i'm interested to apply something for this mod.

    (Alpaca did something of this branch for ETW, resulted then later in the merged mod Proper Empire:Terra Incognita)

    However, a start could also be that tan zhi han offers a start-unit script-mod for S2R+, players could check it out if it enhances the game experience.
    Last edited by DaVinci; 04-23-2011 at 22:18.
    TWC Wiki: List of TW Modding Contributions 2005-2011
    Release 12.2012: Third Age TW Realism+
    Release 04.2013: Rise of the Samurai Realism+


    Support: Greenpeace
    LIVING ...WITH... WAR
    What's really more disappointing than dis-information and non-education?
    A certain degree of intentional ignorance paired with obvious stupidy /DV

  5. #5

    Default Re: Shogun 2 Realism + | Release & Discussion Thread

    Quote Originally Posted by DaVinci View Post
    Certainly a lot is possible if it is similar to RTW-M2TW scripting (where i was partly quite active with, and know what is possible). I'm personally not enough in the scripting lua language to say anything reliable, haven't ever applied or analysed it.

    As for dependence on buildings and technology, there wouldn't be big difference to the current normal recruitment imo. or let me say i see rather disadvantages, if this would be the only criteria, if one spawns certain units and troop amounts along buildings and technology, the spawn is then the difference, and thus the player might be taken away from possible micromanagement of the recruitment, and possibly the AI would have issues to make the right decision about it, if it is overall possible that AI can decide if it would like to accept a unit spawn-offer intelligently.

    I guess a script that limits recruitment along number of owned regions should be possible, and even wouldn't be that much work, the amount of work is then dependent on the possible units, and as we have not that much different ones in S2, it is relative less work, but needs though faction consideration, which increases again the workload.

    The region dependence is interesting though, so that certain regions allow certain recruitment, where the whole regional infrastructure is a requirement and background, this per special historical locality-traits.

    Anyways, such scripting would be murder work. I personally won't do that (the work), but if ie. tan zhi han volunteers for such a project, or has alternative ideas, i'm interested to apply something for this mod.

    (Alpaca did something of this branch for ETW, resulted then later in the merged mod Proper Empire:Terra Incognita)

    However, a start could also be that tan zhi han offers a start-unit script-mod for S2R+, players could check it out if it enhances the game experience.
    hmm. skimming through the lua's, adding a check for the name of the province on the "province conquered" event is pretty trivial (since there are already some in place :)). and since somebody did a "all factions have unique units" mod over at twcenter, adding faction-specific limits dependant on the regions controlled wouldn't be that hard (actually deciding who gets what where would take much more work than actually implementing it ;)).

    actually tying the unit cap to the number of provinces is quite another matter. i haven't noticed any functions that modify unit stats throughout the luas (and i don't have anything at hand to compile the decompiler to see what's in those luacs :)), but i thought of a work-around that might just work (perhaps tan can confirm it :P):

    with the SettlementOccupied event trigger adding a remove_restricted_unit_record for certain units (dependant on region and/or faction) and then adding a add_restricted_unit_record on the UnitCreated/Trained event(s) (plus a check on the RecruitmentItemIssuedByPlayer event so that the player doesn't recruit more than he is "allowed"). i see a couple problems with this, though: 1) i have no idea how the CAI would be affected by it (if at all), 2) i think that the actual recruitment of said units wouldn't be limited to the province (although perhaps the player could be given an incentive to recruit them locally by giving certain boni to specific units recruited in certain regions), 3) i don't know if those events/scripts do what i think they do :)

    anyway, this is mostly "in theory" and if i have some free time over the next couple of days i might test this (unless a more knowledgeable person comes along and confirms/denies that this works (or doesn't)) :)

  6. #6

    Default Re: Shogun 2 Realism + | Release & Discussion Thread

    Below is the link to the initial unit bonus to MAJOR AI clans (as well as the Ikko-Ikki). I played 15 turns and no great faction has died. (Tokugawa dies on the 2nd turn but comes back the same turn - Their army marches out, Oda takes the city and leaves, Tokugawa takes it back, Oda moves to Saito).

    Everyone else is expanding pretty well.

    Major AI too wimpy? Want to give them more of an edge? Then why not give them some extra starting units to survive those first crucial turns!

    This mod scripts the Major AI to receive extra units at startup (2 or 3 various units depending on difficulty - easy = 2 cheap units, normal/hard = 1 moderate unit/1 cheap unit, very hard/legendary = 1 elite unit/1 moderate unit/1 cheap unit )

    Comments:
    I have been trying to figure out how to keep the Major clans from dying off. No overhaul mod has done it just right so far, and so I knew it had to be done through scripting. I have made it through 15 turns without any major AI dying (other than a small burp that occurs on turn 2 with Tokugawa dying and rising up the same turn. This happens because Tokugawa moves to attack Oda, Oda attacks Mikawa, Tokugawa takes back Mikawa, and Oda moves to Saito)

    This mod was designed for S2R+. Results may vary among users of anything else.

    Installation:
    1. Create folder "Total War Shogun 2\data\campaigns\jap_shogun" in "Total War Shogun 2\data\campaigns".
    2. Move the downloaded scripting.lua to the jap_shogun folder.
    3. Play!

    5. Report back here on issues/suggestions.



    Download the Script Here!
    Last edited by tan zhi han; 04-24-2011 at 17:25. Reason: Fix

  7. #7
    TW Modder Since 2005 Member DaVinci's Avatar
    Join Date
    May 2005
    Location
    Hamburg, Germany/EU
    Posts
    848

    Default Re: Shogun 2 Realism + | Release & Discussion Thread

    Thanks guys for your scripting contributions and ideas/thoughts.

    You know what? I'll request a hosted forum structure, so threads keep an overview, ie. the scripting thread is too important to go in a general discussion thread.

    Edit: You can post ahread though. I'll later sort the posts out, putting them into the respective thread of the S2R+ hosted forum.

    Atm. these will be: Main Thread (Release), General Discussion, Scripting, Historical Backgrounds, Bugreports, Install Issues (yes, as there will always be people who have issues).
    Last edited by DaVinci; 04-24-2011 at 17:06.
    TWC Wiki: List of TW Modding Contributions 2005-2011
    Release 12.2012: Third Age TW Realism+
    Release 04.2013: Rise of the Samurai Realism+


    Support: Greenpeace
    LIVING ...WITH... WAR
    What's really more disappointing than dis-information and non-education?
    A certain degree of intentional ignorance paired with obvious stupidy /DV

  8. #8
    TW Modder Since 2005 Member DaVinci's Avatar
    Join Date
    May 2005
    Location
    Hamburg, Germany/EU
    Posts
    848

    Default Re: Shogun 2 Realism + | Release & Discussion Thread

    S2R+ v1.79, playtest Chosokabe, H/H, long campaign., without the start-unit script.

    Spring 1549


    As you can see, Oda expands. All other majors do good as well (of course except Tokugawa and Imagawa, as they go at cost due to Oda).

    My concern is still Shimazu, as they vanish quickly in 1 of 2 v1.79 playtests - if they don't vanish, then they are making a good play, but however, for this faction i could need the start-unit script, one unit addition would be enough for them, i assume.

    Tan, could you make a light script version, so only Shimazu, Ikko Ikki and Mori get 1 unit more at start, Yari Ashi. I'll test this, and if not enough, they get two of them.
    Wait, as for making it 100 % save that Oda survives/expands, just add him one Yari Ashi as well.

    Edit:
    Parallel to the sart-unit script, i'll make playtesting with garrison mods without the start-unit script, as is it is clear, garrisons have an impact - upcoming test will be to put the already used radious' garrison mod back on v1.79, and observing the outcome.


    P.S. I'll notify the Start-Unit-Script in the 1st post, with a link to the post #100, i'm sure, players are interested to apply that script, independent from my balancing efforts.
    Last edited by DaVinci; 04-24-2011 at 20:34.
    TWC Wiki: List of TW Modding Contributions 2005-2011
    Release 12.2012: Third Age TW Realism+
    Release 04.2013: Rise of the Samurai Realism+


    Support: Greenpeace
    LIVING ...WITH... WAR
    What's really more disappointing than dis-information and non-education?
    A certain degree of intentional ignorance paired with obvious stupidy /DV

  9. #9

    Default Re: Shogun 2 Realism + | Release & Discussion Thread

    http://www.mediafire.com/file/49d6yf...0campaigns.rar

    I've added so that oda, mori, shimazu,, and ikko ikki each receive 1 yari ashigaru (of their respective faction if they have one).

    I am testing now.

  10. #10

    Default Re: Shogun 2 Realism + | Release & Discussion Thread

    Ok tested... Oda dies after 2 turns with the light script.

    What do you want me to do?
    Last edited by tan zhi han; 04-25-2011 at 00:40.

  11. #11
    TW Modder Since 2005 Member DaVinci's Avatar
    Join Date
    May 2005
    Location
    Hamburg, Germany/EU
    Posts
    848

    Default Re: Shogun 2 Realism + | Release & Discussion Thread

    Quote Originally Posted by tan zhi han View Post
    Ok tested... Oda dies after 2 turns with the light script.

    What do you want me to do?
    It's good now ... i've a version with your light script version and radious garrison mod back in S2R+, Chosokabe test played out well: Summer 1547 - Oda 3, Shimazu 2, Takeda 3, Imagawa 2, Hojo 2 regions, Tokugawa dead as by Oda subjugated.

    Will load it up now as S2R+ v1.80.
    TWC Wiki: List of TW Modding Contributions 2005-2011
    Release 12.2012: Third Age TW Realism+
    Release 04.2013: Rise of the Samurai Realism+


    Support: Greenpeace
    LIVING ...WITH... WAR
    What's really more disappointing than dis-information and non-education?
    A certain degree of intentional ignorance paired with obvious stupidy /DV

  12. #12

    Default Re: Shogun 2 Realism + | Release & Discussion Thread

    Waiting to see the link. Waiting excitedly.

  13. #13
    TW Modder Since 2005 Member DaVinci's Avatar
    Join Date
    May 2005
    Location
    Hamburg, Germany/EU
    Posts
    848

    Default Re: Shogun 2 Realism + | Release & Discussion Thread

    Quote Originally Posted by tan zhi han View Post
    Waiting to see the link. Waiting excitedly.
    It's up.
    TWC Wiki: List of TW Modding Contributions 2005-2011
    Release 12.2012: Third Age TW Realism+
    Release 04.2013: Rise of the Samurai Realism+


    Support: Greenpeace
    LIVING ...WITH... WAR
    What's really more disappointing than dis-information and non-education?
    A certain degree of intentional ignorance paired with obvious stupidy /DV

  14. #14

    Default Re: Shogun 2 Realism + | Release & Discussion Thread

    Turn 19 just finished.

    Shimazu just died. Most of the Great clans have not even expanded minus Uesugi and Hattori. Ikko Ikki died early.

    I admit that my mod allows the Major AI to steam roll the minors, but this provides an adequate challenge that is given historical basis to the player. Right now the minors have blobbed out horrifically... I am as always Chosokabe. I am not sure how to feel about the mod right now. (I am testing with the light script) The fact that the first major JUST died is good news. The fact that the majors are not really majors any more is disconcerting. (I am playing with fog of war off to see what is going on)

  15. #15
    TW Modder Since 2005 Member DaVinci's Avatar
    Join Date
    May 2005
    Location
    Hamburg, Germany/EU
    Posts
    848

    Default S2R+ | Scripting

    Note: All posts above are moved ones from the former S2R+ thread. Tan's last post above is based on v1.80 (and his default campaign difficulty N, i assume), so that observation might be different for other players with current v1.81.

    See also the hint in the sticky release & download thread about scripting contents, means: S2R+ contains a scripting file (folder: campaigns) already.

    So if you add other scripting contents to S2R+, it happens just on your own risk (as for compatibility and balance).

    ---

    The scripting content of S2R+ is wip, worked out in collaboration with tan zhi han and perhaps others.

    Else, the thread shall serve to discuss and develop the scripting for S2R+. It's open to everybody who has to contribute any kind of according thoughts.
    Last edited by DaVinci; 04-27-2011 at 18:07.
    TWC Wiki: List of TW Modding Contributions 2005-2011
    Release 12.2012: Third Age TW Realism+
    Release 04.2013: Rise of the Samurai Realism+


    Support: Greenpeace
    LIVING ...WITH... WAR
    What's really more disappointing than dis-information and non-education?
    A certain degree of intentional ignorance paired with obvious stupidy /DV

  16. #16
    TW Modder Since 2005 Member DaVinci's Avatar
    Join Date
    May 2005
    Location
    Hamburg, Germany/EU
    Posts
    848

    Default Re: S2R+ | Scripting

    Chosokabe playtest, H/H, v1.82, spring 1550



    Shimazu 3, Oda 3 regions (had already 4, just lost one back to Imagawa), ... i'm not dis-satisfied with the current balance, so far.
    Tan, if you like you could make a light script version with additionally: Mori + 1 or even +2 Yari Ashi (as they died really quick in my test), Shimazu + 1 Yari Ashi, Ikko Ikki +2 Yari Ashi, implemented for the next S2R+ update.
    Last edited by DaVinci; 04-28-2011 at 18:09.
    TWC Wiki: List of TW Modding Contributions 2005-2011
    Release 12.2012: Third Age TW Realism+
    Release 04.2013: Rise of the Samurai Realism+


    Support: Greenpeace
    LIVING ...WITH... WAR
    What's really more disappointing than dis-information and non-education?
    A certain degree of intentional ignorance paired with obvious stupidy /DV

  17. #17
    TW Modder Since 2005 Member DaVinci's Avatar
    Join Date
    May 2005
    Location
    Hamburg, Germany/EU
    Posts
    848

    Default Re: S2R+ | Scripting

    Same test campaign as above, Oda vanished in spring 1552 due to too much enemies (basicly some diplo adjustments must be taken still). Besides this, i think Oda and Shimazu should get simply 3 Yari Ashi at start spawned, as start-helper, also for Mori to enable the option for a left side mid map power. Well, it is obvious now, a 1 YA spawn makes no difference as start-helper.

    Quote myself to get back the base
    Tan, could you make a light script version, so only Shimazu, Ikko Ikki and Mori get 1 unit more at start, Yari Ashi. I'll test this, and if not enough, they get two of them.
    Wait, as for making it 100 % save that Oda survives/expands, just add him one Yari Ashi as well.
    Tan, new spawn would be then: (YA = Yari Ashi)
    - Shimazu: 3
    - Ikko Ikki: 3
    - Mori: 3
    - Oda: 3
    ... it is just YA to not hamper on them too much with additional upkeep, and AI battles resolve to a large part via unit numbers.

    Info for everybody else: Those spawn only for the AI, not for the human player.
    Last edited by DaVinci; 04-28-2011 at 22:21.
    TWC Wiki: List of TW Modding Contributions 2005-2011
    Release 12.2012: Third Age TW Realism+
    Release 04.2013: Rise of the Samurai Realism+


    Support: Greenpeace
    LIVING ...WITH... WAR
    What's really more disappointing than dis-information and non-education?
    A certain degree of intentional ignorance paired with obvious stupidy /DV

  18. #18
    TW Modder Since 2005 Member DaVinci's Avatar
    Join Date
    May 2005
    Location
    Hamburg, Germany/EU
    Posts
    848

    Default Re: S2R+ | Scripting

    I believe from on one of the next S2R+ updates, i'll make the script (the added campaigns folder) as optional installation (removing it from the S2R+ dl file). The current (until v1.83) light script makes not really a difference for the supported factions.

    --

    My current playtest observations show clearly that the concerned factions (Oda, Shimazu) are controlled by obviously stupid campaign AI codes (which i haven't touched as of yet).
    I saw ie. Shimazu with a superior stack standing still for many turns, doing absolutely nothing, was waiting until all his settlements were taken by his arch-enemy Ito ... damn, that was 1550 in v1.83/4 (Shimazu had a good start formerly, just destroyed Sagara and kept this region with his home region, but then, no successful invasion on Ito's lands, although they could have done it). Similar acted obviously Oda, he went down from 4 regions controlled to one, then zero. While Oda has a hard life with many potencial enemies, in the case of Shimazu it is different, he has mainly max 3 enemies: Ito, Sagara and Shoni, while at the same time mainly max 2.

    I'm afraid there is less to do via CAI codes to change that, but some day i'll try it with some dedicated CAI files, too, perhaps a softer war:piece behaviour can help.

    As of yet those concerned major factions (Shimazu and Oda) got really a lot general support via modified codes. It is nearly not to understand that these factions don't use that throughout the campaign.
    And if a superior stack then suddenly stands around doing nothing as to view into the landscape, then i fear ... no mod can help them, unless a hammer start unit-script, which is offered already by Tan, is used (where certain major factions actually steamroll the map quickly, what i normally don't want in my campaign experience, a certain balance should be kept, but i'll try his script still on H difficulty to see if it makes any difference towards the year 1550 which is then ca. 20 turns into the game).

    --

    Also as Tan is obviously absent, it is just better to run this script content independent.

    Players can then just choose which script they wanna install, and if overall.

    Else, the info about removing the script, just in case:
    Just open your S2 data folder, find the "campaigns" folder, remove that, ready.

    Afterwards just add the campaigns folder, which (or if) you want to have - find Tan's post above ( post # 6 ), where he offers his standard unit-start script (edit: i just notice, his script puts off the fog of war).

    --

    Edit:

    The S2R+ custom light start-unit script is available in post # 9.

    I still recommend to apply that script (me at least applying it).

    Just download tan's file via post # 9, put the campaigns folder into the S2 data folder. Ready.
    Last edited by DaVinci; 05-10-2011 at 00:32.
    TWC Wiki: List of TW Modding Contributions 2005-2011
    Release 12.2012: Third Age TW Realism+
    Release 04.2013: Rise of the Samurai Realism+


    Support: Greenpeace
    LIVING ...WITH... WAR
    What's really more disappointing than dis-information and non-education?
    A certain degree of intentional ignorance paired with obvious stupidy /DV

  19. #19
    Member Member Hister's Avatar
    Join Date
    Sep 2006
    Location
    Slovenia
    Posts
    283

    Default Re: S2R+ | Scripting

    Why don't you include that script by default? I've missed this and Oda clan died in turn one ;)

  20. #20
    TW Modder Since 2005 Member DaVinci's Avatar
    Join Date
    May 2005
    Location
    Hamburg, Germany/EU
    Posts
    848

    Default Re: S2R+ | Scripting

    See my newest post in the feedback-thread (in regard of Oda).
    TWC Wiki: List of TW Modding Contributions 2005-2011
    Release 12.2012: Third Age TW Realism+
    Release 04.2013: Rise of the Samurai Realism+


    Support: Greenpeace
    LIVING ...WITH... WAR
    What's really more disappointing than dis-information and non-education?
    A certain degree of intentional ignorance paired with obvious stupidy /DV

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO