Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Multi+Slot Issues with w/ Equip_item

I'm using Guillaume777's Multi-Slot Equipment Script

http://www.rmxp.org/forums/showthread.php?t=8883

and also this script, who I am actually not sure made it so if you know let me know

#================================================
# ====Create a new script above main and put all that code in it. ======
#================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ?œ ƒIƒuƒWƒFƒNƒg?‰ŠÃƒÂº‰Ã‚»
#--------------------------------------------------------------------------
alias xrxs_mp1_initialize initialize
def initialize(actor, equip_type)
xrxs_mp1_initialize(actor, equip_type)
self.x = 272
self.width = 368
self.contents = Bitmap.new(width - 32, height - 32)
@column_max = 1
refresh

end


def item
return @data[self.index]
end
# --------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
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)
end
end
end
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.kind == @equip_type-1
@data.push($data_armors)
end
end
end
end
@data.push(nil)
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = 16
for i in 0...@item_max-1
draw_item(i)
end
s = @data.size-1
self.contents.draw_text(4, s*32, 100, 32, "[Remove]")
end
# --------------------------------
def draw_item(index)
item = @data[index]
x = 4
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 + 288, y, 16, 32, ":", 1)
self.contents.draw_text(x + 304, y, 24, 32, number.to_s, 2)
end
# --------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end



end


#==============================================================================
# â–  Scene_Equip
#------------------------------------------------------------------------------
#  装備画面の処理を行うクラスです。
#==============================================================================

class Scene_Equip
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor_index : アクターインデックス
# equip_index : 装備インデックス
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
@equip_index = equip_index
end
#--------------------------------------------------------------------------
# ● メイン処理
#--------------------------------------------------------------------------
def main
@actor = $game_party.actors[@actor_index]
@help_window = Window_Help.new
@left_window = Window_EquipLeft.new(@actor)
@right_window = Window_EquipRight.new(@actor)
@item_window1 = Window_EquipItem.new(@actor, 0)
@item_window2 = Window_EquipItem.new(@actor, 1)
@item_window3 = Window_EquipItem.new(@actor, 2)
@item_window4 = Window_EquipItem.new(@actor, 3)
@item_window5 = Window_EquipItem.new(@actor, 4)
@right_window.help_window = @help_window
@item_window1.help_window = @help_window
@item_window2.help_window = @help_window
@item_window3.help_window = @help_window
@item_window4.help_window = @help_window
@item_window5.help_window = @help_window
@right_window.index = @equip_index
refresh
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@help_window.dispose
@left_window.dispose
@right_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
@item_window1.visible = (@right_window.index == 0)
@item_window2.visible = (@right_window.index == 1)
@item_window3.visible = (@right_window.index == 2)
@item_window4.visible = (@right_window.index == 3)
@item_window5.visible = (@right_window.index == 4)
item1 = @right_window.item
case @right_window.index
when 0
@item_window = @item_window1
newmode = 0
when 1
@item_window = @item_window2
newmode = 1
when 2
@item_window = @item_window3
newmode = 1
when 3
@item_window = @item_window4
newmode = 1
when 4
@item_window = @item_window5
newmode = 1
end
if newmode != @left_window.mode
@left_window.mode = newmode
@left_window.refresh
end
if @right_window.active
@left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil)
end
if @item_window.active
item2 = @item_window.item
last_hp = @actor.hp
old_atk = @actor.atk
old_pdef = @actor.pdef
old_mdef = @actor.mdef
old_str = @actor.str
old_dex = @actor.dex
old_agi = @actor.agi
old_int = @actor.int
old_eva = @actor.eva

@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
new_eva = @actor.eva
@left_window.changes = [0, 0, 0, 0, 0, 0, 0, 0, 0]
if new_atk > old_atk
@left_window.changes[0] = 1
end
if new_atk < old_atk
@left_window.changes[0] = -1
end
if new_pdef > old_pdef
@left_window.changes[1] = 1
end
if new_pdef < old_pdef
@left_window.changes[1] = -1
end
if new_mdef > old_mdef
@left_window.changes[2] = 1
end
if new_mdef < old_mdef
@left_window.changes[2] = -1
end
if new_str > old_str
@left_window.changes[3] = 1
end
if new_str < old_str
@left_window.changes[3] = -1
end
if new_dex > old_dex
@left_window.changes[4] = 1
end
if new_dex < old_dex
@left_window.changes[4] = -1
end
if new_agi > old_agi
@left_window.changes[5] = 1
end
if new_agi < old_agi
@left_window.changes[5] = -1
end
if new_int > old_int
@left_window.changes[6] = 1
end
if new_int < old_int
@left_window.changes[6] = -1
end
if new_eva > old_eva
@left_window.changes[7] = 1
end
if new_eva < old_eva
@left_window.changes[7] = -1
end
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str,
new_dex, new_agi, new_int, new_eva)
end
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
@left_window.update
@right_window.update
@item_window.update
refresh
if @right_window.active
update_right
return
end
if @item_window.active
update_item
return
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (ライトウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_right
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(2)
return
end
if Input.trigger?(Input::C)
if @actor.equip_fix?(@right_window.index)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@right_window.active = false
@item_window.active = true
@item_window.index = 0
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip.new(@actor_index, @right_window.index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Equip.new(@actor_index, @right_window.index)
return
end
end
#--------------------------------------------------------------------------
# ● フレーム更新 (アイテムウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
def update_item
# B ボタンが押された場合
if Input.trigger?(Input::B)
# キャンセル SE を演奏
$game_system.se_play($data_system.cancel_se)
# ライトウィンドウをアクティブ化
@right_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C)
# 装備 SE を演奏
$game_system.se_play($data_system.equip_se)
# アイテムウィンドウで現在選択されているデータを取得
item = @item_window.item
# 装備を変更
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
# ライトウィンドウをアクティブ化
@right_window.active = true
@item_window.active = false
@item_window.index = -1
# ライトウィンドウ、アイテムウィンドウの内容を再作成
@right_window.refresh
@item_window.refresh
return
end
end
# --------------------------------

# --------------------------------

end

















#==============================================================================
# â–  Window_EquipLeft
#------------------------------------------------------------------------------
#  装備画面で、アクターのパラメータ変化を表示するウィンドウです。
#==============================================================================

class Window_EquipLeft < Window_Base
# --------------------------------
attr_accessor :mode
attr_accessor :changes
# --------------------------------
def initialize(actor)
super(0, 64, 272, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = 24
self.z += 100
actor_num = actor.id

@actor = actor


refresh
end
# --------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 4, 32)
draw_actor_parameter(@actor, 4, 64, 0)
draw_actor_parameter(@actor, 4, 96, 1)
draw_actor_parameter(@actor, 4, 128, 2)
draw_actor_parameter(@actor, 4, 192, 3)
draw_actor_parameter(@actor, 4, 224, 4)
draw_actor_parameter(@actor, 4, 256, 5)
draw_actor_parameter(@actor, 4, 288, 6)
draw_actor_parameter(@actor, 4, 320, 7)
if @new_atk != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 64, 40, 32, "≈", 1)
self.contents.font.color = @actor.atk < @new_atk ? system_color :
@actor.atk > @new_atk ? disabled_color :
normal_color
self.contents.draw_text(180, 64, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 96, 40, 32, "≈", 1)
self.contents.font.color = @actor.pdef < @new_pdef ? system_color :
@actor.pdef > @new_pdef ? disabled_color :
normal_color
self.contents.draw_text(180, 96, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 128, 40, 32, "≈", 1)
self.contents.font.color = @actor.mdef < @new_mdef ? system_color :
@actor.mdef > @new_mdef ? disabled_color :
normal_color
self.contents.draw_text(180, 128, 36, 32, @new_mdef.to_s, 2)
end
if @new_str != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 192, 40, 32, "≈", 1)
self.contents.font.color = @actor.str < @new_str ? system_color :
@actor.str > @new_str ? disabled_color :
normal_color
self.contents.draw_text(180, 192, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 224, 40, 32, "≈", 1)
self.contents.font.color = @actor.dex < @new_dex ? system_color :
@actor.dex > @new_dex ? disabled_color :
normal_color
self.contents.draw_text(180, 224, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 256, 40, 32, "≈", 1)
self.contents.font.color = @actor.agi < @new_agi ? system_color :
@actor.agi > @new_agi ? disabled_color :
normal_color
self.contents.draw_text(180, 256, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 288, 40, 32, "≈", 1)
self.contents.font.color = @actor.int < @new_int ? system_color :
@actor.int > @new_int ? disabled_color :
normal_color
self.contents.draw_text(180, 288, 36, 32, @new_int.to_s, 2)
end
if @new_eva != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 320, 40, 32, "≈", 1)
self.contents.font.color = @actor.eva < @new_eva ? system_color :
@actor.eva > @new_eva ? disabled_color :
normal_color
self.contents.draw_text(180, 320, 36, 32, @new_eva.to_s, 2)
end


end
# --------------------------------
def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex,
new_agi, new_int, new_eva)
flag = false
if new_atk != @new_atk || new_pdef != @new_pdef || new_mdef != @new_mdef
flag = true
end
if new_str != @new_str || new_dex != @new_dex || new_agi != @new_agi || new_eva != @new_eva
flag = true
end

if new_int != @new_int
flag = true
end

@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
@new_eva = new_eva
if flag
refresh
end
end
# --------------------------------
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = actor.atk
when 1
parameter_name = $data_system.words.pdef
parameter_value = actor.pdef
when 2
parameter_name = $data_system.words.mdef
parameter_value = actor.mdef
when 3
parameter_name = $data_system.words.str
parameter_value = actor.str
when 4
parameter_name = $data_system.words.dex
parameter_value = actor.dex
when 5
parameter_name = $data_system.words.agi
parameter_value = actor.agi
when 6
parameter_name = $data_system.words.int
parameter_value = actor.int
when 7
parameter_name = "Evasion"
parameter_value = actor.eva
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 112, 32, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end


end


It works fine, it shows everything for the normal slots and even the Left hand slot, but for any additional armor slots the lower right window, which I think is Equip_Item(?), is gone, its just a black space. You can't remove items in those slots or equip new ones, it's really weird. Can anyone tell me how to fix it?


P.S. I was goofy with a different equipment scrip tthat required me to change Window_Equip_Left;/Right/Item so when I removed that script to ues the uncredited equipment script above, I replaced each of those with the original scripts for each of those (copied from a brand new project) so if that has something to do with it let me know.

Here's a screen shot of what I'm talking about.

 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top