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.

CMS

I'm currently try to learn how to make a CMS (as a request and as part of my learning script).  If someone could make one and explain it (I don't care how it's set up, just how to configure the menu), that would be great.  If not, I would appreciate some pointers on how to work with the menu.

Also, I need to know how to make a selection image appear next to the choices (when selected) in the menu.


On a side note, could someone please explain how to script call a certain method from a script that I wrote.  Let's say that the class the method is in is called Bank_System and the method is called interest_rate.  Would it be something like this?: $bank_system.interest_rate

Thanks in advance for the help!
 

khmp

Sponsor

I've never put any effort into creating a CMS so I would be learning it as well. But what you are indeed asking is a request. As such you have placed it into the wrong section. For pointers I really suggest viewing a CMS at code level. ccoa's UMS or slipknot's AMS are both fine examples.

Second part. You can make a global instance of a class and wield it anywhere within RMXP and that's perfectly acceptable. You can also still use a class but important variables are class variables. Those kind I like to refer to as singleton values. But anyway they work like this:

Code:
class Test
  @@test = nil
  def test=(test)
    @@test = test
  end

  def test
    return @@test
  end
end

test1 = Test.new
test1.test = 'Woah' # Set @@test
test2 = Test.new
p test2.test # 'Woah'

They are shared across all instances of the "Test" class. Or you can call it like this:

Code:
class Test
  @@test = nil
  def self.test=(test)
    @@test = test
  end

  def self.test
    return @@test
  end
end

Test.test = 'Test'# outputs naughty, no need to create an instance on the class.
p Test.test # 'Test'

The second one doesn't even need to be instantiated to use. Then all the other logic relative to Test can be made private or handled in the background or some you may only them to be able to access if they create an instance of the class.

Good luck with it AbyssalLord! :thumb: Much luck in your learning experience.
 

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