Main Menu
  • Welcome to The RPG Maker Resource Kit.

[RMVXA]Hash help please?

Started by Shinami, July 15, 2012, 08:30:55 PM

0 Members and 1 Guest are viewing this topic.

Shinami

It has been AGES since I've touched scripting much less RPG Maker. So, I'm fuzzy as can be on how to script with hashes. Everything I remember says this code block should work without ANY problems. What am I doing wrong?


  def self.r12_mission
    list = {} #INIT HASH list { ID => mission name, mission desc}
    list = {
    1 => self.name(1), self.desc(1),
    2 => self.name(2), self.desc(2),
    3 => self.name(3), self.desc(3),
    4 => self.name(4), self.desc(4),
    5 => self.name(5), self.desc(5),
    6 => self.name(6), self.desc(6)
    }
    return list 
  end

cozziekuns

Unless I'm mistaken, each value of the hash should be in array form.


list = {
  1 => [self.name(1), self.desc(1)],
  2 => [self.name(2), self.desc(2)],
  ...
}

Shinami

*hangs head in shame* I forgot something so simple...well, at least I realized what I was doing wrong in another section of the script after a cigarette break. Ironically, it was something simple there too.