Results 1 to 20 of 20

Thread: S2R+ | Scripting

Hybrid View

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

    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)) :)

  2. #2

    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

  3. #3
    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

  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

    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

  5. #5

    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.

  6. #6

    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.

  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

    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

  8. #8

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

    Waiting to see the link. Waiting excitedly.

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