Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Resolved] No Marshal Dump and End of File errors

Status
Not open for further replies.
Short Version
I receive errors when I try to save or load a game. The errors occur in the scene_save and scene_load scripts respectively. I'm unsure of what scripts are causing these errors. I would like for someone to do some troubleshooting for me and download my project file and look into the scripts.

I have a feeling that I'm having some compatibility problems with Selwyn's cursor script and one of my other scripts. The odd thing is that I have another project file with the same exact scripts that works fine. So I deleted every script from the project that was giving me issues and I copy/pasted every script from the working project into the other one. After doing so, I was able to save and load just fine. But then I realized that I left out a script. I added Sandgolem's animation wait script and then I ran into the save/load problems. So then I thought that maybe Selwyn's script had to be the last script so I moved Sandgolem's. After I did that, I was still having problems. So I removed Selwyn's script and Sandgolem's and I still had the same problems. It seems as though that I did something when I tried to add another script.

I'm looking for a way to fix the errors but still be able to add additional scripts as needed. If you read the long version, you'll see that the culprit may be the adding of a new script, regardless of what the script was. Please help. This is very frustrating.

Project with script problem
http://www.megaupload.com/?d=AFIO2QKV
 

Anonymous

Guest

Got it. It's definately the Animation Wait script, the problem is that it adds a Sprite_Character object to Game_Player, and Sprite_Character can't be written using Marshal.dump.

Looking into solutions.

EDIT:

Add this line:

Code:
    $game_player.sg_charactersprite = nil

right before this one:

Code:
    Marshal.dump($game_player, file)

in Scene_Save. As far as I can tell, that should have no negative effects. You'll need to delete all your old save files, they're no good.
 
I added that line but I still received the same error. I went ahead and removed the animation wait script because it's not that important to me and the save/load systems seem to be working. The strange thing is, I thought that I had received this error before adding the animation script. Here's hoping that I don't get this error again. Thank you for pinpointing the problematic script for me.

Since you have my file on hand, do happen to know how to add the cursor to the save/load windows? I'm using a windowskin with no highlight box in my project.

If not, that's okay. Thanks again for looking into this for me.
 

Anonymous

Guest

You did put the line before and not after, right?

I could have sworn I answered the save file window question once. Maybe it wasn't you.

First, add this

Code:
    @cursor = Sprite.new
    @cursor.bitmap = RPG::Cache.picture("cursor")
    @cursor.z = 10000
    @cursor.x = x
    @cursor.y = y + 24
    @cursor.visible = false

right after this

Code:
    super(0, 64 + file_index % 4 * 104, 640, 104)

Then replace the update_cursor_rect method with this

Code:
  def update_cursor_rect
    if @selected
      @cursor.visible = true
    else
      @cursor.visible = false
    end
  end

and add this method

Code:
  def dispose
    super
    @cursor.dispose
  end

You may need to play with the x coordinate a little, I tried it in your project file and it seemed to overlap the word File a little. Maybe x - 4 instead on this line

Code:
    @cursor.x = x
 
You're right. You did help me. This was around the same time that I added the animation wait script and I kept receiving the marshal error and I thought it was because of something that I did. I remember I also had trouble disposing the cursor because I wasn't sure where to add the dispose code. It works now. Thank you very much for your time and patience.
 

Anonymous

Guest

It's no problem at all. ^_^ Next time, if you have a problem with something I say, feel free to PM me or pester me about it. I tend to think faster than I can type, so sometimes stuff comes out all wrong or confusing.
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top