Results 1 to 12 of 12

Thread: R2 Script Extender

  1. #1

    Default R2 Script Extender

    The R2 script extender provides the following:

    • A small library of logging functions
    • The ability to edit the main campaign's scripting file without having to restart the game to test changes (like ETW/NTW/S2)


    So obviously the main feature is that this allows the user to edit the scripting.lua without using PFM and restarting the game. All you have to do now is exit to the main menu and restart a campaign to test scripting changes.

    Installation:
    Drop the "R2 Script Extender" folder and "Rome 2 Script Extender.pack" file into your data directory. Dont worry about editing the mod pack, it's in movie format.

    Usage:
    To edit the scripting.lua for the main campaign while the game is in progress, just go to data\R2 Script Extender\vanilla_scripting.lua. This file is an exact copy of the latest packed scripting file. Make your changes, save the file and restart a campaign to test. You can also drop code straight into the file "script.lua" which will be executed; at present it has a function "hello" which has examples of the logging functions. You can call the function hello() from vanilla_scripting.lua to see it in action

    Logging functions:
    Spoiler Alert, click show to read: 

    createNewLog(logName)
    Code:
    Description:
    	Creates a new log in the logging directory. Will overwrite any existing logs with the same name
    Arguments:
    	String logName
    		Name of the log file to create
    Returns:
    	n/a
    updateLog(logName, updateArg)
    Code:
    Description:
    	Writes to the log file
    
    Arguments:
    	String logName
    		The name of the log file to write to
    	String updateArg
    		Text to append to the log
    Returns:
    	n/a



    I'll format this post better when the forums are back to normal. More features to come.
    Attached Files Attached Files
    My Tools, Tutorials and Resources

    Was running out of space, so see the full list here!

    Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
    The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell

  2. #2
    Biggus Splenus's Avatar Primicerius
    Join Date
    Mar 2012
    Location
    South Australia
    Posts
    3,530

    Default Re: R2 Script Extender

    Very nice I'm sure this will be invaluable to some people, but unfortunately not me
    | R5 3600, RTX 2060, MSI B450I, 32GB 3200MHz CL16 DDR4, AX760i, NH-U12S |

  3. #3
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: R2 Script Extender

    I told TC when I requested this that I'd be his only downloader, and I stick by that!

  4. #4
    Biggus Splenus's Avatar Primicerius
    Join Date
    Mar 2012
    Location
    South Australia
    Posts
    3,530

    Default Re: R2 Script Extender

    I definitely wouldn't be surprised if you were
    | R5 3600, RTX 2060, MSI B450I, 32GB 3200MHz CL16 DDR4, AX760i, NH-U12S |

  5. #5
    MaradoX-'s Avatar Libertus
    Join Date
    Mar 2009
    Location
    Belgium
    Posts
    55

    Default Re: R2 Script Extender

    Actually I downloaded it too.
    This might come in handy for an idea i'm thinking about
    Divide and conquer...

  6. #6

    Default Re: R2 Script Extender

    Thanks TC. Do you plan on creating a script-o-rama thread for Rome 2 as you did for NTW and S2?
    Currently following these promising mods - Imperia Antiquitatis by Splenyi
    Traits, Talents, and Toadies
    by Hellbent
    Real Roman Reforms
    by Aodh Mor
    Unit Icons project
    by Bullgod
    Also recommended:
    City Sack, Liberation and Diplomatic Options
    by Dresden

  7. #7

    Default Re: R2 Script Extender

    Quote Originally Posted by redxavier View Post
    Thanks TC. Do you plan on creating a script-o-rama thread for Rome 2 as you did for NTW and S2?
    I really don't have time at the minute, I think .Mitch. may be working on one. A lot of the information is still relevant though.
    My Tools, Tutorials and Resources

    Was running out of space, so see the full list here!

    Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
    The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell

  8. #8

    Default Re: R2 Script Extender

    Hi, I'd like to say thank you for this. I'm not sure if it's current, I guess I'll find that out, but thanks in any case.

  9. #9
    MaradoX-'s Avatar Libertus
    Join Date
    Mar 2009
    Location
    Belgium
    Posts
    55

    Default Re: R2 Script Extender

    I'm wondering, is this script extender also usable in ETW or not?
    Divide and conquer...

  10. #10
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: R2 Script Extender

    Quote Originally Posted by MaradoX- View Post
    I'm wondering, is this script extender also usable in ETW or not?
    No, but the concept is exactly the same so if you are going to be doing scripting, which I assume you are if you're using this, then you should be much more than capable of transferring this to ETW.

  11. #11
    MaradoX-'s Avatar Libertus
    Join Date
    Mar 2009
    Location
    Belgium
    Posts
    55

    Default Re: R2 Script Extender

    Quote Originally Posted by .Mitch. View Post
    No, but the concept is exactly the same so if you are going to be doing scripting, which I assume you are if you're using this, then you should be much more than capable of transferring this to ETW.
    I understand,

    If I understand this concept correctly, you are creating objects from the script files (script.lua and logging.lua) in extenderCore.lua. You're loading them before you load the base lua script from the game itself, and this will enable us to put scripting in script.lua and it'll be loaded even when the game is running? I do know how to script, I just don't understand the ways things are loaded yet etc
    Divide and conquer...

  12. #12
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: R2 Script Extender

    Hey, I actually just remembered that in ETW the scripting.lua file is kept outside of the .pack files, so you don't really need this.

    Unless you want the logging capability, in which case you can just load the logging into the scripting.lua just how you described above.

Posting Permissions

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