Recovering Lost .hs File

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
Meatballsub
Liquid Metal Slime
Posts: 996
Joined: Mon Oct 15, 2007 6:39 pm
Location: Northwest Georgia
Contact:

Recovering Lost .hs File

Post by Meatballsub »

I'm considering doing some more work on a game of mine, but it wouldn't be possible unless I could somehow recover the script file from it. The original script file is long gone and I was curious if there was a way to extract it from the RPG file or something like that.

Any help is appreciated.
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Yes, but it depends on how old it is. If it is old, you cannot recover the script.

If the script was last compiled with any version of hspeak.exe after 2009-07-27 then it automatically includes a backup copy.

Use unlump.exe to extract your RPG file into a folder. Then look inside and find your .hsp file inside (usually this is ohrrpgce.hsp but it might also be gamename.hsp)

inside the unlumped hsp folder, look for either source.txt or source.lumped.

source.txt exists in scripts compiled between 2009-07-27 and 2010-04-11 and it is a somewhat mangled but still easily repairable copy of your script (it also has a copy of plotscr.hsd embedded into it, and you need to manually trim it out)

source.lumped exists in scripts compiled between 2010-04-11 to the present. it is a lump file which you can extract with unlump, and it contains a clean copy of your script and all include files.

EDIT: Writing all that out makes me think we need a little "Backup Extractor" tool that does all of that automatically for you :)
Last edited by Bob the Hamster on Tue Apr 05, 2011 4:19 pm, edited 1 time in total.
User avatar
Meatballsub
Liquid Metal Slime
Posts: 996
Joined: Mon Oct 15, 2007 6:39 pm
Location: Northwest Georgia
Contact:

Post by Meatballsub »

Well crap, guess I'm out of luck then. Last time I compiled the script was back in '07. Thanks for the help anyways.
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Meatballsub wrote:Well crap, guess I'm out of luck then. Last time I compiled the script was back in '07. Thanks for the help anyways.
Sorry to hear it.

Which game was this, out of curiosity?
User avatar
Meatballsub
Liquid Metal Slime
Posts: 996
Joined: Mon Oct 15, 2007 6:39 pm
Location: Northwest Georgia
Contact:

Post by Meatballsub »

User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1419
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post by Pepsi Ranger »

Just out of curiosity, if we have a button to import scripts, and we have a button to export hsi data, why don't we have a button to export scripts? They're clearly stored in the game, otherwise they would never run, right? I mean, we have the ability to export textbox data. What's stopping this from becoming feasible?

EDIT: Or why not create a command line in GAME.EXE that dumps plotscript commands into a debug file as they're run when a script activates, if CUSTOM can't make sense of it?
Last edited by Pepsi Ranger on Tue Apr 05, 2011 10:06 pm, edited 1 time in total.
Place Obligatory Signature Here
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Pepsi Ranger wrote:Just out of curiosity, if we have a button to import scripts, and we have a button to export hsi data, why don't we have a button to export scripts? They're clearly stored in the game, otherwise they would never run, right? I mean, we have the ability to export textbox data. What's stopping this from becoming feasible?

EDIT: Or why not create a command line in GAME.EXE that dumps plotscript commands into a debug file as they're run when a script activates, if CUSTOM can't make sense of it?
Well, until 2009-07-27 there was only compiled script data in the RPG file. Getting source code out of a compiled binary is a little like getting a cow out of a hamburger.

But yes, a menu option to export the saved script is feasible, it would just only work for newer games.
Post Reply