Jump to content

Bytecode: Difference between revisions

(Created page with "= Script structure = * Bytecode scripts are stored in the script directory * A script must start with a <code>block</code> instruction. The script terminates either when that block ends, or with an explicit <code>return</code> instruction. * Blocks may only contain the following instructions as direct descendants: <code>end</code>, <code>expression</code>, <code>control</code>, and <code>[...")
 
Line 609: Line 609:


  load-map = [[#opcode_60|control 0xc8bb]], init_script_id, [ [[#opcode_50|keyword 0x6e]] ], [[#opcode_00|end]] ;
  load-map = [[#opcode_60|control 0xc8bb]], init_script_id, [ [[#opcode_50|keyword 0x6e]] ], [[#opcode_00|end]] ;
If <code>keyword 0x6e</code> (0x6e == 'n') is present, then the backup of the stat & world structs is suppressed. Usually, when loading a map, the stat & world structs are copied to another space in memory, and this copy is reloaded when using the fool's card, on death, or when saving the game. Use keyword 0x6e to suppress creation of this copy. This is used for example in boss rooms, where the player should respawn ''outside'' of the boss room, and not inside.


Example:
Example: