[Resolved]How to create this config

Started by Ryex, May 10, 2009, 11:21:31 pm

Previous topic - Next topic

Ryex

May 10, 2009, 11:21:31 pm Last Edit: May 11, 2009, 12:09:58 am by Ryexander
I making a script and you need to set up weapons like so in the config

$data_weapons[1].bla = 7
$data_weapons[1].otherbla = true

my question is what class/module
would I have this in so that it works?

Game_System?
Module RPG?
I'm not sure

thanks for the help
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Aqua

You can put that virtually anywhere.
I think... :P

Ryex

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

G_G

Quote from: Ryexander on May 10, 2009, 11:21:31 pm
I making a script and you need to set up weapons like so in the config

$data_weapons[1].bla = 7
$data_weapons[1].otherbla = true

my question is what class/module
would I have this in so that it works?

Game_System?
Module RPG?
I'm not sure

thanks for the help


Make a new slot for script whatever and do this

module RPG
  class Weapon
    def bla
      case id
      when weapon id then return true/false/number
      end
      return true/false/number
    end
  end
end


Than to call it you use
$data_weapons
  • .bla
    example
    print $data_weapons[1].bla

    Will print what the weapon id's bla is

Ryex

Not what I was Asking G_G but Resolved anyway.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />