HSP
From OHRRPGCE-Wiki
The .HSP lump is identical to the .HS file imported into an .RPG file, but with a different extension. (Hspeak saves its output as an .HS file, which is given the .HSP when imported.)
It is actually a lumped file itself, and is unlumped to PLAYING.TMP upon loading a game. See RPG format#Lump Format for details.
Contents |
[edit] HS
The lump of filename "HS" contains the header. It is always the first lump in the file so that its filename can also be used to identify an HS file.
[edit] Formal Specs
| Data | Meaning |
|---|---|
| STR (12) | Header text "HamsterSpeak" |
| INT | Compiler version |
Current compiler version is 3. This is not really useful.
[edit] SCRIPTS.TXT
This lump is a plain text file and contains the name, id, and number of args of all scripts in the .HSP file. It is processed when a .HS file is imported via custom.exe to produce PLOTSCR.LST
For each script (in any order) this file contains, each on a new line
- The name of the script
- The decimal id number of the script
- The number of arguments of the script
- For each argument, a number is printed to a line
The list of numbers is nothing but garbage in old versions of HSpeak. Since HSpeak 2I, the numbers are the default arguments of the script, but you need to confirm HSpeak 2I or greater was used before considering using them (they are not used anywhere within the the current engine). 2I was the version that added the script argument number to HSZ lump headers, so you could check the length of the header of any HSZ lump.
walkherotox 32767 2 1 2
The text file ends on a newline.
[edit] SCRIPTS.BIN
Scripts.bin is a replacement for scripts.txt that contains similiar data in a 16-bit binary format, also holds trigger type info. It contains a header and a record for each script, in arbitrary order.
[edit] Header
| Offset | Data | Meaning |
|---|---|---|
| 0 | INT | Header size in bytes (currently 4) |
| 1 | INT | Record size in bytes (currently 42) |
[edit] Record
| Offset | Data | Meaning |
|---|---|---|
| 0 | INT | Script ID number |
| 1 | INT | Script trigger type: 0 = 'script' 1 = 'plotscript' |
| 2-20 | VSTR(1i+36b=19i) | Script name (lowercase, whitespace trimmed) |
[edit] #.HSX or #.HSZ
Each script is separately compiled into a binary lump composed of a binary header followed by raw script data. The name of the file is the id number of the script with extension .hsx or .hsz, which are equivalent.
The format of this lump is documented at HSZ
ARCHINYM.LMP . BROWSE.TXT . ATTACK.BIN . BINSIZE.BIN . DEFPAL#.BIN . DEFPASS.BIN . FIXBITS.BIN . LOOKUP.BIN . MENUS.BIN . MENUITEM.BIN . PALETTES.BIN . PLOTSCR.LST . SFXDATA.BIN . SONGDATA.BIN . UICOLORS.BIN . GEN . BAM . Map Format . T . P . E . D . L . N . DOR . DOX . DT0 . DT1 . DT6 . EFS . FOR . FNT . HSP . HSZ . ITM . MAP . MAS . MN . MXS . PAL . PT0 . PT1 . PT2 . PT3 . PT4 . PT5 . PT6 . PT7 . PT8 . SAY . SHO . SNG . STF . STT . TAP . TIL . TMN . VEH
