Community

SCI Programming => SCI Community How To's & Tutorials => Topic started by: Cloudee1 on December 20, 2006, 04:13:40 AM

Title: Ever Rebuild while your Game was Running ... Here's How to fix it.
Post by: Cloudee1 on December 20, 2006, 04:13:40 AM
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.
Title: Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
Post by: gumby 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!
Title: Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
Post by: Cloudee1 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.
Title: Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
Post by: gumby 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.
Title: Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
Post by: gumby 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.
Title: Re: Ever Rebuild while your Game was Running ... Here's How to fix it.
Post by: Collector 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.