Kain Nobel
Member
I thought maybe I was calling the script wrong, yet it didn't error pop so I know I called it correctly, but I can't seem to get the KGC Multi-Equip script to affect my CMS. Is there something I need to do to make the extra equip slots show up? Here is a copy of the CMS's Equip Windows/Scene.
If you need a copy of the KGC script and can't find it, let me know and I'll pastebin the script.
If somebody could do a compatibility fix for me, that'd be most awesome, but if not I'll try and figure it out myself (although I don't understand that script's coding very well.)
If you need a copy of the KGC script and can't find it, let me know and I'll pastebin the script.
If somebody could do a compatibility fix for me, that'd be most awesome, but if not I'll try and figure it out myself (although I don't understand that script's coding very well.)
Code:
################################################################################
#===============================================================================
# ** Window_EquipItem
#-------------------------------------------------------------------------------
# This window displays choices when opting to change equipment on the
# equipment screen.
#===============================================================================
class Window_EquipList < Window_Selectable
#-----------------------------------------------------------------------------
# * Object Initialization
# actor : actor
# equip_type : equip region (0-3)
#-----------------------------------------------------------------------------
def initialize(actor, equip_type)
super(320, 256, 320, 160)
@actor = actor
@equip_type = equip_type
@column_max = 1
self.active = false
self.index = -1
self.opacity = CMS_Opacity
refresh
end
#-----------------------------------------------------------------------------
# * Item Acquisition
#-----------------------------------------------------------------------------
def item
return @data[self.index]
end
#-----------------------------------------------------------------------------
# * Refresh
#-----------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# Add equippable weapons
if @equip_type == 0
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
@data.push($data_weapons[i])
end
end
end
# Add equippable armor
if @equip_type != 0
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and armor_set.include?(i)
if $data_armors[i].kind == @equip_type-1
@data.push($data_armors[i])
end
end
end
end
# Add blank page
@data.push(nil)
# Make a bit map and draw all items
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max-1
draw_item(i)
end
end
#-----------------------------------------------------------------------------
# * Draw Item
# index : item number
#-----------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
x = 4 + index
y = index * 32
case item
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
#-----------------------------------------------------------------------------
# * Help Text Update
#-----------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
################################################################################
#===============================================================================
# ** Window_EquipLeft
#-------------------------------------------------------------------------------
# This window displays actor parameter changes on the equipment screen.
#===============================================================================
class Window_EquipStatus < Window_Base
#-----------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#-----------------------------------------------------------------------------
def initialize(actor)
super(-5, 64, 325, 352)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = CMS_Opacity
@actor = actor
refresh
end
#-----------------------------------------------------------------------------
# * Refresh
#-----------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_portrait(@actor, 8, -5)
draw_actor_name(@actor, 108, 0)
draw_actor_level(@actor, 216, 0)
draw_actor_parameter(@actor, 0, 64, 'atk')
draw_actor_parameter(@actor, 0, 96, 'pdef')
draw_actor_parameter(@actor, 0, 128, 'mdef')
draw_actor_parameter(@actor, 0, 160, 'eva')
draw_actor_parameter(@actor, 0, 192, 'str')
draw_actor_parameter(@actor, 0, 224, 'dex')
draw_actor_parameter(@actor, 0, 256, 'agi')
draw_actor_parameter(@actor, 0, 288, 'int')
if @atk != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 64, 40, 32, "»", 1)
@color = @atk > @actor.atk ? color_upgrade : color_downgrade
@color = @atk != @actor.atk ? @color : system_color
self.contents.font.color = @color
self.contents.draw_text(200, 64, 36, 32, @atk.to_s, 2)
end
if @pdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 96, 40, 32, "»", 1)
@color = @pdef > @actor.pdef ? color_upgrade : color_downgrade
@color = @pdef != @actor.pdef ? @color : system_color
self.contents.font.color = @color
self.contents.draw_text(200, 96, 36, 32, @pdef.to_s, 2)
end
if @mdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 128, 40, 32, "»", 1)
@color = @mdef > @actor.mdef ? color_upgrade : color_downgrade
@color = @mdef != @actor.mdef ? @color : system_color
self.contents.font.color = @color
self.contents.draw_text(200, 128, 36, 32, @mdef.to_s, 2)
end
if @eva != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 160, 40, 32, "»", 1)
@color = @eva > @actor.eva ? color_upgrade : color_downgrade
@color = @eva != @actor.eva ? @color : system_color
self.contents.font.color = @color
self.contents.draw_text(200, 160, 36, 32, @eva.to_s, 2)
end
if @str != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 192, 40, 32, "»", 1)
@color = @str > @actor.str ? color_upgrade : color_downgrade
@color = @str != @actor.str ? @color : system_color
self.contents.font.color = @color
self.contents.draw_text(200, 192, 36, 32, @str.to_s, 2)
end
if @dex != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 224, 40, 32, "»", 1)
@color = @dex > @actor.dex ? color_upgrade : color_downgrade
@color = @dex != @actor.dex ? @color : system_color
self.contents.font.color = @color
self.contents.draw_text(200, 224, 36, 32, @dex.to_s, 2)
end
if @agi != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 256, 40, 32, "»", 1)
@color = @agi > @actor.agi ? color_upgrade : color_downgrade
@color = @agi != @actor.agi ? @color : system_color
self.contents.font.color = @color
self.contents.draw_text(200, 256, 36, 32, @agi.to_s, 2)
end
if @int != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 288, 40, 32, "»", 1)
@color = @int > @actor.int ? color_upgrade : color_downgrade
@color = @int != @actor.int ? @color : system_color
self.contents.font.color = @color
self.contents.draw_text(200, 288, 36, 32, @int.to_s, 2)
end
end
#-----------------------------------------------------------------------------
# * Set parameters after changing equipment
# new_atk : attack power after changing equipment
# new_pdef : physical defense after changing equipment
# new_mdef : magic defense after changing equipment
#-----------------------------------------------------------------------------
def set_new_parameters(atk, pdef, mdef, eva, str, dex, agi, int)
if @atk != atk or @pdef != pdef or @mdef != @mdef or @eva != eva or
@str != str or @dex != dex or @agi != agi or @int != int
@atk = atk
@pdef = pdef
@mdef = mdef
@eva = eva
@str = str
@dex = dex
@agi = agi
@int = int
refresh
end
end
end
################################################################################
#===============================================================================
# ** Window_EquipCommand
#-------------------------------------------------------------------------------
# Commands : "Custom" - "Optimize" - "Remove All" - "Exchange"
#===============================================================================
class Window_EquipCommand < Window_Selectable
#-----------------------------------------------------------------------------
# * Initialize Method
#-----------------------------------------------------------------------------
def initialize
# Create Selectable
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = CMS_Opacity
# Create Commands, item and column max
s1 = "Custom"
s2 = "Optimize"
s3 = "Remove All"
s4 = "Exchange"
@commands = [s1, s2, s3, s4]
@item_max = 4
@column_max = 4
# By default, this window is active and visible
self.active = true
self.visible = true
self.opacity = CMS_Opacity
self.index = 0
# Draw Commands
@color = $game_temp.cms_disable_equip != false ? normal_color : disabled_color
draw_item(0, @color)
draw_item(1, @color)
draw_item(2, @color)
draw_item(3, @color)
update
end
#-----------------------------------------------------------------------------
# * Draw Item (index, color)
#-----------------------------------------------------------------------------
def draw_item(index, color)
# Set font color
self.contents.font.color = color
# Rect x, y, width, height settings
@rect_x = (index * 160) + 6
@rect_y = 0
@rect_width = 118
@rect_height = 32
# Create Rect
rect = Rect.new(@rect_x, @rect_y, @rect_width, @rect_height)
# Fill Color
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
# Draw Command Text
self.contents.draw_text(rect, @commands[index], 1)
end
#-----------------------------------------------------------------------------
# * Help Text Update
#-----------------------------------------------------------------------------
def update_help
case self.index
when 0
text = CMS_Help_EquipCommand01
when 1
text = CMS_Help_EquipCommand02
when 2
text = CMS_Help_EquipCommand03
when 3
text = CMS_Help_EquipCommand04
else
text = ""
end
@help_window.set_text(text)
end
end
################################################################################
#===============================================================================
# ** Scene_Equip
#-------------------------------------------------------------------------------
# This class performs equipment screen processing.
#===============================================================================
class Scene_Equip
#-----------------------------------------------------------------------------
# * Object Initialization
# actor_index : actor index
# equip_index : equipment index
#-----------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
@equip_index = equip_index
end
#-----------------------------------------------------------------------------
# * Main Processing
#-----------------------------------------------------------------------------
def main
# View Map behind windows.
if CMS_ShowMap == true
@spriteset = Spriteset_Map.new
end
# Get actor
@actor = $game_party.actors[@actor_index]
# Make windows
@w_help = Window_Help.new
@w_help.y = 416
@w_status = Window_EquipStatus.new(@actor)
@w_equip = Window_Equip.new(@actor)
@w_command = Window_EquipCommand.new
@w_item01 = Window_EquipList.new(@actor, 0)
@w_item02 = Window_EquipList.new(@actor, 1)
@w_item03 = Window_EquipList.new(@actor, 2)
@w_item04 = Window_EquipList.new(@actor, 3)
@w_item05 = Window_EquipList.new(@actor, 4)
# Associate help window
@w_command.help_window = @w_help
@w_equip.help_window = @w_help
@w_item01.help_window = @w_help
@w_item02.help_window = @w_help
@w_item03.help_window = @w_help
@w_item04.help_window = @w_help
@w_item05.help_window = @w_help
# Set cursor position
@w_equip.index = @equip_index
refresh
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@w_help.dispose
@w_command.dispose
@w_status.dispose
@w_equip.dispose
@w_item01.dispose
@w_item02.dispose
@w_item03.dispose
@w_item04.dispose
@w_item05.dispose
@spriteset.dispose if CMS_ShowMap == true
end
#-----------------------------------------------------------------------------
# * Refresh
#-----------------------------------------------------------------------------
def refresh
# Set item window to visible
@w_item01.visible = (@w_equip.index == 0)
@w_item02.visible = (@w_equip.index == 1)
@w_item03.visible = (@w_equip.index == 2)
@w_item04.visible = (@w_equip.index == 3)
@w_item05.visible = (@w_equip.index == 4)
# Get currently equipped item
item1 = @w_equip.item
# Set current item window to @w_item
case @w_equip.index
when 0
@w_item = @w_item01
when 1
@w_item = @w_item02
when 2
@w_item = @w_item03
when 3
@w_item = @w_item04
when 4
@w_item = @w_item05
end
# If right window is active
if @w_equip.active
# Erase parameters for after equipment change
@w_status.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
end
# If item window is active
if @w_item.active
# Get currently selected item
item2 = @w_item.item
# Change equipment
last_hp = @actor.hp
last_sp = @actor.sp
@actor.equip(@w_equip.index, item2 == nil ? 0 : item2.id)
# Get parameters for after equipment change
atk = @actor.atk
pdef = @actor.pdef
mdef = @actor.mdef
eva = @actor.eva
str = @actor.str
dex = @actor.dex
agi = @actor.agi
int = @actor.int
# Return equipment
@actor.equip(@w_equip.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
# Draw in left window
@w_status.set_new_parameters(atk, pdef, mdef, eva, str, dex, agi, int)
end
end
#-----------------------------------------------------------------------------
# * Frame Update
#-----------------------------------------------------------------------------
def update
# Update windows
@w_command.update
@w_status.update
@w_equip.update
@w_item.update
refresh
# If @w_command window is active: call update_command
if @w_command.active
update_command
return
end
# If @w_equip is active, call update equip
if @w_equip.active
update_equip
return
end
# If item window is active: call update_list
if @w_item.active
update_list
return
end
end
#-----------------------------------------------------------------------------
# * Update Command Window
#-----------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(CMS_Index_Equip)
return
end
# If C Button Pressed
if Input.trigger?(Input::C)
# Play Decision SE
$game_system.se_play($data_system.decision_se)
case @w_command.index
when 0 # Custom
command_customize
when 1 # Optimize
command_optimize
return
when 2 # Remove All
command_removeall
return
when 3 # Exchange?
command_exchange
end
end
# If R button was pressed
if Input.trigger?(Input::R)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To next actor
@actor_index += 1
@actor_index %= $game_party.actors.size
# Switch to different equipment screen
$scene = Scene_Equip.new(@actor_index)
return
end
# If L button was pressed
if Input.trigger?(Input::L)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To previous actor
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# Switch to different equipment screen
$scene = Scene_Equip.new(@actor_index)
return
end
@w_command.update_help
end
#-----------------------------------------------------------------------------
# * Command : Customize
#-----------------------------------------------------------------------------
def command_customize
# Play Decision SE
$game_system.se_play($data_system.decision_se)
# Window Activity
@w_equip.active = true
@w_command.active = false
end
#-----------------------------------------------------------------------------
# * Command : Optimize
#-----------------------------------------------------------------------------
def command_optimize
# Play Equip SE
$game_system.se_play($data_system.equip_se)
end
#-----------------------------------------------------------------------------
# * Command : Remove-All
#-----------------------------------------------------------------------------
def command_removeall
# Play Equip SE
$game_system.se_play($data_system.equip_se)
end
#-----------------------------------------------------------------------------
# * Command : Exchange
#-----------------------------------------------------------------------------
def command_exchange
# Play Equip SE
$game_system.se_play($data_system.equip_se)
end
#-----------------------------------------------------------------------------
# * Update Equip Window
#-----------------------------------------------------------------------------
def update_equip
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
@w_command.active = true
@w_equip.active = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If equipment is fixed
if @actor.equip_fix?(@w_equip.index)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Activate item window
@w_equip.active = false
@w_item.active = true
@w_item.index = 0
return
end
# If R button was pressed
if Input.trigger?(Input::R)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To next actor
@actor_index += 1
@actor_index %= $game_party.actors.size
# Switch to different equipment screen
$scene = Scene_Equip.new(@actor_index, @w_equip.index)
return
end
# If L button was pressed
if Input.trigger?(Input::L)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To previous actor
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# Switch to different equipment screen
$scene = Scene_Equip.new(@actor_index, @w_equip.index)
return
end
end
#-----------------------------------------------------------------------------
# * Update Window_EquipList
#-----------------------------------------------------------------------------
def update_list
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Activate right window
@w_equip.active = true
@w_item.active = false
@w_item.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Play equip SE
$game_system.se_play($data_system.equip_se)
# Get currently selected data on the item window
item = @w_item.item
# Change equipment
@actor.equip(@w_equip.index, item == nil ? 0 : item.id)
# Activate right window
@w_equip.active = true
@w_item.active = false
@w_item.index = -1
# Remake right window and item window contents
@w_equip.refresh
@w_item.refresh
return
end
@w_item.update_help
end
end