LBA2:Life script

From LBA File Information
Jump to navigation Jump to search

Life script opcodes[edit]

Code (dec) Name Description Parameters
0x00 0 END End of the life script none
0x01 1 NOP Does nothing none
0x02 2 SNIF (Script engine internal use) Jumps always then replaced with SWIF if condition succeeds Condition + int16:relative offset
0x03 3 OFFSET Unconditional jump int16: relative offset
0x04 4 NEVERIF (Script engine internal use) Jumps always Condition + int16: relative offset
0x0A 10 PALETTE Switches game palette uint8: new palette number
0x0B 11 RETURN Ends the current behaviour none
0x0C 12 IF Jumps if condition fails Condition + int16: relative offset
0x0D 13 SWIF If condition fails, jumps to offset and then replaced by SNIF Condition + int16: relative offset
0x0E 14 ONEIF Jumps if condition fails else replaced by NEVERIF Condition + int16: relative offset
0x0F 15 ELSE Jumps always int16: relative offset
0x10 16 ENDIF Does nothing none
0x11 17 BODY Changes body (model) of this actor uint8: model index
0x12 18 BODY_OBJ Changes body (model) of other actor
  • uint8: actor index
  • uint8: model index
0x13 19 ANIM Changes animation of this actor uint16: animation index
0x14 20 ANIM_OBJ Changes animation of other actor
  • uint8: actor index
  • uint16: animation index
0x15 21 SET_CAMERA Activates or deactivates a camera zone
  • uint8: zone number
  • uint8: flag
0x16 22 CAMERA_CENTER Recenter camera on followed object uint8: angle adjustment
0x17 23 SET_TRACK Set move script track of this actor int16: track number
0x18 24 SET_TRACK_OBJ Set move script track of other actor
  • uint8: actor index
  • int16: track number
0x19 25 MESSAGE Say a line of dialogue int16: dialogue index
0x1A 26 CAN_FALL Controls whether the actor can fall uint8: flag
  • 0: actor can't fall
  • 1: actor can fall
  • 2: actor can't fall, stops fall in progress
0x1B 27 SET_DIRMODE Sets movement mode of this actor uint8: movement mode
  • 0: no movement
  • 1: player control
  • 2: follow actor; has extra param uint8: actor index
  • 3: ???
  • 4: ???
  • 5: ???
  • 6: same XZ position as other actor
  • 7: MecaPenguin movement
  • 8: rail cart movement
  • 9: circle a point; has extra param uint8: point index
  • 10: circle a point while facing it; has extra param uint8: point index
  • 11: same XZ position and angle as other actor
  • 12: car movement
  • 13: car movement, player control#
0x1C 28 SET_DIRMODE_OBJ Sets movement mode of other actor
  • uint8: actor index
  • uint8: movement mode
0x1D 29 CAMERA_FOLLOW Make camera follow actor uint8: actor index
0x1E 30 SET_HERO_BEHAVIOUR Set behaviour mode for Twinsen uint8: behaviour
  • 0: normal
  • 1: athletic
  • 2: aggressive
  • 3: discreet
  • 4: protopack
  • 5: walking with Zoe
  • 6: healing horn
  • 7: spacesuit normal (interior)
  • 8: jetpack
  • 9: spacesuit athletic (interior)
  • 10: spacesuit normal (exterior)
  • 11: spacesuit athletic (exterior)
  • 12: car
  • 13: skeleton
0x1F 31 SET_VAR_CUBE Sets a scene variable
  • uint8: var index
  • uint8: value
0x20 32 BEHAVIOUR Start of a new life script behaviour uint8: behaviour ID
0x21 33 SET_BEHAVIOUR Sets the life script behaviour of this actor int16: absolute offset of behaviour
0x22 34 SET_BEHAVIOUR_OBJ Sets the life script behaviour of another actor
  • uint8: actor index
  • int16: absolute offset of behaviour
0x23 35 END_BEHAVIOUR Marks the end of this life script behaviour none
0x24 36 SET_VAR_GAME Sets a game variable
  • uint8: var index
  • uint8: value
0x25 37 KILL_OBJ Kills the given actor uint8: actor index
0x26 38 SUICIDE Kills this actor none
0x27 39 USE_ONE_LITTLE_KEY Uses and subtracts one generic key none
0x28 40 SUB_MONEY Takes the given amount of money from Twinsen int16: money to subtract
0x29 41 END_LIFE Stops running this life script none
0x2A 42 SAVE_CURRENT_TRACK Saves current move script track number then stops move script none
0x2B 43 RESTORE_LAST_TRACK Restores move script track and starts move script none
0x2C 44 MESSAGE_OBJ Causes an actor to say a line of dialogue
  • uint8: actor index
  • int16: dialogue index
0x2D 45 INC_CHAPTER Increases the chapter number none
0x2E 46 FOUND_OBJECT Show item found screen uint8: object number
0x2F 47 SET_DOOR_LEFT Moves this door left int16: distance to move
0x30 48 SET_DOOR_RIGHT Moves this door right int16: distance to move
0x31 49 SET_DOOR_UP Moves this door up int16: distance to move
0x32 50 SET_DOOR_DOWN Moves this door down int16: distance to move
0x33 51 GIVE_BONUS Spawns a bonus (life, magic, etc) from this actor uint8: if set, blocks on-death bonus
0x34 52 CHANGE_CUBE Changes to a new scene uint8: scene index
0x35 53 OBJ_COL Sets or clears the collides-with-objects flag for this actor uint8: flag
0x36 54 BRICK_COL Sets or clears the collides-with-bricks flags for this actor uint8: flag
  • 0: no brick collisions
  • 1: brick collisions
  • 2: low brick collisions
0x37 55 OR_IF Jumps if condition succeeds condition + int16: relative offset
0x38 56 INVISIBLE Sets or clears this object's invisible flag uint8: flag
0x39 57 SHADOW_OBJ Sets or clears this object's shadow flag uint8: flag
0x3A 58 POS_POINT Move actor to the given point uint8: point index
0x3B 59 SET_MAGIC_LEVEL Sets Twinsen's magic level uint8: level
0x3C 60 SUB_MAGIC_POINT Subtracts from Twinsen's mana uint8: magic to subtract
0x3D 61 SET_LIFE_POINT_OBJ Sets an actor's life points (can resurrect dead actors)
  • uint8: actor index
  • uint8: life points
0x3E 62 SUB_LIFE_POINT_OBJ Subtracts from an actor's life points
  • uint8: actor index
  • uint8: life points to subtract
0x3F 63 HIT Deals damage to an actor, caused by this actor
  • uint8: victim actor index
  • uint8: damage
0x40 64 PLAY_VIDEO Play a video char[]: name of video to play
0x41 65 LIGHTNING Lightning flash uint8: duration
0x42 66 INC_CLOVER_BOX Give clover box to Twinsen none
0x43 67 SET_USED_INVENTORY Marks the given inventory item as used uint8: item index
0x44 68 ADD_CHOICE Adds a choice to the next ask dialogue int16: message index
0x45 69 ASK_CHOICE This actor asks queued choices int16: message index for question
0x46 70 INIT_BUGGY Sets up Twinsen's car uint8: init flag
  • 0: no init
  • 1: init if needed
  • 2: force init
0x47 71 MEMO_SLATE Adds a slide to the memo slate uint8: picture index
0x48 72 SET_HOLO_POS Adds a marker to the Holomap uint8: marker index
0x49 73 CLR_HOLO_POS Removes a marker from the Holomap uint8: marker index
0x4A 74 ADD_FUEL Does nothing uint8: ignored
0x4B 75 SUB_FUEL Does nothing uint8: ignored
0x4C 76 SET_GRM Enables or disables a map fragment
  • uint8: zone index
  • uint8: enable/disable flag
0x4D 77 SET_CHANGE_CUBE Enables or disables teleport zones
  • uint8: index of the teleport zone's destination (not the index of the zone itself!)
  • uint8: enable/disable flag
0x4E 78 MESSAGE_ZOE Like MESSAGE but makes Twinsen speak using Zoe's text colour int16: message index
0x4F 79 FULL_POINT Fully restores Twinsen's health and magic (inc. horn) none
0x50 80 BETA Sets the actor's angle int16: new angle
0x51 81 FADE_TO_PAL Fades from the current palette to the given palette uint8: palette index
0x52 82 ACTION Triggers Twinsen's action (Z-key) none
0x53 83 SET_FRAME Sets the animation frame of this actor, if it has a 3D model uint8: frame number
0x54 84 SET_SPRITE Sets the sprite of this actor, if it is a sprite int16: sprite index
0x55 85 SET_FRAME_3DS Sets the sprite animation of this actor, if it is an animated sprite uint8: animation index
0x56 86 IMPACT_OBJ Run an impact animation centered on an actor
  • uint8: actor index
  • int16: impact animation index
0x57 87 IMPACT_POINT Run an impact animation centered on a point
  • uint8: point index
  • int16: impact animation index
0x58 88 ADD_MESSAGE Same as MESSAGE int16: message index
0x59 89 BALLOON Controls display of speech balloons uint8: enable/disable flag
0x5A 90 NO_SHOCK If set, actor ignores hits uint8: enable/disable flag
0x5B 91 ASK_CHOICE_OBJ Give actor asks queued choices
  • uint8: actor index
  • int16: message index
0x5C 92 CINEMA_MODE Enables or disables cinema mode uint8: enable/disable flag
0x5D 93 SAVE_HERO Saves Twinsen's behaviour and model none
0x5E 94 RESTORE_HERO Restores Twinsen's behaviour and model none
0x5F 95 ANIM_SET Sets this actor's animation int16: animation index
0x60 96 RAIN Makes it rain uint8: duration
0x61 97 GAME_OVER Kills Twinsen and gives a Game Over none
0x62 98 THE_END Ends the game and displays the credits none
0x63 99 ESCALATOR Enables or disables an escalator
  • uint8: escalator zone index
  • uint8: enable/disable flag
0x64 100 PLAY_MUSIC Plays a music track uint8: track index
0x65 101 TRACK_TO_VAR_GAME Saves this actor's move script track to the given game var uint8: game var index
0x66 102 VAR_GAME_TO_TRACK Sets this actor's move script track to the value of the given game var uint8: game var index
0x67 103 ANIM_TEXTURE Enable or disable texture animation uint8: enable/disable flag
0x68 104 ADD_MESSAGE_OBJ Same as MESSAGE_OBJ
  • uint8: actor index
  • int16: message index
0x69 105 BRUTAL_EXIT Ends the game without displaying credits none
0x6A 106 COMMENT Does nothing none
0x6B 107 LADDER Enables or disables a ladder zone
  • uint8: zone index
  • uint8: enable/disable flag
0x6C 108 SET_ARMOUR Sets this actor's armour value uint8: armour value
0x6D 109 SET_ARMOUR_OBJ Sets the given actor's armour value
  • uint8: actor index
  • uint8: armour value
0x6E 110 ADD_LIFE_POINT_OBJ Adds life points to the given actor (can resurrect actors)
  • uint8: actor index
  • uint8: life points to give
0x6F 111 STATE_INVENTORY Sets inventory item variant (e.g. different Pisto-Laser states)
  • uint8: item index
  • uint8: variant
0x70 112 AND_IF Same as IF condition + int16: relative offset
0x71 113 SWITCH Begins a switch statement none
0x72 114 OR_CASE Jumps if switch value comparison fails int16: relative offset + condition
0x73 115 CASE Jumps if switch value comparison succeeds int16: relative offfset + condition
0x74 116 DEFAULT Does nothing none
0x75 117 BREAK Jumps to relative offset int16: relative offset
0x76 118 END_SWITCH Does nothing none
0x77 119 SET_HIT_ZONE Enables or disables a trap ("hit") zone
  • uint8: zone index
  • uint8: enable/disable flag
0x78 120 SAVE_BEHAVIOUR Saves the life script behaviour number of this actor none
0x79 121 RESTORE_BEHAVIOUR Restores the life script behaviour of this actor none
0x7A 122 SAMPLE Plays a sound sample from this actor int16: sample index
0x7B 123 SAMPLE_RND Plays a sample with a randomly-lowered frequency from this actor int16: sample index
0x7C 125 SAMPLE_ALWAYS Plays a sample continuously from this actor int16: sample index
0x7D 125 SAMPLE_STOP Stops a continuous sample from this actor, if playing int16: sample index
0x7E 126 REPEAT_SAMPLE Plays a sound sample multiple times from this actor
  • int16: sample index
  • uint8: repeat count
0x7F 127 BACKGROUND Sets or clears the "background" (don't actively redraw) flag for this actor uint8: enable/disable flag
0x80 128 ADD_VAR_GAME Adds a value to a game var
  • uint8: game var index
  • int16: addend
0x81 129 SUB_VAR_GAME Subtracts a value from a game var
  • uint8: game var index
  • int16: subtrahend
0x82 130 ADD_VAR_CUBE Adds a value to a scene var
  • uint8: scene var index
  • int16: addend
0x83 131 SUB_VAR_GAME Subtracts a value from a scene var
  • uint8: scene var index
  • int16: subtrahend
0x84 132 NOP Does nothing none
0x85 133 SET_RAIL Enables or disables a rail zone
  • uint8: zone index
  • uint8: enable/disable flag
0x86 134 INVERSE_BETA Rotates this actor to face the opposite direction none
0x87 135 NO_BODY Hides the model for this actor none
0x88 136 ADD_MONEY Gives some money to Twinsen (max 999) int16: money to add
0x89 137 SAVE_CURRENT_TRACK_OBJ Saves and stops the move script track of another actor uint8: actor index
0x8A 138 RESTORE_LAST_TRACK_OBJ Restores and starts the move script track of another object uint8: actor index
0x8B 139 SAVE_BEHAVIOUR_OBJ Saves the life script behaviour of another actor uint8: actor index
0x8C 140 RESTORE_BEHAVIOUR_OBJ Restores the life script behaviour of another actor uint8: actor index
0x8D 141 SPY Does nothing none
0x8E 142 DEBUG Does nothing none
0x8F 143 DEBUG_OBJ Does nothing none
0x90 144 POPCORN Does nothing none
0x91 145 FLOW_POINT Starts a particle flow from the given point
  • uint8: point index
  • uint8: particle flow index
0x92 146 FLOW_OBJ Starts a particle from from the given actor
  • uint8: actor index
  • uint8: particle flow index
0x93 147 SET_ANIM_DIAL Sets the animation to be used during dialogue uint16: animation index
0x94 148 PCX Display a still image uint8: image index
0x95 149 END_MESSAGE Does nothing none
0x96 150 END_MESSAGE_OBJ Does nothing uint8: ignored
0x97 151 PARM_SAMPLE Sets audio sample parameters
  • int16: frequency range
  • uint8: volume
  • int16: base frequency
0x98 152 NEW_SAMPLE Plays an audio sample with parameters
  • int16: sample index
  • int16: frequency range
  • uint8: volume
  • int16: base frequency
0x99 153 POS_OBJ_AROUND Positions on actor near to another
  • uint8: index of actor to move
  • uint8: index of destination actor
0x9A 154 PCX_MESS_OBJ Show a message on a still background image
  • uint8: image index
  • uint8: effect
  • uint8: index of actor speaking the message
  • int16: message index

Effects are:

  • 0: no effect
  • 1: venetian blinds effect