Results 1 to 20 of 20

Thread: S2R+ | Scripting

Hybrid View

Previous Post Previous Post   Next Post Next Post
  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

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