+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: Universal Message System Cancel Choices Fix (/thread-4161.html)
Universal Message System Cancel Choices Fix - DerVVulfman - 05-22-2012
Universal Message System Cancel Choices Fix Version 1.1
Introduction
After noticing that version 1.8.0 of ccoa's UMS contained a bug whereby the 'Show Choices' window had difficulties with cancelled options, this fix was made. The bug was where the default window of 1-4 choices was set to branch to a 5th 'cancelled' option, that option would exit out altogether. This fix returns that capability.
Show Choices with more than 4 visible options didn't have the problem and isn't touched.
Script
The Script
Code:
#==============================================================================
# ** Universal Message System: Cancel Choices Fix
#------------------------------------------------------------------------------
# by DerVVulfman
# version 1.1
# 05-22-2012
# RGSS / RPGMaker XP
#==============================================================================
#
# INTRODUCTION:
#
# After noticing that version 1.8.0 of ccoa's UMS contained a bug whereby the
# 'Show Choices' window had difficulties with cancelled options, this fix was
# made. The bug was where the default window of 1-4 choices was set to branch
# to a 5th 'cancelled' option, that option would exit out altogether. This
# fix returns that capability.
#
# Show Choices with more than 4 visible options didn't have the problem and
# isn't touched.
#
#------------------------------------------------------------------------------
#
# INSTALLATION:
#
# Paste it directly below the UMS, and the fix is done.
#
#==============================================================================
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# Refer to "$game_temp" for the instance of this class.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :detected_ums_cancel # flag for canceled choices in UMS
end
#==============================================================================
# ** Window_Message
#------------------------------------------------------------------------------
# This message window is used to display text.
#==============================================================================
class Window_Message < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias ums_fix_initialize initialize
def initialize
# Set the 'detected cancel' flag to nil
$game_temp.detected_ums_cancel = nil
# Perform the original call
ums_fix_initialize
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias ums_fix_update update
def update
# if the message window is showing
if @contents_showing
# Cancel
if Input.trigger?(Input::B)
if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
# Turn the 'detected cancel' flag on if set to less than 2 windows
$game_temp.detected_ums_cancel = true if $game_temp.num_choices <= 1
end
end
end
# Perform the original call
ums_fix_update
end
end
#==============================================================================
# ** Interpreter
#------------------------------------------------------------------------------
# This interpreter runs event commands. This class is used within the
# Game_System class and the Game_Event class.
#==============================================================================
class Interpreter
#--------------------------------------------------------------------------
# * When Cancel
#--------------------------------------------------------------------------
def command_403
# If choices are cancelled
if @cancel_flag
# Delete branch data
@branch.delete(@list[@index].indent)
# Continue
return true
end
# If it doen't meet the condition and 'detected cancel' not found: command_skip
return command_skip unless $game_temp.detected_ums_cancel == true
# Reset the 'detected cancel' flag
$game_temp.detected_ums_cancel = nil
end
end
Instructions
Just plug n play. Paste below the UMS to get it to work.
Credits and Thanks
To both Ccoa who made the original system and Taylor (Jirby Taylor) who found the bug.
Terms of Use
Due credit to both ccoa, the original author, and Taylor (or Jirby Taylor) who found the bug.
Compatibility and Installation
Designed solely for the RPGMaker XP version of the UMS.
RE: Universal Message System Cancel Choices Fix - Taylor - 05-22-2012
Thanks... but... it doesn't seem to work. . -. I even tested to see if including at least one event command per branch, or having four branches would do... it still ignores it, jumping to stuff afterwards.
The hell.
It would be swell if you'd refer to me as Jaabi Taylor in credits (if at all) when this works.
Taylor? I kinda left in a temporary value name. Look at the bottom of the script and you'll find a global variable called $frankenheimer. Yeah, like the director. Change it to $game_temp.detected_ums_cancel and you'll be set.
Meanwhile.... bump to version 1.1.
*HEADDESKS*
RE: Universal Message System Cancel Choices Fix - Taylor - 05-23-2012
SUCCESS.
After removing a stray $. :V
But yey, An important feature that I somehow never discovered failing... fixed.