Results 1 to 5 of 5

Thread: Is It Possible to Add Some Functionalities in the R2TR Scripting Toolkit into Earlier Games?

  1. #1

    Default Is It Possible to Add Some Functionalities in the R2TR Scripting Toolkit into Earlier Games?

    So, I'm working on a mod for Shogun 2 which allows someone as the USA to switch to the Confederacy on May 1860. I'm wondering if it's possible to use something like DETrooper's scripts in MK 1212 AD? I looked into that mod and saw that many of the scripts are from the R2TR Scripting Toolkit. If this is supposed to be in the Attila Forum, then sorry, but since it uses actions in the R2TR Scripting Toolkit, I assumed that this should be in the Total War Rome 2 Forum.

    There are many functionalities in MK1212 AD and in the R2TR Scripting Toolkit that I would like to replicate as a proof of concept for the larger mod that is being released by our team. I see that there are many functionalities that are the same, and since lua scripting is much easier to modify than to actually create, I would like to see whether I could use some things in the R2TR Scripting Toolkit in earlier games.

    If not, could someone detail the huge differences in scripting in Total War: Rome 2 and Attila compared to Shogun 2? I'd very much like to read on that because many of the scripting documentation in the Shogun 2 subforum is nearly a decade old.

  2. #2
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: Is It Possible to Add Some Functionalities in the R2TR Scripting Toolkit into Earlier Games?

    I'll do a couple of premises:
    1) I don't know how shogun 2 works, never played nor modded it
    2) I'm not an informatician at all but I have some "built through years" experience about lua scripting for TW (mostly as Rome2 DeI's submods)

    If I understood correctly what you're talking about you basically want to transport CA's lua functions across different games.
    Well, you can't do that.
    One thing is using the functions which are built inside lua itself (like math functions, call random numbers, built something through math...) but you can't use custom functions done by CA if they aren't scripted/described inside the hardcoded part of single games.

    For example, Rome 2 and Attila do not have the same functions, yeah, many are the same but there are a couple of functions that are in rome2 only and others that are in attila only.

    1) the Rome 2 lua function list
    http://www.mediafire.com/file/96nv9z..._v1.0.ods/file


    2) the Attila Wiki list (most of the functions in Rome 2 and Attila are the same and work the same, more or less)
    http://www.mediafire.com/file/ibimjj..._wiki.txt/file


    Since I mod rome 2 only (DeI) I surely use the CA references for attila but I have to check inside the extracted list if the single function is available.

    Don't you have an extracted list for shogun 2 lua functions? No one has ever done that?
    If there is but it's old, as you say, it doesn't matter. Shogun 2 lua functions list is the same it was the day the last update came out.
    Period.

    Apart from that... it happened to me to check some scripts done by modders for TW Empire and honestly I can tell you they are more or less the same, lua is always lua.
    So, basically, the potentialities of lua are the same (you can build virtual points system, mess a little with callbacks like Causeless did before entering CA...) but you can work only inside the environment of the preset lua functions for each game.

    Is there a workaround to that?
    I can't say. I don't honestly know if you can insert lua functions from nothing... I think you'll surely have to decompile the dll most probably (this should be possible through an NSA program, like daruwind did with Rome 2 to add more slots). I can't tell you much about this though.
    But I've seen the decopiled file and man... it's a nightmare. You'll put a lot of time into understanding what string is for what.
    Last edited by Jake Armitage; March 24, 2020 at 04:51 PM.

  3. #3
    Daruwind's Avatar Citizen
    Join Date
    Oct 2013
    Location
    Prague
    Posts
    2,898

    Default Re: Is It Possible to Add Some Functionalities in the R2TR Scripting Toolkit into Earlier Games?

    We use decompiling stuff to look after actual stuff. No decompiler will ever allow you to recompile the file to be working again. For that you need stuff that is lost during compilation. And only CA has such files... Altering small bits here and there, possible..like changing some numbers...like changing 6 to 10, that is in the end one hex changed. But it is still leaving us with altering existing game files, which is possible yet very unpractical as of now for mod and not finished. Plus CA won´t like that...Adding functionality? No way. Best bet is heading to C&C discord and ask SFO guys there, you can add scripts, libraries, rewirte parts for Shogun2. Whatever you can build upon existing stuff.... They are probably the best scripters around and as all TWs are build around lua..

    But i would say there is good chance the functions are there as well,just try step by step. Decade old documentation is no problem as the game is as good as the last patch that was also almost decade ago.
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

  4. #4

    Default Re: Is It Possible to Add Some Functionalities in the R2TR Scripting Toolkit into Earlier Games?

    Okay, thank you! I was looking at the script-o-rama on: https://www.twcenter.net/forums/show...-Script-o-Rama and I asked, 'How is this so powerful if the only stuff you can use is Game Interface section?'

    I then saw DETrooper's scripts and saw that you can make new functions, so I'm thinking of making some for TW: S2

  5. #5
    Jake Armitage's Avatar Artifex
    Patrician

    Join Date
    Apr 2011
    Location
    apartment 6
    Posts
    4,694

    Default Re: Is It Possible to Add Some Functionalities in the R2TR Scripting Toolkit into Earlier Games?

    Can you copy paste part of DET's scripts that you're calling "new function"?
    And tell me the name of mk1212's script?
    So that I can understand better what do you intend for "new function"?
    I didn't spend much time in reading them, nor I've ever played attila in my life.
    If I see the scripts themselves I can understand what we are talking about and eventually contact DET for clarifications if needed.
    Last edited by Jake Armitage; March 27, 2020 at 07:53 AM.

Tags for this Thread

Posting Permissions

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