Hi. I'm having problems with the UMS Script I have regarding Choices.
I've tried to modify it myself, but i can't find how to make what i need, and some options i have enabled make the script crash under certain conditions, especially when I have to display two set of Choices in a row,
Right now I want a simple Choices script that displays the Choices centered with the text box fitting the text, in the middle of the screen in a separate window, and that the previous text dissapears.
This is how it's showing right now (deleting some stuff so the script doesnt crash).
I found a script that helps for multiple options, but it's complicated to use in teh event windows.
However, this script lets me put the choices kind of nicely:
However, the size is not good. Tehre's too much space Blank at the right of the text that I want removed, but I have no idea how to take the Auto fitting option from my UMS Script and use it there.
So, basically, to make it simple, is someone could modify that script to make the box fit with the text's width and to be centered, i'd be very thankful.
But, if you could make a new script that modifies the normal Choices text to be located in the middle of the screen and centered, that'd be even better as it would be much easier to work with.
If you have any question about it just ask me and i'll try to explain myself better
I've tried to modify it myself, but i can't find how to make what i need, and some options i have enabled make the script crash under certain conditions, especially when I have to display two set of Choices in a row,
Right now I want a simple Choices script that displays the Choices centered with the text box fitting the text, in the middle of the screen in a separate window, and that the previous text dissapears.
This is how it's showing right now (deleting some stuff so the script doesnt crash).
I found a script that helps for multiple options, but it's complicated to use in teh event windows.
#=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
# Message Choice Window
# Author: ForeverZer0
# Version: 1.0
# Date: 8.5.2010
#=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
#
# Introduction:
# This script will allow you to set up more than the 4 choices that RPGXP
# limits you to. The window will behave much like the default window and is
# very easy to use.
#
# Features:
# - Set up as many choices as you need (within reason)
# - Custom window width, x, and y, or have it center automatically
# - Can allow/disallow the player from canceling out of window
# - Uses a single script call
# - Does not effect the Window_Message class
#
# Instructions:
# - Configuration is just below.
# - Use this script call:
#
# Choices.setup(WIDTH, CHOICES, CANCEL?, X, Y)
#
# WIDTH = width of window
# CHOICES = Array of choices that will be shown. These must be written as a
# string. ex. ['one', 'two', 'three', 'four']
# CANCEL? = Allowed player to cancel with B button? (true/false)
# X, Y = The x and y that the window will be displayed at.
#
# - Not all of these arguments have to be used. The only two that are required
# are the WIDTH and CHOICES array. The rest can be omitted.
# - If the CANCEL? argument is not supplied, it will be true by default.
# - If the X or Y argument is not supplied, the window will auto-center on
# the omitted axis.
#
# - What happens is when a choice is selected, it will set a variable to the
# that choice's number (first choice is 1, second is 2, etc., etc.)
# - If the player is allowed to cancel and the B button is pressed, the
# variable will be set to 0
# - Now all you must do is create conditional branches below the script call
# with the condition for each being your variable equal to the respective
# choice's number.
#
#=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
#===============================================================================
# ** Choices
#===============================================================================
module Choices
# CONFIGURATION
#------------------------------------------------------------------------
Variable_ID = 15
# ID of variable you would like to use for choices.
Window_Opacity = 160
# Opacity of choice window (160 is Window_Message default)
#------------------------------------------------------------------------
# DO NOT CONFIGURE ANYTHING BELOW THIS LINE
def self.setup(width, choices, cancel = true, x = nil, y = nil)
return unless $scene.is_a?(Scene_Map)
$game_system.map_interpreter.message_waiting = true
$game_temp.choice_cancel_type = cancel
$scene.choice_window = Window_Command.new(width, choices)
$scene.choice_window.x = x == nil ? (640 - $scene.choice_window.width)/2 : x
$scene.choice_window.y = y == nil ? (480 - $scene.choice_window.height)/2 : y
$scene.choice_window.back_opacity = Window_Opacity
end
end
#===============================================================================
# ** Scene_Map
#===============================================================================
class Scene_Map
attr_accessor :choice_window
alias zer0_choice_window_main main
def main
zer0_choice_window_main
@choice_window.dispose if @choice_window != nil
end
alias zer0_choice_window_upd update
def update
if @choice_window != nil && @choice_window.active
@choice_window.update
update_choice_window
end
zer0_choice_window_upd
end
def update_choice_window
if Input.trigger?(Input::😎
unless $game_temp.choice_cancel_type
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.cancel_se)
$game_variables[Choices::Variable_ID] = 0
terminate_choice_window
elsif Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
$game_variables[Choices::Variable_ID] = @choice_window.index + 1
terminate_choice_window
end
end
def terminate_choice_window
$game_system.map_interpreter.message_waiting = false
@choice_window.dispose
@choice_window = nil
end
end
#===============================================================================
# ** Interpreter
#===============================================================================
class Interpreter
attr_accessor :message_waiting
end
# Message Choice Window
# Author: ForeverZer0
# Version: 1.0
# Date: 8.5.2010
#=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
#
# Introduction:
# This script will allow you to set up more than the 4 choices that RPGXP
# limits you to. The window will behave much like the default window and is
# very easy to use.
#
# Features:
# - Set up as many choices as you need (within reason)
# - Custom window width, x, and y, or have it center automatically
# - Can allow/disallow the player from canceling out of window
# - Uses a single script call
# - Does not effect the Window_Message class
#
# Instructions:
# - Configuration is just below.
# - Use this script call:
#
# Choices.setup(WIDTH, CHOICES, CANCEL?, X, Y)
#
# WIDTH = width of window
# CHOICES = Array of choices that will be shown. These must be written as a
# string. ex. ['one', 'two', 'three', 'four']
# CANCEL? = Allowed player to cancel with B button? (true/false)
# X, Y = The x and y that the window will be displayed at.
#
# - Not all of these arguments have to be used. The only two that are required
# are the WIDTH and CHOICES array. The rest can be omitted.
# - If the CANCEL? argument is not supplied, it will be true by default.
# - If the X or Y argument is not supplied, the window will auto-center on
# the omitted axis.
#
# - What happens is when a choice is selected, it will set a variable to the
# that choice's number (first choice is 1, second is 2, etc., etc.)
# - If the player is allowed to cancel and the B button is pressed, the
# variable will be set to 0
# - Now all you must do is create conditional branches below the script call
# with the condition for each being your variable equal to the respective
# choice's number.
#
#=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
#===============================================================================
# ** Choices
#===============================================================================
module Choices
# CONFIGURATION
#------------------------------------------------------------------------
Variable_ID = 15
# ID of variable you would like to use for choices.
Window_Opacity = 160
# Opacity of choice window (160 is Window_Message default)
#------------------------------------------------------------------------
# DO NOT CONFIGURE ANYTHING BELOW THIS LINE
def self.setup(width, choices, cancel = true, x = nil, y = nil)
return unless $scene.is_a?(Scene_Map)
$game_system.map_interpreter.message_waiting = true
$game_temp.choice_cancel_type = cancel
$scene.choice_window = Window_Command.new(width, choices)
$scene.choice_window.x = x == nil ? (640 - $scene.choice_window.width)/2 : x
$scene.choice_window.y = y == nil ? (480 - $scene.choice_window.height)/2 : y
$scene.choice_window.back_opacity = Window_Opacity
end
end
#===============================================================================
# ** Scene_Map
#===============================================================================
class Scene_Map
attr_accessor :choice_window
alias zer0_choice_window_main main
def main
zer0_choice_window_main
@choice_window.dispose if @choice_window != nil
end
alias zer0_choice_window_upd update
def update
if @choice_window != nil && @choice_window.active
@choice_window.update
update_choice_window
end
zer0_choice_window_upd
end
def update_choice_window
if Input.trigger?(Input::😎
unless $game_temp.choice_cancel_type
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.cancel_se)
$game_variables[Choices::Variable_ID] = 0
terminate_choice_window
elsif Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
$game_variables[Choices::Variable_ID] = @choice_window.index + 1
terminate_choice_window
end
end
def terminate_choice_window
$game_system.map_interpreter.message_waiting = false
@choice_window.dispose
@choice_window = nil
end
end
#===============================================================================
# ** Interpreter
#===============================================================================
class Interpreter
attr_accessor :message_waiting
end
However, this script lets me put the choices kind of nicely:
However, the size is not good. Tehre's too much space Blank at the right of the text that I want removed, but I have no idea how to take the Auto fitting option from my UMS Script and use it there.
So, basically, to make it simple, is someone could modify that script to make the box fit with the text's width and to be centered, i'd be very thankful.
But, if you could make a new script that modifies the normal Choices text to be located in the middle of the screen and centered, that'd be even better as it would be much easier to work with.
If you have any question about it just ask me and i'll try to explain myself better