The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: WcW on May 16, 2007, 09:51:45 PM

Title: Data_system Help [Request]
Post by: WcW on May 16, 2007, 09:51:45 PM
I need to know how I can add $data_system.word.runes, because I'm trying to add a secondary currency.
Title: Re: Data_system Help [Request]
Post by: modern algebra on May 16, 2007, 10:00:54 PM
meh, just define a new variable.

It's not as if you can set it up in the database regardless.

At least, that's what I'd do. I am sure one of our actual scripters will abruptly enter and give 100 reasons why my way is bad  :P

I guess that's life  ;D
Title: Re: Data_system Help [Request]
Post by: Zeriab on May 16, 2007, 11:09:34 PM
I do not know why you would want that so badly.
It doesn't hurt to show you I guess
Here's a version where runes is set to an empty array if you try to read it before writing to it:

module RPG
  class System
    class Words
      def runes
        @runes = []   if @runes.nil?
        return @runes
      end
      attr_writer :runes
    end
  end
end


Just paste this anywhere before you use it ^_^
Title: Re: Data_system Help [Request]
Post by: WcW on May 17, 2007, 12:06:08 AM
I'm creating multiple currencies, I am going to do three currently: Gold, Runes, and Fishing Points.  I need this to finish the other currencies, thanks!!
Title: Re: Data_system Help [Request]
Post by: Kokowam on May 17, 2007, 12:06:45 AM
Fishing points could just be stored in a game variable. XP So could runes? :P
Title: Re: Data_system Help [Request]
Post by: WcW on May 17, 2007, 12:15:28 AM
Yes, but I want to be able to make a shop with them, therefore, I need currency and a slightly remodeled shop.  You see, I'm capable of basic scripting, probably once I get use to scripting I'll be capable of moderate RGSS abilities, and I just needed to know how to do that so I can make it as real as I want.  Thanks again for the help.

P.S. If I seem a little irritated, go check Error? and OBEY ME! to see why.