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.

How to draw icon of currently equipped armour ?

Jason

Awesome Bro

Hi,

So as a custom script for Cryaotic, I'm making him a custom script, which is basically an Equipment Preview window, that is located under the Equip_Right window,

Now, I've got it all working except for one thing, how do I draw the icon of the currently equipped armour onto the window ? This is the only thing that's stopping me from finishing it...

Also, cause I was doing it the easy way around, how do I disable all armour except Body Armour ? Basically, I just set the list box to contain two options, and renamed the Shield to Armour, he's happy with this, although we've found a few glitches between us, where if you equip another armour type, you can't unequip it, which is kind of bad.

Thanks for any help,
~JBrist.
 
So you want to display the icon of the currently equipped... what? just armor or just weapons or both or what?

And you mean something like:

draw_equip_icon(args)

in window_base, right?
 
well i dont no anything really to do scripting
but would'nt you be able to set each armour to display,
For EG

Code:
 

class Window_Icon < Window_Base

  def initialize(actor)

    super(272, 64, 368, 192)

    self.contents = Bitmap.new(width - 32, height - 32)

    @actor = actor

    refresh

    self.index = 0

  end

 def refresh

    self.contents.clear

    @data = []    

    @data.push($data_weapons[@actor.weapon_id]) # Delete This Line

    @data.push($data_armors[@actor.armor1_id])# Delete This Line 

    @data.push($data_armors[@actor.armor2_id])# Delete This Line

    @data.push($data_armors[@actor.armor3_id])

    @data.push($data_armors[@actor.armor4_id])# Delete This Line 

    @item_max = @data.size

    self.contents.font.color = system_color

    self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)# Delete This Line 

    self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)# Delete This Line 

    self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)# Delete This Line 

    self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)

    self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)# Delete This Line 

    draw_item_name(@data[0], 92, 32 * 0)# Delete This Line 

    draw_item_name(@data[1], 92, 32 * 1)# Delete This Line 

    draw_item_name(@data[2], 92, 32 * 2)# Delete This Line 

    draw_item_name(@data[3], 92, 32 * 3

    draw_item_name(@data[4], 92, 32 * 4)# Delete This Line 

  end

end

 

Not sure though sorry just my geuss eaing though the Windw_Equip scripts.
 
Do you want it to display the name of the equiped item also?

If so, this should work:
[rgss] 
# don't forget to set the actor (@actor = $game_party.actors[<number>])
draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
# use any of the equipments you want.
 
[/rgss]

If not, this should work:

[rgss] 
# set the actor (@actor = $game_party.actors[<number>])
item = $data_weapons[@actor.weapon_id]
# Replace weapon_id with the equipment you want.
# 'weapon' is weapon
# 'armor1' is, i think, shield
# 'armor2' is i think, body armor
# 'armor3' is helmet
# 'armor4' is accessory
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
 
[/rgss]
 

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