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.

RGSSAD save_data fix problem

Hey guys,
I'm using Yeyinde's RGSSAD save_data fix (Here) for my auto-patcher, and I'm using the code:
Code:
 

    @help.set_text("Patching Game Files ")

     if File.exists?(RGSSAD::ENC_FILE)

        # Decrypt the encrypted archive into memory (SLOW)

        @help.set_text("Patching Game Files - Reading Data. . . ")

        RGSSAD.decrypt

        # Add the Marshalled object into the RGSSAD file array

        @help.set_text("Patching Game Files - Arranging Data. . . ")

        for i in 0...@loaded_data.length

          RGSSAD.add_file(Marshal.dump(@loaded_data[i][0]),@loaded_data[i][1])

        end

        @help.set_text("Patching Game Files - Writing Data. . . ")

        # Encrypt the new archive (SLOW)

        RGSSAD.encrypt

     else

        # Use the old save_data if no encrypted archive is present

        for i in 0...@loaded_data.length

          original_save_data(@loaded_data[i][0], @loaded_data[i][1])

        end

     end

 
But it never makes it past "Patching Game Files - Reading Data". It just sits there, no matter how long I leave it.

The contents of @loaded_data is [data read from file (using load_data),path into the archive(eg 'Data/Scripts.rxdata')]
I'm not sure what's wrong - I highly doubt this script would take longer than an hour to decrypt + encrypt a 55mb archive.
The thing is, its the RGSSAD decryption that's having the problems, as when it runs "original_save_data" instead, it patches it perfectly.
I know its a little complex, but I really need help :\
 
It's kind of difficult to tell what is wrong because I was using this RGSSAD script in an old project, and I had no problems, and your script definitely doesn't have any specific errors in it. Did you try running the decrypt method in a fresh project? It seems to me that it's having issues with some specific files, and that it's not necessarily the script.

Also, as far as I know in terms of RGSS scripting structure, it shouldn't show you any of the help set texts except for the last one (for Writing Data), since it will not update the screen unless Graphics.Update is called. Are you running this script in a thread?

Either way, I feel that there is not sufficient data for me or anyone else to be able to dig into this issue for you well enough to find a solution.
 
Graphics.update is run in the loop every time the method RGSSAD.next_key is called, and after being tested with my loading gear script, the screen updates almost every frame.
Due to the fact that Graphics.update is constantly being run, as soon as it finishes decrypting, the help window should change. Oh well.
Thank you for your time, Sarkilas - I'll have to keep looking then :)
 
I've finally got around to do further testing. (3 months later, lol. I was putting it off :P )
Okay, so I've put in some little 'puts's into the code, to print to a command window each time the code does something I deem hefty.
It is 'puts'ing a lot of stuff out, so it is definitely still running and doing things.
I checked the Task Manager and I could see that the Memory usage would go up, but then crash down, and then begin building up again.
How big was your encrypted archive in total when you tested it, Sarkilas? And if possible, could I have a link to your copy of the script?

EDIT: I'm really stumped now.
I started a fresh project, and it used up to 30mb extra memory when decrypting, even though the archive was only 1mb. So I'm thinking that my script is broken xD
It was also a fresh script taken from the post, too.
 

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