Acceptable Scriptor Instructions
All instructions follow an assembler style format:
| instruction parameter1,parameter2,paramter3,... |
All parameters are translated to 16 bit integers. Paranthesis
can be used to nest instructions together.
| = var1,(+ var1,(>> var2,1)) |
Operators
| Operator | Functionality |
| = | Integer Assignment |
| + | Integer Addition |
| - | Integer Substraction |
| * | Integer Multiplication |
| / | Integer Division |
| % | Integer Modulus |
| & | Bitwise AND |
| | | Bitwise OR |
| ^ | Bitwise XOR |
| ! | Bitwise NOT |
| << | Bit Shift Left |
| >> | Bit Shift Right |
| == | Equals |
| < | Less Than |
| <= | Less Than OR Equals |
| > | Greater Than |
| >= | Greater Than OR Equals |
| != | Not Equals |
General Functionality
| Instruction | Parameters | Functionality |
| break | 0 | Triggers a controlled system crash |
| wait | 2 | Delays script execution by the time provided in parameters |
| exit | 1 | Triggers a graceful shutdown of Gorgon engine |
| textcolor | 2 | Sets the Foreground and Background text colors |
| print | 4 | Prints text directly to screen |
| msgbox | 2 | Prints text in a message box |
| sound | 1 | Plays the specified sound effect |
| music | 2 | Plays the specified track in the music package |
| queue | 2 | Queues the next music track to play |
| call | 2 | Calls the specified event from any code segment |
| said | 1 | Tests the player command input |
| clearvars | 0 | Clears all variables |
| clearrooms | 0 | Clears all room flags |
| loadroom | 1 | Loads indexed room script |
| loadaux | 2 | Loads specified script into aux segment |
| achievement.add | 1 | Adds Steam achievement |
| achievement.drop | 1 | Removes Steam achievement |
Screen
| Instruction | Parameters | Functionality |
| pal | 1 | Loads desired palette data into video card |
| target | 1 | Specifies backbuffer targeted by screen instructions |
| image | 4 | Draws sprite object to full screen backbuffer |
| screen.limits | 2 | Sets vertical line limits for video refresh |
| screen.clear | 0 | Clears screen backbuffer |
| screen.load | 2 | Loads full screen artwork to backbuffer |
| screen.draw | 0 | Draws screen art backbuffer to main backbuffer |
| screen.present | 0 | Draws contents of backbuffer to video memory |
| map | 1 | Loads fullscreen 16 color priority to Map backbuffer |
| mask | 1 | Loads fullscreen 16 color priority to Mask backbuffer |
Inventory
| Instruction | Parameters | Functionality |
| item.has | 1 | Tests player inventory for item ID |
| item.add | 1 | Adds item ID to player inventory |
| item.drop | 1 | Removes item ID from player inventory |
| item.clr | 0 | Clears player inventory |
Sprites
| Instruction | Parameters | Functionality |
| sprite.clr | 0 | Clear sprite registers |
| sprite.setseq | 2 | Set sprite sequence for direction |
| sprite.setloc | 2 | Set sprite location |
| sprite.vis | 2 | Set sprite visibility flags |
| sprite.anim | 2 | Set sprite animation flags |
| sprite.load | 2 | Load sprite image data file |
Files
| Instruction | Parameters | Functionality |
| file.open | 2 | Opens custom data file |
| file.close | 0 | Closes custom data file |
| file.read | 0 | Reads 16 bit integer from custom data file |
| file.reads | 1 | Reads string from custom data file |
| file.write | 1 | Writes 16 bit integer to custom data file |
| file.writes | 1 | Writes string to custom data file |
Serial Connection
| Instruction | Parameters | Functionality |
| serial.open | 2 | Attempt to open serial connection |
| serial.close | 0 | Close serial connection |
| serial.in | 0 | Read 16 bit integer from serial port |
| serial.out | 1 | Write 16 bit integer to serial port |
Strings
| Instruction | Parameters | Functionality |
| string.read | 2 | Read string from player input |
| string.set | 2 | Set string from data |
| string.len | 1 | Get string length |
| string.atoi | 1 | Convert string to 16 bit integer value |
| string.cat | 2 | Concatonate 2 strings |
| string.cmp | 2 | Compare 2 strings |