Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: KK20 on June 11, 2015, 10:15:28 PM

Title: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: KK20 on June 11, 2015, 10:15:28 PM
Easy Script Importer/Exporter
Authors: KK20
Version: 4.0
Type: Scripts2Files
Key Term: Scripting Tool

Introduction

Ever wanted to export your RPG Maker scripts to .rb files, make changes to them in another text editor, and then import them back into your project? Look no further, fellow scripters.
ESIE is easy to use!


Features


Screenshots

OLD - Version 1.0
(click to show/hide)
Demonstrating Playtest feature:
(click to show/hide)

Demo

None

Script

(click to show/hide)

Instructions

It is all explained in the script. For a quick reference, here's the subfolder instructions:
Code: [Select]
  ** As of Version 4.0, subfolders are now possible!
 
  - Script names that start with the character defined in FOLDER_INDICATOR will
    be subfolders within your exported scripts folder.
  - You can specify the depth of subfolders by increasing the number
    FOLDER_INDICATOR characters.
  - Any scripts below the subfolder will be placed within it.
  - A script name that only consists of FOLDER_INDICATOR characters indicates
    "closing" that subfolder; scripts below will now be placed in the previous
    (i.e. its parent's) subfolder.
  - You may reuse a folder name multiple times. You can have subfolders named
    after script authors and keep their scripts grouped together without
    disrupting your script order (and potentially crashing your project).
 
  Here's an example assuming FOLDER_INDICATOR is set to '@' :
 
  Project Script List       Project Directory
 
                            Scripts_Export_Folder/
  EarlyScript               ├ EarlyScript.rb
  @Base Scripts             ├ Base Scripts/
  @@Game Classes            │ ├ Game Classes/
  Game_Temp                 │ │ ├ Game_Temp.rb
  Game_System               │ │ └ Game_System.rb
  @@Sprite Classes          │ └ Sprite Classes/
  Sprite_Character          │   └ Sprite_Character
  @Custom Scripts           ├ Custom Scripts/
  MyScript                  │ └ MyScript.rb
  @                         │
  Main                      └ Main.rb


Compatibility

This script already has methods to ensure it will run properly on any RPG Maker version. This script does not rely on nor makes changes to any existing scripts, so it is 100% compatible with anything.

Credits and Thanks


Author's Notes

I didn't test this in VX cuz I don't have it. Anyone care to test that for me?
Now I can has version control for my Advance Wars Engine.
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: ForeverZer0 on June 12, 2015, 09:15:36 AM
I have always personally used Win32API to read the .ini file to get the path to the script file. Although practically this would never be different, you never know, so it ensures full compatibility.
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: Blizzard on June 12, 2015, 05:36:58 PM
I'm trying to remember if I ever wrote a script like that. I mean I did write a few, but I can't remember if I ever released one. o.o;
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: KK20 on June 12, 2015, 08:29:43 PM
@F0: I forgot that Scripts was even an entry in the .ini file. I'll go ahead and make that change as it's a more elegant solution.

@Blizz: See? This is what happens when you don't share things :T
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: G_G on June 13, 2015, 07:14:38 AM
http://forum.chaos-project.com/index.php/topic,3923.0.html

But to be fair, yours works with all the engines and reads the ini file for them, rather than assuming its in the Data folder.
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: Blizzard on June 13, 2015, 09:23:54 AM
Oh, there we go. xD
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: KK20 on June 22, 2015, 12:04:13 AM
Updated to include a tab-to-spaces solution.
I was using this in my Advance Wars Engine and realized a lot of my code was terribly indented because of tabs. Easy fix at least :D
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: KK20 on June 23, 2015, 04:59:05 AM
legit double

Updated script again to include a new mode: Playtest (set to 3)
Normally you would have to import your files back into RPG Maker to test your code. This process could get pretty tiring (set mode to 2, playtest, close project, open project, set mode to 0, playtest, crap a bug..., fix bug, repeat) so I made this mode to combat it.

After you have exported your scripts, set the IMPORT_EXPORT_MODE to 3. Now you can make changes to your exported scripts in an external text editor, save the changes to that script's file, and instantly click the playtest button in RPG Maker to "soft import" your scripts and test your code. Saves you like 15 seconds.

tl;dr
(click to show/hide)
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: orochii on June 23, 2015, 05:09:39 PM
Okay, that last update makes this thing like 20 times better and much more useful.

Question! Have you tried using characters like ♥☻☺♦♠•◘♣? It's just that the default script editor has no support for these characters. For instance, I wanted to put a ♥ somewhere in a script (to be seen on screen), but then the script changed it to a ?, and it actually displayed on the game as a ?. I hated that ;_;, I can't express my feelings. </3

Silly question, but it's a question after all.
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: KK20 on June 23, 2015, 10:02:20 PM
Yeah, that's a limitation with RMXP's editor. VXA supports those kind of characters so feel free to use them there.

Thankfully it only affects naming the script and not the code itself. Not sure why one would need to name their scripts with special characters like that though :T
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: Blizzard on June 24, 2015, 11:48:49 AM
Are you sure about this? I used to use these kinds of characters without problems. You just have to make sure to export/import with UTF-8 encoding. Zlib doesn't care what you are using, it seems the scripts just as chunks of data.
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: KK20 on June 24, 2015, 06:08:01 PM
As I stated, it only affects the Script name, but that's the fault of RMXP, not this script at all.
(http://puu.sh/iB6C3/39fcbb95e8.gif)

I've also posted those characters into the body of the script and exported/imported. They still exist and are not converted to question marks.

I also checked the Show Message event command--that will also immediately convert your special characters to question marks (there's nothing this script can do anything about it though; mainly just curious). Using a "print" or "p" will properly display the special characters.
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: KK20 on May 20, 2017, 10:39:29 AM
Was thinking back on this script one day and realized "I could make this a little bit better"...so I did. :)

Updated to version 2.0
Some refactoring and added comments. Most important change though is how the scripts are exported and imported. Originally, I had named exported files something like
[100]Window_Message
where the 100 in this case means this script is located at index 100 in the script list. This was fine and all, but it made adding/removing/changing order of the exported scripts extremely tedious.

Now, I create a CSV file that lists the filenames in order. This completely solves the above problem as you can just edit the CSV file directly to add/remove/move scripts around.

Just needed a good quality-of-life update. I don't see how this script can be improved upon, so this will probably be the definitive version (hence the jump from v1.2 to v2.0).
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: Blizzard on May 20, 2017, 12:35:06 PM
Nice work!
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: KK20 on February 01, 2018, 05:56:28 AM
Updated to Version 3.0 due to some possible human errors that may occur along the way.

Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: KK20 on July 22, 2018, 11:10:46 PM
Updated to Version 4.0:

Thanks to Jaiden for helping test this :up:
Title: Re: [XP][VX][VXA] Easy Script Importer/Exporter
Post by: polypeak on June 13, 2019, 09:35:29 AM
Thanks for the update that creates subfolders great!