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.

Unexpected file format

yesterday,I worked in RPG,suddenly the computer closed .
Now,I opened again my game in editor and I receive :
"Unexpected file format"
I worked a lot of it
what can I do?
 
1. Start by creating a new project.

2. Backup the "Data" directory of the new project.

3. Drag over your mapinfos.rxdata and try to open the new project - the tree view of maps might look wierd, but if it opens at all, that file is ok. If it isn't, replace it with the mapinfos.rxdata from your backup - then open the new project and create at least as many maps as you had in the old project. If you had to resort to creating maps, copy all of the map files to the bakup as well.

4. Then drag over the map files from your old porject one by one, always trying to open the new project after each one. If it doesn't open, replace the last map file with the one with the same name from your backup, and then continue with the rest. Do this until all working maps are in the new project as well.

5. Start doing the same thing with all other .rxdata files - copying one and replacing it with the backup if it doesn't work. Common Events will have to be treated like the map files.

6. When you're done, you should now have saved everything you can.

These are the files I've seen messed up most often: MapInfos, the Common Event equivalent, the Actor data and the Scripts.
 
You're saying scripts.rxdata was the corrupted file? That's too bad :/

You could try saving some of the data. Here's a quote from Blizzard:
The Scripts.rxdata is compressed, but I don't know with which algorithm (LZW maybe?). All that I was able to do is to retreive undamaged script slots from a damaged Scripts.rxdata. I would have lost the modded Scene_Name from my game otherwise. It wasn't hard to make, I just didn't feel like making it again, so I simply tried to figure out how the file is structured instead. There's some stuff in the header that indicated how many slots there are and then comes the compressed data of those slots. I was able to set the count in the header to 1 and remove the slots I didn't need. I loaded it into a new project and, voila, there was my Scene_Name, luckily one of the undamaged scripts. I almost lost a month of script work on CP. >.<

If you want to export it as .txt file, you will have to make a decoder. If you want to export it into another Scripts.rxdata, you will need an encoder as well. That's all I can tell you. I can take a look at how big the header is in bytes. Here's a useful tool if you wanna try it yourself. *adds attachment* I wouldn't have been able to make DREAM if I didn't have this. :D

And one from Zeriab:
I totally for got to tell how to decompress the script data.

Each slot in the script array contains another 3-element array.

      1. A number which use I do not know
      2. The name of the slot you can give in the script editor
      3. The actual script itself, compressed


For decompressing the script data you use Zlib::Inflate.inflate(string). As an example consider this snippet which decompresses the third script in the editor (from the top).
Code:
Code:
 scripts = load_data('Data\Scripts.rxdata')
p Zlib::Inflate.inflate(scripts[2][2])

I'm really not "high" on this kind of stuff, but you could try asking them both about your problems.
 
A couple of suggestions....

Change the Title of the Topic to, "Unexpected file format" - Please Help  (or something descriptive like that.)
Remember, other people can benefit from this topic.

On your second question, do a search on "Add Command Menu", I know there are several topics that address this.
I just did that search, and the top two results both address that question.

In the future, when you have a completely different question, and you could not find an answer using 'search',
post a new topic with a descriptive title:  "how can I add a command to the menu?"

Thank you for participating!  :)
 

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