westingtyler06
Member
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?
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?