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.

Array Question

I was wondering how to make an array for icons. The script is already set up and usually for words you can type something like CHARA_R = ["Night Elf","","",""] for heroes 1-4.

But, through trial and error, i have found its not that simple for icons. I tried something like the words: CHARA_I = [("Item-01")","","","")]
and have tried inserting the RPG::Cache icon words everywhere.

So i was also thinking perhaps it would be something like this(?)

game.actor.001
RPG::Cache icon = ("Item-01")

game actor.002
RPG::Cache icon = ("Item-02")

I know, i have put the self.contents.blt (forgot what goes here) in the place where the other self.contents are. Right now all I have figured out is how to show the same icon for all characters.
I know i got some words wrong, but basically which one is it?

Note: I am using the character bio script, if that helps at all.
 
An array for bitmaps of icons? If so, use this:
Code:
array = []
array[0] = RPG::Cache.icon("filename")
array[1] = RPG::Cache.icon("filename")
array[2] = RPG::Cache.icon("filename")
array[3] = RPG::Cache.icon("filename")
 
OK, I need to show a different icon/picture for each actor in a window.

EDIT:
I was thinking something along the lines of this:

$game_actors[1]
RPG::Cache icon = ("Item-01")
elsif
$game_actors[2]
RPG::Cache icon = ("Item-02")

etc etc etc...
Only now i need to know where do i put this line or if i even need it:
src_rect = Rect.new(0, 0, 32, 32)

And if I need only one of these to show the icon, or one for every actor?
self.contents.blt(5, 5, icon, src_rect)

Thanks to all who help.
 

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