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.
Recovering Lost .hs File
Moderators: Bob the Hamster, marionline, SDHawk
- Meatballsub
- Liquid Metal Slime
- Posts: 996
- Joined: Mon Oct 15, 2007 6:39 pm
- Location: Northwest Georgia
- Contact:
- Bob the Hamster
- Liquid Metal King Slime
- Posts: 7460
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
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 :)
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.
- Meatballsub
- Liquid Metal Slime
- Posts: 996
- Joined: Mon Oct 15, 2007 6:39 pm
- Location: Northwest Georgia
- Contact:
- Bob the Hamster
- Liquid Metal King Slime
- Posts: 7460
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
- Meatballsub
- Liquid Metal Slime
- Posts: 996
- Joined: Mon Oct 15, 2007 6:39 pm
- Location: Northwest Georgia
- Contact:
- Pepsi Ranger
- Liquid Metal Slime
- Posts: 1419
- Joined: Thu Nov 22, 2007 6:25 am
- Location: South Florida
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?
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
- Bob the Hamster
- Liquid Metal King Slime
- Posts: 7460
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
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.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?
But yes, a menu option to export the saved script is feasible, it would just only work for newer games.