Snippet - Directory Of Scripts v1-2

● ARCHIVED · READ-ONLY
Started by Funplayer 9 posts View original ↗
  1. What is this script?

    This script allows you to create a directory of scripts outside the script editor built into the RPG Makers, while still having the ability to evaluate within the RPG Maker's file structure.

    How would this help me?

    IDE are programs that can assist with what you need to do in the RPG Maker.  The script itself is a very small snippet, and you can modify it how you want based on your external file needs.

    What does it do?


    It simply takes in all scripts from the directory, sorts them, and then evaluates them using the RGSS Ruby interpreter.

    How to use V1: (Basic)

    1. Install above materials, and below whatever scripts you want to remain in the game.

    2. Run script to create directory, or create the directory for the RawScripts yourself.

    3. Place any file format within the RawScripts folder that the Ruby Eval will understand.  Anything in standard text format will work best.

    4. Make sure the files are formatted in the correct order.

    How to use V2: (Advanced)

    Version 2 marshal dumps all the files into an EScripts.rvdata object, and contains a commented  out procedure to ONLY read the files.  This will allow you to run the system once, disable the system, then run from only the rvdata object.  This will be a simple base for the encryption system.

    1. Install above materials, and below whatever scripts you want to remain in the game.

    2. Run script to create directory, or create the directory for the RawScripts yourself.

    3. Place any file format within the RawScripts folder that the Ruby Eval will understand.  Anything in standard text format will work best.

    4. Make sure the files are formatted in the correct order.

    5. Run once after inserting all scripts.

    6. Remove scripts from folder

    7. Disable line 13-25 with comment.

    8. Enable line 29-31.

    9. Run again and notice it still runs all of the external scripts, without them existing in the folder.

     


    Suggested File Format:

    - This format will allow you to evaluate overwrites in the correct order.

    # = evaluation layer, works like the script editor in RPG Maker.  This evaluates in alphabetical order, so if you want to make sure events are overwritten correctly, or classes are evaluated in the correct order from external scripts, you need to numerically value them into a higher number layer.  This will evaluate them after the earlier values.  ) evaluates before numeric values, so this is a prime character for the layer value enclosure.

    (0)ScriptName.rb

    (1)ScriptName2.txt

    (1)AScriptName2.rb

    (24)ScriptName3.cfg

    These example files are evaluated

    (0)ScriptName.rb

    (1)AScriptName2.rb

    (1)ScriptName2.txt

    (24)ScriptName3.cfg

    You can use any characters you wish, whatever.  Just keep in mind how it sorts the layering.

    IDE Suggestions:

    Use notepad++ or Sublime text editor for IDE support.  Include the directory or all individual scripts into a project based in these open sourced text editors.  You can feel free to use any environment you want however.

    The Script:

    V1  http://pastebin.com/URM7j8Tj

    V2 http://pastebin.com/52xDQTwp
  2. I'm confused. What is the point of it? Yes, it sorts things and "evaluates" them - why do they need to be sorted and evaluated? What do we achieve by using this?


    Is this a script you're developing? Or are you making it available for others to use? If the latter, please post it in the RGSS3 Scripts forum, following the layout in the template (and providing more information on what it actually does).
  3. Shaz said:
    I'm confused. What is the point of it? Yes, it sorts things and "evaluates" them - why do they need to be sorted and evaluated? What do we achieve by using this?

    Is this a script you're developing? Or are you making it available for others to use? If the latter, please post it in the RGSS3 Scripts forum, following the layout in the template (and providing more information on what it actually does).
    It evaluates them in the sort order, using the file name to evaluate.  Thus you don't end up with overwritten objects taking priority over base objects, or vise versa depending how you want your project to build.  The sort is for the user's build.
  4. Which doesn't really explain how it would benefit the developer.


    Scripts often need to be inserted into the editor in a particular order (not as external files), and that order is seldom alphabetical.


    So I ask again - why do they need to be sorted? How do you end up with overwritten objects taking priority over base objects if you don't use this script? I don't have that problem.
  5. Shaz said:
    Which doesn't really explain how it would benefit the developer.

    Scripts often need to be inserted into the editor in a particular order (not as external files), and that order is seldom alphabetical.

    So I ask again - why do they need to be sorted? How do you end up with overwritten objects taking priority over base objects if you don't use this script? I don't have that problem.
    Well with this, you could make all of the scripts external, and define a layer to them for evaluation.  This will allow you the convenience of auto-complete with methods inside of your IDE environment of choice, while retaining the file structure of choice for your scripts.

    The evaluation system reads from top of the list to the bottom of the list in the script editor built into the RPG Maker, and this is built to allow you to change file names to allow things to sort in a similar manner to the script list.  Base sort is just a simple way to sort the scripts into a simple sort pattern based on the user's external script order.
  6. Oh, okay. I don't really understand all of what you just said :) But it sounds like those who like to have their scripts external so they can use a different editor will make use of it.
  7. Shaz said:
    Oh, okay. I don't really understand all of what you just said :) But it sounds like those who like to have their scripts external so they can use a different editor will make use of it.
    Okay I'm working on a more descriptive post.  I'm sorry, I'm not very skilled at wordplay.
  8. So basically the sort order is based on filename.
  9. Tsukihime said:
    So basically the sort order is based on filename.
    Yep.