webgovernor
Member
Hi all,
The Problem: Can't access saved hashes.
Here's my object array, or hash, or whatever
Example:
The above info has already been set.
Now, when I save the quest under the Scene_Save class in the SDK, the quest saves fine(or so I think), here's an example of my code under the write_data def:
And finally here's my load code under Scene_Load (read_data def):
My problem:
The data has been saved, and the quest name was displayed via the "p" command during the saving process, BUT when I LOAD the data, $quest[1] returns NIL.
Now, the object itself returns "" (not nil) when using "p $quest.to_s" instead of "p $quest[1].name"
So the $quest object is loading, but the hash part of it was either not saved, or not loaded, or both.
I'm rather lost on this subject and I would be extremely grateful if someone could help.
Thanks in advance,
Webgovernor.
The Problem: Can't access saved hashes.
Here's my object array, or hash, or whatever
Example:
Code:
$quest[1].name = "Choco Monkey"
$quest[1].description = "Find me a delicious chocolate monkey for my belly."
The above info has already been set.
Now, when I save the quest under the Scene_Save class in the SDK, the quest saves fine(or so I think), here's an example of my code under the write_data def:
Code:
Marshal.dump($quest, file)
p $quest[1].name #i already accepted this quest to test it.
And finally here's my load code under Scene_Load (read_data def):
Code:
$quest = Marshal.load(file)
p $quest[1].name
My problem:
The data has been saved, and the quest name was displayed via the "p" command during the saving process, BUT when I LOAD the data, $quest[1] returns NIL.
Now, the object itself returns "" (not nil) when using "p $quest.to_s" instead of "p $quest[1].name"
So the $quest object is loading, but the hash part of it was either not saved, or not loaded, or both.
I'm rather lost on this subject and I would be extremely grateful if someone could help.
Thanks in advance,
Webgovernor.