#============================================================================
# EXTRACT EVENTS - Addon Event Specific Command
# v1.01 by Shaz
#----------------------------------------------------------------------------
# This script extracts ALL event commands into a number of text files.
# These can be opened in a spreadsheet, split into columns, searched and
# sorted.
#
# The difference with this and the original script by Shaz is that this
# will run only with the event script command.
# be sure to disable the last line in Shaz's script before playing
#
# Data/Map(id)-Event(id)-Contents.txt
# Contains ALL event commands
# - useful for perusing, searching for anything in any event
# - this also includes everything in the following two files
#
# Data/Map(id)-Event(id)-Dialogue.txt
# A subset of EventContents.txt
# Contains any event commands to do with text - Show Text, Show Choices,
# actor names, etc
# - useful for proofreading and translation (there is no facility to replace
# text with translations - this is JUST an extract)
#
# Data/Map(id)-Event(id)-SwitchesVariables.txt
# A subset of EventContents.txt
# Contains any event commands and conditions to do with switches and variables
# - useful for finding where they've been used
#----------------------------------------------------------------------------
# To Use:
# You "call" this script command with a script command at the start of the event
# export_event
#
# The script will extract the event contents and export
# to text files in data folder
#
# Once the files have been created, open them in a spreadsheet and use the
# Text to Columns feature to separate based on your chosen delimiter
#----------------------------------------------------------------------------
# Terms:
# This is a DEVELOPMENT ONLY script. You may use it when creating free or
# commercial games, but PLEASE remove the script before the game is released.
# You do NOT need to credit me in the game.
# If you share this script, PLEASE keep this header intact, and include a
# link back to the original RPG Maker Web forum post.
#----------------------------------------------------------------------------
# Revisions:
# 1.00 Sep 20 2023 - Initial Publish
#============================================================================
module EVExport
@cb = ","
def self.export_event(map, id)
@file_all = File.open("Data/Map#{map}-Event#{id}-Contents.csv", 'w')
@file_text = File.open("Data/Map#{map}-Event#{id}-Dialogue.csv", 'w')
@event_seq = 3
$game_map.setup($game_map.map_id)
@event = $game_map.events[id]
return if @event.nil? || @event.pages.nil?
for page in [email hidden] - 1
@event_tab = (page + 1).to_s
@cond = @event.pages[page].condition
@list = @event.pages[page].list
self.export_event_list
end
@file_all.close
@file_text.close
end
def self.export_command
# get rid of any double spaces
while @arg.gsub!(/ /) { " " } != nil
end
@expline += 1
indchar = INDENT ? @ind * @indent : ""
text = sprintf("%s%s%s%s%s",
@cmd, @cb, indchar, @arg, @lb)
@file_all.print(text)
@file_text.print(text) if @text_export
end
end
class Game_Interpreter
def export_event
EVExport.export_event(self.map_id, self.event_id)
end
end