Author Topic: Ever Rebuild while your Game was Running ... Here's How to fix it.  (Read 11191 times)

0 Members and 1 Guest are viewing this topic.

Offline Cloudee1

Sooner or later it happens to everybody. You code in some room, added in a programControl() and had no way to exit the screen besides the windows button when you actually tested it. Then you were so eager to fix whatever you were testing that you forget to actually close the now minimized Dos window. Then you compiled and then it happens, you hit the rebuild game button. SciStudio does not like this one bit, not one bit at all.

Congratulations you have now corrupted your game all while watching sci studio crash to a something strange happened error. When the dust clears, you spot it. That Dos window,hiding out down there in the task bar looking all innocent. Don't worry, your game isn't lost in fact there is a really really simple way to get everything back up and running again.

Enter your game's folder. When you look at the file names, you should notice that there is no resource.001 file, instead there is something named respak.tmp. This wierd new file is in fact your resource file and all you need to do to fix it is simply rename it to it's original resource.001

That's it, you have saved your game from the brink of utter destruction. Well it happens to me alot anyway, and there's nothing so scary as that first time. Hope this makes someone elses first time a little less scary.
« Last Edit: December 20, 2006, 04:33:16 AM by Cloudee1 »


Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #1 on: July 09, 2010, 08:16:41 AM »
Does this technique only work for fixing SCI Studio (not Companion) environments?  I've corrupted my own work several times now, and I was unsuccessful at recovering (admittedly, I only attempted to recover after the first failure).

Let's hear it for regular backups people!
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Cloudee1

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #2 on: July 09, 2010, 03:50:57 PM »
Did you corrupt your game by rebuilding while it was running? I have done that a couple of times while using companion and the technique is similar. Companion creates a backup or alternate, or whatever you want to call it,  resource and resource map file. Rename those back to their regular names, and your ready to roll again.

I did have a game get corrupted in companion that was not because of rebuilding, it apparantly just went to crap and yes, a backup was my only option in that case. luckily I was still able to extract my new views and access the scripts so I simply copied and pasted the new stuff to the old version. All and all I was able to get everything back to how it was at the time of corruption in just about an hour or so.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #3 on: July 11, 2010, 04:36:10 PM »
Yeah, I corrupted the game by rebuilding while it was running within companion.  Next time it happens, I'll go looking for the 'backup' resource files.  Thanks for pointing me in the right direction.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline gumby

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #4 on: July 23, 2010, 03:10:17 PM »
Didn't take long and I corrupted again.  This time I exited SCI Comp, renamed resource.001.bak to resource.001, reopened Comp and everything was just fine.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Collector

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #5 on: November 30, 2010, 02:37:24 AM »
While going through these threads it occurred to me that this should not be that hard to put a check in the compiler to see if the game's EXE is running before it starts its compile. If using DOSBox to run the game you might need to check to see if DOSBox is running instead. Now if the source gets cleaned up and commented enough for someone to take this on.
KQII Remake Pic

Offline Doan Sephim

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #6 on: December 28, 2020, 10:52:52 PM »
I managed to really screw up something.

I did the rebuild while the game was open causing the issue this thread is about. While trying to fix the issue I didn't realize I was NOT actually changing the file extension while I was doing it. I renamed respak to resource.001, but it was still a tmp file. I didn't realize I hadn't changed the extention because extensions were hidden in my settings. So basically I had something called resource.001.tmp, which clearly wasn't going to do anything. I'm not sure how or why, but I did have a resource.001 file already in the folder. I opened the game in companion and everything was blank. I rebuilt the resources (which I think was the big mistake) and now when I do change the correct file to a .001 file and not a .tmp file, when I try to open the game, It's all blank.

The only thing I'd like to salvage is the artwork even if everything else is gone. I have the resource file, is there anyway to mine it for resources or am I basically just out of luck.

It looks like the rebuild blanked out the resource.map file. It's almost completely empty. Wow! It was very foolish of me to not create a whole copy of this before doing what I did!
« Last Edit: December 28, 2020, 11:00:11 PM by Doan Sephim »
Artificial Intelligence Competition

Offline Kawa

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #7 on: December 29, 2020, 07:53:01 AM »
You can in fact extract all your resources from a lone .001 file! Just run Resource resource.001 and get all your files back.

It should just work. I just gave it the .001 file from SCI Tetris and the only complaint was several older copies of the main script.

Offline Doan Sephim

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #8 on: December 29, 2020, 10:33:18 AM »
You can in fact extract all your resources from a lone .001 file! Just run Resource resource.001 and get all your files back.

It should just work. I just gave it the .001 file from SCI Tetris and the only complaint was several older copies of the main script.

Awesome! I'll give it a go wjen I have a minute

Offline Doan Sephim

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #9 on: December 29, 2020, 04:06:07 PM »
Kawa, how do I run this program properly? Is this a plugin or do I just run it independently? When I run it, it opens, runs, then closes all in a second so I have no idea what's happening.


Offline Kawa

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #10 on: December 29, 2020, 07:52:34 PM »
It's a command line application. If running resource resource.001 from a command line isn't your bag, try dragging and dropping resource.001's icon onto Resource.exe's icon.

Offline Doan Sephim

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #11 on: December 29, 2020, 09:08:26 PM »
It's a command line application. If running resource resource.001 from a command line isn't your bag, try dragging and dropping resource.001's icon onto Resource.exe's icon.
Thanks for being patient with me. It worked perfectly

Offline Doan Sephim

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #12 on: December 29, 2020, 09:57:28 PM »
Alright, I've successfully rebuild the game in terms of putting all the resources back in, except for the Scripts.

Is there any way to import them as well?

Offline Kawa

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #13 on: December 30, 2020, 04:34:24 AM »
Do you still have the source folder? If so, I'd just import all the scr resources, close SCI Companion, and rename the script resources by editing game.ini by hand. If all is well clicking one in Companion's script list should just open the matching source file and you should be good to go from there.

Offline Doan Sephim

Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
« Reply #14 on: December 30, 2020, 08:43:35 AM »
Do you still have the source folder? If so, I'd just import all the scr resources, close SCI Companion, and rename the script resources by editing game.ini by hand. If all is well clicking one in Companion's script list should just open the matching source file and you should be good to go from there.

Yes, I still have the src file. Thanks for the tip, I'll try my hand at your suggestion.

Edit - Yup, works like a charm - a slightly tedious charm, but far better than rewriting the scripts!
« Last Edit: December 30, 2020, 10:31:20 AM by Doan Sephim »
Artificial Intelligence Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.04 seconds with 24 queries.