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.

RMXP: HUD - Equipped Item/Weapon in a Pic During Game?

Hey! I want to be able to click on a non-consumable item in the item menu and to therefore cause your character to equip a parallel "weapon" version of the item (so I can easily check what is equipped when you interact with events) and cause it to display or replace a 64x64 image of the item/weapon at the bottom left part of the corner on the map screen (main playing area). I am trying to make a script to do this that you can call in the Scene_Item script, but I am new and not sure what the wording is for some of the commands.

Here is the script as far as I can make it. If someone can just replace the "layman speak" commands with the RMXP ruby code to do what I want--if you can do this for ONE of the items, I can duplicate it and do it for all the items. If there are other areas like "refresh" or update and you know what needs to go in them, please throw them in there, too. This seems simple if I just knew the wording. Seeing this as an example would help me learn Ruby, too!

The script:

#==============================================================================
# ** Window_Weapon
#------------------------------------------------------------------------------
# This window/image displays the weapon equipped through the item screen.
#==============================================================================

class Window_Item < Window_Base (or maybe just making it picture that displays on the Scene_Map screen would be better?
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(16, 398, 64, 64)
refresh
end
#--------------------------------------------------------------------------
# * Show Picture?
#--------------------------------------------------------------------------
def mywep
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []

#--------------------------------------------------------------------------
# * Draw Item Picture In Box at Bottom left of Screen
# index : item number
#--------------------------------------------------------------------------
def draw_mywep(index)
mywep = @data[index]
case mywep

when you click on RPG::Item 0001, non-consumable, in the item menu(called: baseball bat)
play sound effect number 8
replace current Weapon Picture with picture "Baseball Bat" image (x, y)
and equip WEAPON (also called baseball bat)
Create new Scene.map (automatically exit the item menu)

when you click on RPG::Item 0002 (non-consumable, in the item menu)(called: lockpick)
play sound effect number 9
replace MYWEP picture with picture "Lockpick Image" (x, y)
equip WEAPON (also called baseball bat)
Create new Scene.map (automatically exit the item menu)

end

end

Can anyone shed some light on how to "word" this so the program knows what I want to do?
 

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