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.

[XP] Simple (mostly) CMS

Hi there. I have been searching for a CMS for one of my projects, and I've decided to post it here. I *think* it will be simple, except I would like a 10-item limit in the inventory, with stacking items. Here's a little mockup thing of the overall layout:
http://i221.photobucket.com/albums/dd16 ... XP/CMS.png[/img]

Black is where the windows go.

If anyone decides to take this request, I will give you full credit and send you the game, if you like, once it's finished. I am also a good writer, so if you need any writing done I'd be glad to help.

Thank you!
 
do you want a limited inventory too (10 items in the whole inventory)? or do you just want it to display first 10 items?
and how do you want this CMS to be opened? would this replace the status scene? or the whole menu?
 
A limited inventory. There is a 10-item storage space in your backpack, and nothing more. (heck, it's only a backpack, people!). This should replace the entire menu.

Thank you for showing interest.
 
http://www.imagefilez.com/out.php/i255953_scr01.PNG[/img]

Code:
class MyWindow1_Status < Window_Base
  
  def initialize(x, y, width, height, actor)
    super(x, y, width, height)
    @actor = actor
    refresh
  end
  
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 20, 0)    
    draw_actor_face(@actor, 0, 30)
    draw_actor_hp(@actor, 0, 130)
    draw_actor_mp(@actor, 0, 150)
  end

end

class MyWindow1_Item < Window_Selectable
  
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @column_max = 2
    self.index = 0
    refresh
  end
  
  def item
    return @data[self.index]
  end
  
  def include?(item)
    return false if item == nil
    if $game_temp.in_battle
      return false unless item.is_a?(RPG::Item)
    end
    return true
  end
  
  def enable?(item)
    return $game_party.item_can_use?(item)
  end
  
  def refresh
    @data = []
    for item in $game_party.items
      next unless include?(item)
      @data.push(item)
      if item.is_a?(RPG::Item) and item.id == $game_party.last_item_id
        self.index = @data.size - 1
      end
    end
    @data.push(nil) if include?(nil)
    @item_max = @data.size
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
  end
  
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    item = @data[index]
    if item != nil
      number = $game_party.item_number(item)
      enabled = enable?(item)
      rect.width -= 4
      draw_item_name(item, rect.x, rect.y, enabled)
      self.contents.draw_text(rect, sprintf(":%2d", number), 2)
    end
  end
  
    def update_help
    @help_window.set_text(item == nil ? "" : item.description)
  end
end

Code:
#==============================================================================
# [RMVX] Scene_MyWindow
#------------------------------------------------------------------------------
# by DivineLight [astragunner2002@gmail.com]
# v0.2 02 June 2008
#==============================================================================

class Scene_Menu < Scene_Base

  def initialize(menu_index = 0)
	@menu_index = menu_index
  end

  def start
	super
  @status_window = MyWindow1_Status.new(375,15,155,210,$game_party.members[0])
  @item_window = MyWindow1_Item.new(20,15,335,210)  
  end

  def terminate
	super
	@status_window.dispose
  @item_window.dispose
  end
  
  def update
	super
	@status_window.update
  @item_window.update
  end
  
end

Still not complete yet, but this is for VX, I don't really know if it's applicable for XP.
My CMS myself is not far different than this anyway.
 

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