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.

HBGames

i would like to add an attribute to all items called sort_order, for my custom sort method im writing. however no matter what i try i cant seem to get it to work. mostly because im not sure how to set the new attribute for every item. could some one please exsplain to me? ive tried searching but nothing i found was what i was looking for. i got this, not sure if it is right.
[rgss]class RPG::Item
  alias_method :plague180_rpg_item_init,          :initialize
  attr_accessor :sort_order
  def initialize()
    plague180_rpg_item_init
    @sort_order
  end  
end
[/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