Breaking the "Show Choices" Character Limit
by RPG Advocate
saved from Phylomortis.Com
Introduction
This script allows you to have "Show Choice" commands that are as long as your text window is wide, rather than the ridiculously low character limit imposed by the editor.
Altered for easier use. The original required you to add your commands directly into the Interpreter class.
# Breaking the "Show Choices" Character Limit
# by RPG Advocate
#==============================================================================
# ** Interpreter (part 1)
#------------------------------------------------------------------------------
# This interpreter runs event commands. This class is used within the
# Game_System class and the Game_Event class.
#==============================================================================
class Interpreter
#--------------------------------------------------------------------------
# * Object Initialization
# depth : nest depth
# main : main flag
#--------------------------------------------------------------------------
alias longchoice_initialize initialize
def initialize(depth = 0, main = false)
@longchoice = []
longchoice_initialize (depth, main)
end
#--------------------------------------------------------------------------
# * Show Text
#--------------------------------------------------------------------------
def command_101
# If other text has been set to message_text
if $game_temp.message_text != nil
# End
return false
end
# Set message end waiting flag and callback
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
# Set message text on first line
$game_temp.message_text = @list[@index].parameters[0] + "\n"
line_count = 1
# Loop
loop do
# If next event command text is on the second line or after
if @list[@index+1].code == 401
# Add the second line or after to message_text
$game_temp.message_text += @list[@index+1].parameters[0] + "\n"
line_count += 1
# If event command is not on the second line or after
else
# If next event command is show choices
if @list[@index+1].code == 102
# If choices fit on screen
if @list[@index+1].parameters[0].size <= 4 - line_count
# Advance index
@index += 1
# Choices setup
$game_temp.choice_start = line_count
# The added long choice system
long_choice if @longchoice != []
setup_choices(@list[@index].parameters)
end
# If next event command is input number
elsif @list[@index+1].code == 103
# If number input window fits on screen
if line_count < 4
# Advance index
@index += 1
# Number input setup
$game_temp.num_input_start = line_count
$game_temp.num_input_variable_id = @list[@index].parameters[0]
$game_temp.num_input_digits_max = @list[@index].parameters[1]
end
end
# Continue
return true
end
# Advance index
@index += 1
end
end
#--------------------------------------------------------------------------
# * Show Choices
#--------------------------------------------------------------------------
def command_102
# If text has been set to message_text
if $game_temp.message_text != nil
# End
return false
end
# Set message end waiting flag and callback
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
# Choices setup
$game_temp.message_text = ""
$game_temp.choice_start = 0
# The added long choice system
long_choice if @longchoice != []
setup_choices(@parameters)
# Continue
return true
end
#--------------------------------------------------------------------------
# * Long Choices
#--------------------------------------------------------------------------
def long_choice
s1 = ""
s2 = ""
s3 = ""
s4 = ""
@list[@index].parameters[0] = []
s1 = @longchoice[0] if @longchoice[0] != nil
s2 = @longchoice[1] if @longchoice[1] != nil
s3 = @longchoice[2] if @longchoice[2] != nil
s4 = @longchoice[3] if @longchoice[3] != nil
@list[@index].parameters[0][0] = s1 if s1 != ""
@list[@index].parameters[0][1] = s2 if s2 != ""
@list[@index].parameters[0][2] = s3 if s3 != ""
@list[@index].parameters[0][3] = s4 if s4 != ""
@longchoice = []
end
end
Instructions
To use this script, place it below Scene_Debug or above Main. It replaces two methods in the interpreter while adding the additional 'longchoice' functions.
To make a set of choices long, create the @longchoice array in a script call just before you use the 'Show Choices' command. The text you enter into the @longchoice array will replace the default text. If you do not specify or create a @longchoice array, the regular text in your choices will show.
Samples
Your regular showchoice call:
Code:
@>Text: What do you want?
@>Show Choices: Whatever, Whatever 2
: When [Whatever]
@>
: When [Whatever 2]
@>
: Branch End
@>
Your longchoice call (two commands):
Code:
@>Text: What do you want?
@>Script: @longchoice = ["To be or not to be," +
"that is the record.", "whatever"]
@>Show Choices: Whatever, Whatever 2
: When [Whatever]
@>
: When [Whatever 2]
@>
: Branch End
@>
Your longchoice call (four commands):
Code:
@>Text: What do you want?
@>Script: @longchoice = ["hi","two",
"To be or not to be... " +
"that is the record.", "whatever"]
@>Show Choices: A, B, C, D
: When [A]
@>
: When [b]
@>
: When [C]
@>
: When [D]
@>
: Branch End
@>
Note that in the @longchoice array, I broke up the 'To be or not to be...' text onto two lines, but connected them into a single string (with the + ). This afforded me the ability to go beyond the normal character limit a single line.