RPG Maker Forums

Hey there.

So to cut a long story short - for a few hours now I have been completely puzzled as to why my game isnt reading the data back in correctly at load.

Here is the code that is 'saving / loading' my data...

def self.save_game_without_rescue File.open(filename, "wb") do |file| Marshal.dump({ :space_shooter => $space_shooter }, file) end return true end def self.load_game_without_rescue p "Loading Data" File.open(filename, "rb") do |file| Marshal.load(file) extract_save_contents(Marshal.load(file)) end p "Loaded Data #{$space_shooter}" return true end def self.extract_save_contents(data) $space_shooter = data[:space_shooter] endNow for whatever reason - it is making the save file no problem. But when I try to load the data back in is not allowing it.

If I remove the rescue clause for the loading process I get an end of file error :/

Not really sure whats causing this..

anyone have any insight on that?

Or alternatively - anyone have a way for me to save a global variable to be re-utilized when the game is next loaded?

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,048
Messages
1,018,545
Members
137,834
Latest member
EverNoir
Top