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.

4 Questions for new CMS (Item stuff)

Woohoo, working on another script! I'm doing a custom CMS, starting piece by piece starting with Window and Scene_Item :grin:

http://i224.photobucket.com/albums/dd288/Kain_Nobel/KN_CMS-Window_Item.png[/img]
Removed due to size, I'll pastebin it later.

Question #1

Anyways, on this line, I need to know how to change it based on which category you pick, the items are listed by element tagging (ie; "Useable Items" and "Key Items", then "Equipment" that switches you to the equipment menu.) How do I element tag any other item being seperate from "Key Items"?

Code:
class Window_Item
  #...
  #--------------------------------------------------------------------------
  # * Get Item
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #...
end

Question #2
If you look at the screenshot of the new setup, its very basic, the text in the command window (top) and help window (bottom) doesn't show anything yet, for one reason or another, I graphic edited the words into it. o.O

How do I get the text to really show on the commands and help? I don't know why it doesn't show, I've got it written like this...

Code:
class Window_ItemCommand
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height -32)
    @commands = ["Use Items", "Key Items", "Equipment")
    #...
  end
  #--------------------------
  # * Draw Item (index, color
  #--------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    @rect_x = 160 + index * 160 + 4
    @rect_y = 0
    @rect_width = 118
    @rect_height = 32
    rect = Rect.new(@rect_x, @rect_y, @rect_width, @rect_height)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
  #----------------
  # * Update Method
  #----------------
  def main
    draw_item(0, normal_color)
    draw_item(1, normal_color)
    draw_item(2, $game_temp.equipment_disabled ? normal_color : disabled_color)
    #...
  end
end

Question #3

I need to resolve the issue global opacity for Window_Item and Window_Help, I defined it in the scene too, but it doesn't seem to apply.

Code:
CMS_Opacity = 160
#.....
class Scene_Item
  def main
    
    # Create Window_Item
    @window_item = Window_Item.new
    #...
    @window_item.opacity = CMS_Opacity
    
    # Create window_command
    @window_command = Window_ItemCommand.new
    #...
    @window_command.opacity = CMS_Opacity
    
    # Create Window_Help for items
    @window_help = Window_Help.new
    #...
    @window_help.opacity = CMS_Opacity
    #...
  end
end

Question #4

I was going to add a category for sorting too (by alphabet, min/max number of items, type, etc), but first I want to get the basics :shades: If anybody has a link to a good guide to help me do that, that'd be cool too.
 

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