Introduction
This script is designed to search throughout your RPGMaker XP's project to to find and record all normally created text dialog to a file. it will search through both the common event database and through each map and map event, recording all texts to a file. The output file created will be entitled "Text Extractor.txt" within your project's folder.
Each line will include the Common Event ID or Map/Event/Page number before listing the text. With this, the report may be able to help proof-readers before a project is released.
Script
The Script
Code:
#==============================================================================
# ** Text Extraction Generator
#------------------------------------------------------------------------------
# version 1.1
# by DerVVulfman
# 10-08-2014
# RGSS and ReGaL Compliant
#==============================================================================
#
# INTRODUCTION:
#
# This script is designed to search throughout your RPGMaker XP's project to
# to find and record all normally created text dialog to a file. it will
# search through both the common event database and through each map and map
# event, recording all texts to a file. The output file created will be
# entitled "Text Extractor.txt" within your project's folder.
#
# Each line will include the Common Event ID or Map/Event/Page number before
# listing the text. With this, the report may be able to help proof-readers
# before a project is released.
#
#
#------------------------------------------------------------------------------
#
# INSTRUCTIONS:
#
# * Insert below your scripts.
# * Run project.
# * Read report when you're done.
#
#
#------------------------------------------------------------------------------
#
# CREDITS:
#
# Inspiration for the system, and suggestion to include both common events
# and show choices text by yamina-chan. Additional suggestion of Troops
# Database text made by Kain_Nobel.
#
#
#------------------------------------------------------------------------------
#
# NOTE:
#
# It only searches through the common event page within the database and the
# events within the map systems. It does not search through custom scripts.
#
#
#==============================================================================
#==============================================================================
# ** Text_Extractor
#------------------------------------------------------------------------------
# This is a module that extracts dialog and text from both map events and
# common events.
#==============================================================================
f.close
end
#--------------------------------------------------------------------------
# * Project Database Values
#--------------------------------------------------------------------------
def self.set_resource_database
@common_list = load_data("Data/CommonEvents.rxdata")
@map_list = load_data("Data/MapInfos.rxdata")
@troop_list = load_data("Data/Troops.rxdata")
end
#--------------------------------------------------------------------------
# * Common Events Database Search
#--------------------------------------------------------------------------
def self.search_resource_common(file)
return if @common_list.nil?
counter = 0
for event in @common_list
next if event.nil?
name = event.name
list = event.list
counter += 1
header = counter.to_s + ") "+ name
search_resource_page_item(file, header, 15, list)
end
end
#--------------------------------------------------------------------------
# * Troop Database Search
#--------------------------------------------------------------------------
def self.search_resource_troop(file)
tcounter = 0
for troop in @troop_list
next if troop.nil?
tcounter += 1
counter = 0
for page in troop.pages.reverse
counter += 1
id = tcounter
name = troop.name
list = page.list
header = id.to_s + ") " + name + " / Pg: " + counter.to_s + " "
search_resource_page_item(file, header, 25, list)
end
end
end
#--------------------------------------------------------------------------
# * Map Database Search
#--------------------------------------------------------------------------
def self.search_resource_map(file)
for map in @map_list
# Get map ID
id = map[0]
# Get Individual Map Data
map_data = load_data(sprintf("Data/Map%03d.rxdata", id))
# Set map event data
events = {}
for i in map_data.events.keys
events[i] = map_data.events[i]
end
# Sorth through Event Array
for event in events
counter = 0
# Sort through Event Pages
for page in event[1].pages.reverse
counter += 1
list = page.list
header = id.to_s + ") EV: " + (event[0]).to_s + " / Pg: " +
counter.to_s + " "
# Sort through event list options
search_resource_page_item(file, header, 25, list)
end
end
end
end
#--------------------------------------------------------------------------
# * Page List Search (whether troop or map pages)
#--------------------------------------------------------------------------
def self.search_resource_page_item(file, header, sized, list)
temp_text = header + " "
temp_text = temp_text[0, sized]
for list_item in list
if [101, 401].include?(list_item.code)
unless list_item.parameters == ''
file.puts temp_text + " <Text:> " + (list_item.parameters).to_s
temp_text = " "
temp_text = temp_text[0, sized]
end
elsif list_item.code == 102
unless list_item.parameters == ''
corey = list_item.parameters[0]
for c in corey
file.puts temp_text + " <Choices:> " + c.to_s
temp_text = " "
temp_text = temp_text[0, sized]
end
end
end
end
file.puts ""
end
end
Too simple. Install it under your scripts and run the game. It does the search for you and makes a report in your project's folder.
Credits
Inspiration for the system, and suggestion to include both common events and show choices text by yamina-chan. And to Kain_Nobel for pointing out a brief lack of battlesystem text that needed to be added.
Compatibility
Designed for use with RPGMaker XP and currently with the Beta version of the ReGaL gaming system in the works.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Thanks to Kain_Nobel for testing its capabilities, a new facet has been added that will go through all TROOPS databases for dialog. This was an oversight, which has been corrected.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
Happened when I tried to use this after allready having generated a .txt once. After I deleted the textfile it worked fine again.
Friendship is born at that moment when one person says to another: "What! You, too? Thought I was the only one." (C.S. Lewis) For the time you're laughing, there's nothing wrong in the world. (Colin Mochrie) If it's funny, make sure people laugh. If it's not funny, make it funny (unless it's actually really serious). (silvercheers)
Please don't spell my name "Yamina-chan". It's all small. Thank you =D
That is extremely strange since I do the same thing. I even tried changing permissions to read-only and the like, and I don't get that error. That is odd.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)