I was wondering if it would be possible to convert RPG Advocate's "Breaking the "Show Choices" Character Limit" (originally found at Phylomortis.Com and saved
here) from XP to VX? The reason being, I like using Yanfly's CMS and don't want to change to a more complex message system but would still like to use a feature like this.
# 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