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.

Equip HUD

I'm using Mr. Moes SBABS, and I want to make this script work so that when, you toggle between characters, the equipment in the HUD switches to the currently playing character instead of staying the same, if that makes since. I don't know how to do it exactly, because i'm terrible at scripting, but I tried to figure it out myself and I couldn't. I think it's because there needs to be a update and refresh method in there somewhere, but i havn't the most faint idea where.

Anyways, here's the script:
Code:
#_______________________________________________________________________________
# MOG MPW Equip V1.1            
#_______________________________________________________________________________
# By Moghunter   
#_______________________________________________________________________________
if true # True = Enable / False = Disable (Script)
module MOG
#Disable Window Switch ID.
EQPMAPVIS = 5  
#Window opacity. 
EQPMAPOPA = 0
#Windowskin name.
EQPMAPSKIN = "001-Blue01"
#HUD Position.
EQPMAPX = 290 #X Pos
EQPMAPY = 390 #Y Pos
end
$mogscript = {} if $mogscript == nil
$mogscript["mpequip"] = true
###############
# Window_Base #
###############
class Window_Base < Window  
def draw_equip_map(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x + 3, y + 34, bitmap, Rect.new(0, 0, 24, 24))
end
def draw_mequip(x, y)
mequip = RPG::Cache.picture("Mequip")    
cw = mequip.width 
ch = mequip.height 
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch + 65 ,mequip, src_rect)
end
end
####################
# Window_Equip_Map #
####################
class Window_Equipmap < Window_Base 
def initialize(actor)
super(0, 0, 190, 100)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = MOG::EQPMAPOPA
self.windowskin = RPG::Cache.windowskin(MOG::EQPMAPSKIN)
@actor = actor
refresh
end  
def refresh
self.contents.clear
draw_mequip(0,0)
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
self.contents.font.color = system_color
draw_equip_map(@data[0], 32 * 0, 0)
draw_equip_map(@data[1], 32 * 1, 0)
draw_equip_map(@data[2], 32 * 2, 0)
draw_equip_map(@data[3], 32 * 3, 0)
draw_equip_map(@data[4], 32 * 4, 0)
end
end
#############
# Scene_Map #
#############
class Scene_Map
alias mog8_main main
def main
@actor = $game_party.actors[0]
@eqmap = Window_Equipmap.new(@actor)
@eqmap.x = MOG::EQPMAPX
@eqmap.y = MOG::EQPMAPY
if $game_switches[MOG::EQPMAPVIS] == false
@eqmap.visible = true  
else
@eqmap.visible = false     
end      
mog8_main
@eqmap.dispose
end
alias mog8_update update
def update
if $game_switches[MOG::EQPMAPVIS] == false
@eqmap.visible = true  
else
@eqmap.visible = false     
end  
if $eref == true
@eqmap.refresh
$eref = false
end
mog8_update
end  
end  
############
# Game_Map #
############
class Game_Map 
attr_accessor :eref
end
class Interpreter
def eref
$eref = true
end
alias mog319ref command_319
def command_319
eref
return mog319ref
end
end
end

Any help would be greatly appreciated.

~Thanks.
 

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