Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
trs:scripting_tr2_tr3 [2020/05/19 12:37] – [Script Opcodes] zdimensiontrs:scripting_tr2_tr3 [2021/11/08 23:20] – [Script Opcodes] zdimension
Line 147: Line 147:
 ==== Script Opcodes ==== ==== Script Opcodes ====
  
-^  ID  ^  Name  ^  Description  ^  Operand  ^ +^  ID  ^  Name  ^  Description  ^  Operand  | 
-|  0  |  ''%%Picture%%''  |  Unused. On PC, crashes if used and file missing. Otherwise, no action. Crashes under TR3 (PC).  |  Picture ID  | +|  0  |  ''<nowiki>Picture</nowiki>''    |  Unused. On PC, crashes if used and file missing. Otherwise, no action. Crashes under TR3 (PC).  |  Picture ID  | 
-|  1  |  ''%%ListStart%%''  |  Define the start and the end of a list of commands which will be cut short if the user presses a key/button.  +|  1  |  ''<nowiki>ListStart</nowiki>''    |  Define the start and the end of a list of commands which will be cut short if the user presses a key/button.   
-|  2  |  ''%%ListEnd%%''   :::  | ::: | +|  2  |  ''<nowiki>ListEnd</nowiki>''    | ::: | ::: | 
-|  3  |  ''%%FMV%%''  |  Display Full Motion Video.  |  [[#tr2_ids|FMV ID]]  +|  3  |  ''<nowiki>FMV</nowiki>''    |  Display Full Motion Video.  |  [[#tr2_ids|FMV ID]]   
-|  4  |  ''%%Level%%''  |  Start a playable level.  |  Level ID  | +|  4  |  ''<nowiki>Level</nowiki>''    |  Start a playable level.  |  Level ID  | 
-|  5  |  ''%%Cine%%''  |  Display cut scene sequence.  |  [[#tr2_ids|Cutscene ID]]  +|  5  |  ''<nowiki>Cine</nowiki>''    |  Display cut scene sequence.  |  [[#tr2_ids|Cutscene ID]]   
-|  6  |  ''%%Complete%%''  |  Display level-completion statistics panel.  +|  6  |  ''<nowiki>Complete</nowiki>''    |  Display level-completion statistics panel.   
-|  7  |  ''%%Demo%%''  |  Display demo sequence.  |  Demo level ID  | +|  7  |  ''<nowiki>Demo</nowiki>''    |  Display demo sequence.  |  Demo level ID  | 
-|  8  |  ''%%JumpToSequence%%''  |  Jump to another sequence.  |  Sequence ID  | +|  8  |  ''<nowiki>JumpToSequence</nowiki>''    |  Jump to another sequence.  |  Sequence ID  | 
-|  9  |  ''%%End%%''  |  Close script sequence.  +|  9  |  ''<nowiki>End</nowiki>''    |  Close script sequence.   
-|  10  |  ''%%Track%%''  |  Play Soundtrack (it precedes opcodes of associated levels).  |  [[#tr2_ids|Track ID]]  +|  10  |  ''<nowiki>Track</nowiki>''    |  Play Soundtrack (it precedes opcodes of associated levels).  |  [[#tr2_ids|Track ID]]   
-|  11  |  ''%%Sunset%%''  |  Gradually dim all lights in rooms with `LightModeset to `sunset(3). Used in Bartoli's Hideout.  +|  11  |  ''<nowiki>Sunset</nowiki>''    |  Gradually dim all lights in rooms with ''LightMode'' set to ''sunset'' (3). Used in Bartoli's Hideout.   
-|  12  |  ''%%LoadPic%%''  |  {{:icons:tr2.png?nolink|TR2 only}}{{:icons:tr3.png?nolink|TR3 only}} Show chapter screen on TR2 (**PSX only**) and TR3. On TR2 PC, it's hardcoded to do nothing.  |  Picture ID  | +|  12  |  ''<nowiki>LoadPic</nowiki>''    |  {{:icons:tr2.png?nolink&|TR2 only}}{{:icons:tr3.png?nolink&|TR3 only}}Show chapter screen on TR2 (**PSX only**  ) and TR3. On TR2 PC, it's hardcoded to do nothing.  |  Picture ID  | 
-|  13  |  ''%%DeadlyWater%%''  |  Not used anywhere in the game code.  Used in Temple of Xian. Maybe not-implemented ancestor of TR3 ''%%Death_by_Drowning%%''?  +|  13  |  ''<nowiki>DeadlyWater</nowiki>''    |  Not used anywhere in the game code. Used in Temple of Xian. Maybe not-implemented ancestor of TR3 ''<nowiki>Death_by_Drowning</nowiki>''  ?  |   
-|  14  |  ''%%RemoveWeapons%%''  |  Lara starts the level with no weapons.  +|  14  |  ''<nowiki>RemoveWeapons</nowiki>''    |  Lara starts the level with no weapons.   
-|  15  |  ''%%GameComplete%%''  |  End of game, show the final statistics and start the credits sequence.  +|  15  |  ''<nowiki>GameComplete</nowiki>''    |  End of game, show the final statistics and start the credits sequence.   
-|  16  |  ''%%CutAngle%%''  |  Match the North-South orientation of the Room Editor and the North-South orientation of the 3D animated characters from a CAD application.  |  Horizontal rotation ($\text{angle in degrees} \cdot 65536 / 360$)  | +|  16  |  ''<nowiki>CutAngle</nowiki>''    |  Match the North-South orientation of the Room Editor and the North-South orientation of the 3D animated characters from a CAD application.  |  Horizontal rotation ($\text{angle in degrees} \cdot 65536 / 360$)  | 
-|  17  |  ''%%NoFloor%%''  |  Lara dies when her feet reach the given depth. If falling, 4 to 5 extra blocks are added to Depth.  |  Depth ($\text{blocks} \times 1024$), relative to where Lara starts the level  | +|  17  |  ''<nowiki>NoFloor</nowiki>''    |  Lara dies when her feet reach the given depth. If falling, 4 to 5 extra blocks are added to Depth.  |  Depth ($\text{blocks} \times 1024$), relative to where Lara starts the level  | 
-|  18  |  ''%%StartInv%%'' / ''%%Bonus%%''  |  Give item to lara at level-start (''%%StartInv%%'') or at all-secrets-found (''%%Bonus%%'').  |  [[#item_ids|Item ID]]  +|  18  |  ''<nowiki>StartInv</nowiki>''   / ''<nowiki>Bonus</nowiki>''   |  Give item to lara at level-start (''<nowiki>StartInv</nowiki>''  ) or at all-secrets-found (''<nowiki>Bonus</nowiki>'').  |  [[#item_ids|Item ID]]   
-|  19  |  ''%%StartAnim%%''  |  Lara starts the level with the given animation.  |  Animation ID  | +|  19  |  ''<nowiki>StartAnim</nowiki>''    |  Lara starts the level with the given animation.  |  Animation ID  | 
-|  20  |  ''%%Secrets%%''  |  If zero, the level does not account for secrets. Non-zero value means the level must be accounted for secrets.  || +|  20  |  ''<nowiki>Secrets</nowiki>''    |  If zero, the level does not account for secrets. Non-zero value means the level must be accounted for secrets.  || 
-|  21  |  ''%%KillToComplete%%''  |  Kill all enemies to finish the level.  +|  21  |  ''<nowiki>KillToComplete</nowiki>''    |  Kill all enemies to finish the level.   
-|  22  |  ''%%RemoveAmmo%%''  |  Lara starts the level without ammunition or medi packs.  |+|  22  |  ''<nowiki>RemoveAmmo</nowiki>''    |  Lara starts the level without ammunition or medi packs.   | 
 + 
 +The correct way to parse a sequence is to first read a ''<nowiki>uint16_t</nowiki>'' opcode specifying what this command within the sequence does. In reference to the list above, certain commands MUST have an additional ''<nowiki>uint16_t</nowiki>'' read from the sequence data directly after the opcode that’s the pairing operand to this opcode. Not all opcodes have an operand so this must be done correctly. The original games execute each sequence command 1 by 1 until it reaches ''<nowiki>End</nowiki>'' (9), where it then runs the next sequence. 
 + 
 + {{anchor:item_ids}}
  
-The correct way to parse a sequence is to first read a ''%%uint16_t%%'' opcode specifying what this command within the sequence does. In reference to the list above, certain commands MUST have an additional ''%%uint16_t%%'' read from the sequence data directly after the opcode that’s the pairing operand to this opcode. Not all opcodes have an operand so this must be done correctly. The original games execute each sequence command 1 by 1 until it reaches ''%%End%%'' (9), where it then runs the next sequence. 
  
-{{anchor:item_ids}} 
 ==== Opcode-18 StartInv and Bonus ==== ==== Opcode-18 StartInv and Bonus ====
  
trs/scripting_tr2_tr3.txt · Last modified: 2024/12/30 01:23 by zdimension
Back to top
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0