 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Mariel

Joined: 15 Oct 2008 Posts: 78 Location: In your dreams
|
Posted: Fri Jan 09, 2009 9:02 am Post subject: New feature idea... |
|
|
Just had a thought, but it would be pretty cool if there were a way to export scripts in a game, so that if you lose the script file you can derive it from the editor. As a beginner in scripting, I really wish I could see some of the inner workings of games like Vikings, which is already offering graphics to poor little noobs like me. |
|
Back to top |
|
 |
Blue Pixel SPY SAPPIN MAH FISH SANDWICH

Joined: 22 Apr 2005 Posts: 621
|
Posted: Fri Jan 09, 2009 9:15 am Post subject: |
|
|
I think you can export scripts, im just not sure what format it's in or if it's even readable. _________________
 |
|
Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Fri Jan 09, 2009 10:07 am Post subject: |
|
|
Yeah, I think that someone had a working script retriever, but it had a hard time making the actual output file readable at all.
I'm sure that if you ask many people here would be willing to let you look at their script files. My game Tales II includes the script files, mostly just because I wanted to have the game as a whole backed up. A lot of them would be pretty confusing for a beginner, though, I think. Moogle1 used to have a collection of simple scripts for beginners to learn off of. What happened to those? _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
Back to top |
|
 |
TwinHamster ♫ Furious souls, burn eternally! ♫

Joined: 07 Mar 2004 Posts: 1352
|
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
|
Back to top |
|
 |
Fenrir-Lunaris WUT

Joined: 03 Feb 2003 Posts: 1747
|
Posted: Sat Jan 10, 2009 11:59 am Post subject: |
|
|
Moogle1 wrote: | As for Vikings, the script file is included with the full zip file download (under the directory "Vikings script files"). |
I apologize in advance for keeping it as a (mostly) unreadable text file, instead of a .hs or whatever. Before the end of the year I'd like to have it fully commented and cleaned up for simpler reading. Then again, there's not really much in there that's very complex like loops or if/then statements, so you shouldn't have too hard a time of plucking it apart.
Coincidentally, the "run on x" script is the easiest and most convenient thing game authors can do to make things easier on their players. I'm honestly surprised this hasn't been suggested as an engine default. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sat Jan 10, 2009 6:45 pm Post subject: |
|
|
I wrote the 'HS Decompiler' a few years ago. There have been many changes to HS since then, and they are not supported in the available version. I am very slowly working on a new version, to which I add support for new features as people email me and need them. If you lost your script, just email me and I'll be happy to get it for you.
You lose all comments and names of variables, unless you can give me an old or incomplete copy. The biggest readability improvement is that it uses constants now. Example output:
Code: | script, negatizer, begin
variable (local1)
for (local1, 0, 255) do, begin
writecolor(local1, color:red, 63 -- readcolor(local1, color:red))
writecolor(local1, color:green, 63 -- readcolor(local1, color:green))
writecolor(local1, color:blue, 63 -- readcolor(local1, color:blue))
end
updatepalette
end |
However, a much better solution would be to include the complete text of the script files in the RPG lump both for retrieving them, and more importantly for in-game debugging and error messages. I guess this would be an optional script debugging mode, so that you don't have to include the scripts if you don't want to.
Fenrir-Lunaris wrote: | I apologize in advance for keeping it as a (mostly) unreadable text file, instead of a .hs or whatever. Before the end of the year I'd like to have it fully commented and cleaned up for simpler reading. Then again, there's not really much in there that's very complex like loops or if/then statements, so you shouldn't have too hard a time of plucking it apart. |
The file extension doesn't make any difference.
Great, I'd love to see the Vikings scripts cleaned up. I think that it's a pity that the scripts for what is meant to be an example game are in many places written in very bad style. Hmm... I never finished writing my script formatter.
Fenrir-Lunaris wrote: | Coincidentally, the "run on x" script is the easiest and most convenient thing game authors can do to make things easier on their players. I'm honestly surprised this hasn't been suggested as an engine default. |
Well, I don't see the use of a key to run at speed 5 actually. Why not just increase the walking speed to 5 permanently, like SoJ does? _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Sun Jan 11, 2009 1:27 am Post subject: |
|
|
What if we did this?
The script management menu currently has
Quote: |
previous menu
export names for scripts (.hsi)
import compiled plotscripts (.hs)
|
What if we changed it to look more like this
Quote: |
previous menu
export names for scripts (.hsi)
import pre-compiled plotscripts (.hs)
import uncompiled scripts (.hss, .txt)
export backup copy of script
Current backup script dated 2009-01-10 1:45 pm
|
So if you picked "import uncompiled script" it would prompt you to browse for a script file. Then it would execute hspeak on it using the same external program execution routines we have for wav/mp3/ogg conversion. The resulting hs will be imported as normal, and the import script file would be stored in the RPG file with a date-stamped filename such as 200901101345.hss and then it could be exported if desired. (or we could just leave off the export, and expect the user to retrieve the backup file with unlump if desired)
We could also update the command-line script importer functionality of custom to take uncompiled scripts the same way. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Jan 11, 2009 8:14 am Post subject: |
|
|
Mostly, yes. Could also add options to delete the scripts, and to set global script triggers like new game, etc, and new ones like a global onkeypress trigger. So would this be the end of compiling manually with HSpeak? I'd want some way to specific commandline options to HSpeak then.
If you want to add debugging facilities such as printing the line of a script on which an error occurred and adding breakpoints, you really need a copy of the exact version of the scripts which were compiled and imported. So we could just delete text scripts if they're out of date.
The scripts could also be lumped inside the .HS file. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Sun Jan 11, 2009 8:16 pm Post subject: |
|
|
The Mad Cacti wrote: | Fenrir-Lunaris wrote: | Coincidentally, the "run on x" script is the easiest and most convenient thing game authors can do to make things easier on their players. I'm honestly surprised this hasn't been suggested as an engine default. |
Well, I don't see the use of a key to run at speed 5 actually. Why not just increase the walking speed to 5 permanently, like SoJ does? |
Running at speed five doesn't make much difference (this is a mistake i made when i first wrote that script), but walking at speed ten isn't practical for times you might need precision, but great for when you want to close distances. This is why that script exists. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|