Extract Events to Text File

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,783
Reaction score
12,209
First Language
English
Primarily Uses
RMMV
Extract Events to Text File 1.01
Shaz
Introduction
This is a DEVELOPMENT script (should not be included in released games) that will let you extract the contents of ALL of your events into text files that can be opened and viewed in a spreadsheet.
This is for VIEWING events only - checking your event logic, proofreading (or as a starting point for translation), searching for switch/variable/item usage, etc. There is NO facility to make changes to these files and merge the changes back into the game. I will not be creating such a facility.


Versions
Code:
1.01  22 Jun 2014   Fix crash with troop event conditions

Features
- Optionally extract common events
- Optionally extract battle events
- Extract events from all maps, or from a single map
- Open extracted data in a spreadsheet to convert to columns, browse, search and sort
- Data/_EventContents.txt contains ALL event commands
- Data/_EventDialogue.txt contains all event commands causing text to be displayed (Show Text, Show Choices, name processing, etc)
- Data/_EventSwitchesVariables.txt contains all event commands and conditions that use or change switches or variables

Screenshots

Data/_EventContents.txt converted to columns:
Data/_EventDialogue.txt converted to columns:
Data/_EventSwitchesVariables.txt converted to columns:
How to Use
Copy and paste the script into a new slot in Materials, below all other scripts.
Check the customize options. They are explained in the script header, and the constants/variables to change are in the first few lines of script.

Enable or disable the script by commenting out the entire thing. It does not use switches or get called - if it's not commented out, it runs.
Run your game. When your title screen appears, the script has run and the files have been created.
Close the game and disable the script (Ctrl A, Ctrl Q will select and disable, or select and enable the whole thing).

Open the .txt files and copy and paste the contents into spreadsheets.
Use the spreadsheet's Convert Text to Columns feature to separate the text using a delimiter. The default delimiter is the ^ character.

Script
Download here

FAQ


Credit and Thanks
- You do NOT need to list me in your game credits if you use this script - it is for development only and should be removed before you release your game
- Okay to use in development of commercial games

Author's Notes
Missing parameters
On some event commands I have not included all the parameters (for example, Show Picture and Move Picture do not include the Zoom parameters).
I don't have a complete list of these.
If you use a command and discover some of its parameters are missing, please post below with the command name and the missing parameters, and I will include it in a future update.

Stuff not included
I don't extract the sprite name or autonomous move route details from event pages.
I should do this.
I will include it in a future update.

BUGS!!!
I have not tested every single event command with every single possible combination of options.
I fully expect that some of you will be using commands I have not yet tested, and MAY result in the script crashing before the title screen appears.
If this happens, please take a screenshot of the error message, or type the FULL error message text here EXACTLY as it appears in the error window.
Also indicate in your post what version of the script you are using.
Then disable the script so you can continue working on your game while waiting for a fix.

Bug Fixes
Any bugs and fixes will be listed here until they are added to a new version.

 
Last edited by a moderator:

Sidbot

Villager
Member
Joined
Oct 16, 2012
Messages
21
Reaction score
4
Primarily Uses
Is it possible to do this extraction with the database? I'm just curious, great script.
 

djDarkX

Retro & Remastered Music Guru
Veteran
Joined
Jan 17, 2013
Messages
2,699
Reaction score
1,892
First Language
Music
Primarily Uses
RMMV
This is...*sniff*...beautiful.  Nice work on this.  This will come in handy for many-a-developer!
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,033
Reaction score
338
First Language
indonesian
i know it's off topic. but might give you idea :D .

do you have extract 'ruby' class to text file?

for example: extract(Scene_Battle)

will print the final content of Scene_Battle like in script editor. final content means after all those aliasing and overwriting. :D . but i guess it's really hard... not sure can ruby do something like that? (printing class)
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,075
First Language
English
will print the final content of Scene_Battle like in script editor. final content means after all those aliasing and overwriting. :D . but i guess it's really hard... not sure can ruby do something like that? (printing class)
You are better off searching on ruby forums for that kind of things.


You can easily read and parse the scripts so I don't see why not. Not that "parsing" a script is trivial but it's not "hard" either.
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,779
Reaction score
10,998
First Language
English
Primarily Uses
RMVXA
I do hope that I haven't done something stupid again, but when I go to playtest after inserting the script I get this error message:

Script 'Shaz event extract' line 1167: TypeError occurred

can't convert Symbol into Integer
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,783
Reaction score
12,209
First Language
English
Primarily Uses
RMMV
Please see the spoiler at the bottom of the first post. I just found this one myself yesterday and posted a fix there.


Line 1167, change

Code:
['None', 'Rain', 'Storm', 'Snow'][@params[0]]
to
Code:
@params[0]
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,779
Reaction score
10,998
First Language
English
Primarily Uses
RMVXA

Jomarcenter

jomarcenter-MJM
Veteran
Joined
Apr 24, 2012
Messages
1,242
Reaction score
182
First Language
ENGLISH
Primarily Uses
RMMV
This is very useful if anyone who will sent the game for translating to a different language.
 

mayhem4masses

Villager
Member
Joined
Sep 5, 2012
Messages
14
Reaction score
1
First Language
English
Primarily Uses
This is a great script, however I got tis error message whenever I try to run it.

Script 'Text Script' Line 111: Errno::EACCES occurred.

Permission denied - Data/_EventDialogue.txt

Any ideas? Thanks!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,783
Reaction score
12,209
First Language
English
Primarily Uses
RMMV
Did you run it once then open the text file and have it open while you ran it again? If not, I'd suspect wherever your game project is is in a place that MS doesn't like you updating (like Program Files)
 

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,405
Reaction score
1,731
First Language
English
Primarily Uses
N/A
This has been out for four months? How have I not seen this yet, it's one of the most potentially useful scripts I've seen since Tsukihime's extra event conditions script. Between the two of them creating and debugging events will be easier than ever. Such a simple yet wonderful idea.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,783
Reaction score
12,209
First Language
English
Primarily Uses
RMMV
... Tsukihime's extra event conditions script. Between the two of them creating and debugging events will be easier than ever.
keep in mind, the extract script will NOT be looking for extra event conditions from Hime's script. If you want those extracted too, you will need to modify the script to look for them and pull out switches, variables, whatever else might be in there.
 

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,405
Reaction score
1,731
First Language
English
Primarily Uses
N/A
keep in mind, the extract script will NOT be looking for extra event conditions from Hime's script. If you want those extracted too, you will need to modify the script to look for them and pull out switches, variables, whatever else might be in there.
I appreciate the friendly warning Shaz but you give yourself to little credit sometimes. The event conditions are set using comments, so it actually does extract them as well. Even if it didn't I meticulously comment scripted functions in my events because I tend to get some really interesting and lengthy events sometimes... So far this script has worked out perfectly for me as is.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,783
Reaction score
12,209
First Language
English
Primarily Uses
RMMV
Yes, they'll be extracted as comments.


But what I mean is, if you use Hime's script to add extra conditions to a page, those will JUST be shown as comments in the extracted file, NOT as conditions of the page. And if they happen to contain switches and variables, the switches/variables file that gets created will not include those lines. Because the script does not know about Hime's script, all it can do is extract them AS comments, and not as they are really interpreted by your game.


So you couldn't then look at the switches/variables file and be confident that it contains ALL uses of switches/variables in the game, because it would not include any in those comments ;)
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,779
Reaction score
10,998
First Language
English
Primarily Uses
RMVXA
I need to find every instance of 'defence' to change it to 'defense', so tried using the event extract script.  However, when I try loading up the game, I get this error message.



I have no idea what to do.  The only customisation I've done is to set both 'extract battle events' and 'expand move routes' to false.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,783
Reaction score
12,209
First Language
English
Primarily Uses
RMMV
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
21,779
Reaction score
10,998
First Language
English
Primarily Uses
RMVXA
Arghh.  I'm a cretin.  sorry about that.

(slinks off, shame-faced)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts


Spending the day reworking my maps, especially the first "biome". This time it's not even in the dark. :LZSwink:
Activity on the forums has increased lately, probably because of people staying home. The amount of work for moderators has increased lol.
At this point I've gotten so tired of April Fools on the internet that last year I just refused to even post anything on the RMW Social Media on April Fools in protest. Considering doing it again.
I posted a funny gag reel of Drifty's video's here, but realized it was probably too riskay, so I deleted it, oops, lol.
Another room (actually other half of previous room)

Forum statistics

Threads
95,519
Messages
929,759
Members
125,783
Latest member
vashx
Top