OCB and Setup Instructions

Updated on 14 April 2024

Lara

Extra Animations #

  • For TombEngine: there is an additional object “LARA_EXTRA_ANIMS” that contains special animations for unique situations across the classic games. To use these in-game: you can call on them easily using the steps outlined below:
  • Open your main game WAD2 in Wadtool as the destination WAD2. Then locate the LARA object and double-click it to open up the Animation Editor.
  • Scroll down to the bottom of the Animation List and find the last animation number. In this example: as this is the default TombEngine WAD2: it is 568.
  • The LARA_EXTRA_ANIMs will continue from this number. For example, if I wanted to trigger the TNT_ACTIVATION animation: it would be Lara animation 568 + 9 = 577.

Changes to Lara #

  • TombEngine has introduced several tweaks and changes to Lara to improve how responsive she is and extend her move set. Whilst the same controls apply: some adjustments do not compare directly to the classic games.
  • Below is the code that needs to be in your SETTINGS.Lua file, located in the Engine/Scripts folder of your project.
local anims = Flow.Animations.new()

    --insert options found below here
    
Flow.SetAnimations(anims)

Crouch Roll and Turn #

TombEngine has restored the ability to roll whilst crouched down and turn Lara around when crouched. This was cut from Tomb Raider III and partially restored in Tomb Raider I-III Remastered.

  • To perform the crouch roll: simply press the SPRINT key.
  • To perform the crouch turn: simply press the ROLL key and Lara will turn around 180 degrees.
-- Insert into Settings.Lua as shown above.
anims.crouchRoll = true

Extended Crawling #

  • Lara can crawl up and down from a 1, 2 or 3-click height.
  • Camera improvements have been made when Lara is in her crouch state to allow the player to have a smoother experience than in the classic games.
-- Insert into Settings.Lua as shown above.
anims.crawlExtended = true

Ledge Jump #

  • Lara can jump up a 4-click height from hanging down and also perform acrobatics to turn around and jump to a ledge behind her from hanging.
  • To perform the jump up from hanging: make sure Lara is hanging off an edge and press the JUMP button.
  • To perform the jump back: press JUMP+DOWN whilst hanging.
-- Insert into Settings.Lua as shown above.
anims.ledgeJumps = true

Monkey-Swing Changes #

  • Lara will now automatically jump down at the and of a monkey-swing section if there is ground for her to land on within range.
-- Insert into Settings.Lua as shown above.
anims.monkeyAutoJump = true

AFK Pose #

  • In the classic games: if the player left Lara unattended: she would just stand on the spot. Now she will pose with her arms crossed as though she is waiting for the player.
-- Insert into Settings.Lua as shown above.
anims.pose = true

Sprint Jump #

  • Lara can jump whilst sprinting for a short time which allows her to cover a large gap. Whilst this is fairly unrealistic: it has been included as it was requested.
-- Insert into Settings.Lua as shown above.
anims.sprintJump = true

Enemies

Cobra #

  • To correct the death animation: please change the STATE ID of ANIMATION 5: “COBRA_ANIM_DEATH” from 0 to 4

Dog #

  • OCB 0: Attacks player when triggered.
  • OCB 1: Starts frozen (laying down like statues). Trigger to wake them up.

Dragon (TR2 Boss) #

Available in TombEngine Version 1.4 – not currently released.

  • Place “DRAGON_FRONT” for full dragon.
  • OCB 0: Will die when health reaches 0
  • OCB 1: Will regenerate health until the Dagger of Xian is pulled from stomach (original behaviour).
  • Any pickups placed on the same sector as the Dragon will be given to the player once the dragon is killed.
  • You will need to use the provided download found here
  • Used in conjunction with Marco Bartolli

Guardx, SWAT and SWAT Plus #

  • OCB 0: Default.
  • OCB 1: Reload
  • OCB 2: Door Kick
  • OCB 3: Rappel Down Rope
  • OCB 4: Sleeping
  • OCB 5: Rappel Down Rope (Fast)
  • OCB 6: Wait On Wall
  • OCB 7: Use Computer
  • OCB 8: Start Hunt Stop
  • OCB 9: Use ID_COMPUTER_SCIENTIST
  • OCB 10: Idle
  • OCB 11: Run

Hitman #

  • Use the room flag “No Lens Flare” and he will suffocate. The behaviour for this is that he will first try to escape, then suffocate if he cannot. Use the “Set Box Sector” flags on all doors to prevent escape.
  • Set the room type to “Water” and he will electrocute himself.

IMP #

  • OCB 1: Climbs up when triggered.
  • OCB 2: Rolls on the floor when triggered.
  • OCB 3: Attacks player with rocks when triggered.
  • If the player is holding a lit torch or throws the lit torch towards the imp: they will run away scared.

Marco Bartolli (TR2 Boss) #

Available in TombEngine Version 1.4 – not currently released.

  • Trigger Marco and he will start to transform.
  • Place a HEAVY trigger underneath the sector where Marco is and he will activate it once transformed.
  • Transformation is made up of three objects and play in sequence. These can be modified via setting the ItemFlags:
--First, we will create a function for the amendments we want for Marco Bartolli's transformation: 
function marcoTransform()
	local marco = GetMoveableByName("marco_bartoli_410") -- Get which Marco Bartolli object you are reffering to.
-- The next section is where we are defining 3 different values. The explosion timings are measured in frames:
	local explosion1 = 10 -- Explosion 1
	local explosion2 = 100 -- Explosion 2
	local explosion3 = 120 -- Explosion 3
-- Finally we will change the code to amend for our own timings.
	marco:SetItemFlags(explosion1,1)
	marco:SetItemFlags(explosion2,2)
	marco:SetItemFlags(explosion3,3)
end

-- Now we have the function, we can ask the engine to run it when the player loads the level. 
LevelFuncs.OnStart = function()
	marcoTransform()
end
-- code: Stranger1992. 19/03/24

Roman God 1 / Roman God 2 #

  • OCB 0: Hammer God mode. Uses a powerful hammer attack.
  • OCB 1: Sword God mode. Fires a bolt of homing energy at Lara.

Sphinx #

  • OCB 0: Waits until the player approaches before charging.
  • OCB 1: Charges towards the player when triggered.

Sophia Leigh #

  • OCB 0: Normal mode. Sophia behaves like a regular enemy.
  • OCB 1: Tower Mode. Her behaviour matches Tomb Raider III. Invincible unless triggered to be killed.
  • OCB 2: Tower Mode with Volumes. Same as Tower Mode but Sophia’s ascent can be controlled using volumes in Tomb Editor.
  • Please note that you need to use AIX1 null-meshes.

Wasp #

  • AI_MODIFY object won’t allow it to land, the wasp will always fly.

Winged Mummy #

  • OCB 1: Start off flying when triggered.
  • OCB 2: Start as a mummy when triggered.
  • OCB 4: Start posed.
  • OCB 8: No Wings.
  • OCB 16: Disable Bomb Attack.
  • OCB 32: Disable Shard Attack.

Keys

  • To enable multiple usages, simply set the trigger type of the keyhole object as “Switch“.
  • OCB 0 – play default animation and lose key.
  • Positive OCB: play animation number and keep key.
  • Negative OCB: play animation number and lose key.

Pickups

  • OCB 0: The pickup is on the floor.
  • OCB 1: The pickup is in a hole in the wall.
  • OCB 2: The pickup is attached to the wall (crowbar needed).
  • OCB 3: The pickup is on a high pedestal.
  • OCB 4: The pickup is on a low pedestal.
  • Add 64 to the OCB for it to trigger a pickup trigger on that square.
  • OCB 128 regenerates ammo item once depleted.
  • Please note that if you place a pickup on top of a pedestal static object: the object being picked must be in the same X and Z position as the pedestal.

Puzzles

To enable multiple usages, simply set the trigger type of the puzzle-hole or puzzle-done object as “Switch”. Can be mixed with puzzle done and puzzle holes of the same or different type.

Switches

Generic Switches #

  • OCB 0: Wall Lever
  • OCB 1: Small lever
  • OCB 2: Small button
  • OCB 3: Big Button
  • OCB 4: Giant Button
  • OCB 5: Valve
  • OCB 6: Reach In Hole
  • OCB 7: Lua Switch. Use this OCB on a switch where you want to have two custom animations. Use in conjunction with ItemFlag[4] for the ON animation and ItemFlag[5] for the OFF animation:
--First, we will create a function for the amendments we want for this new custom switch: 
function customisedSwitch()
	local customSwitch = GetMoveableByName("lever_switch_40") -- Get which switch you want to add custom animations to.
-- The next section is where we define the two animations 
	local switchOn = 100 -- Lara's Animation number
	local switchOff = 200 -- Lara's Animation number
-- Finally we will change the code to link up the animation changes to the switch.
	customSwitch:SetItemFlags(switchOn,4)
	customSwitch:SetItemFlags(switchOff,5)
end
-- Now we have the function, we can ask the engine to run it when the player loads the level. 
LevelFuncs.OnStart = function()
	customisedSwitch()
end
-- code: Stranger1992. 19/03/24
  • OCB 9: Pry out of the wall with the crowbar.

Users can assign custom animations to a switch:

  • OCB = Animation number for “on” animation
  • OCB + 1 = Animation “off” number.

Please note that you must use the versions provided on this website HERE. There were changes made to the switches during development. 

Cog Switch #

  • Use OCB 0 to have the traditional behaviour.
  • Use any other OCB to can use the Cog Switch without need of any door linked.

Shoot Switch 1 #

  • Set all code bits ON (click the object and press the o key ) to activate a heavy trigger placed underneath the switch.
  • Alternately use a SWITCH trigger below to activate triggers when shot.

Shoot Switch 2 #

  • OCB 444 – Shatters when shot.

Shoot Switch 3 or 4 #

  • Same as SHOOT_SWITCH1 but has no shatter effect.

Interactives

Bridges #

  • This object can be positioned freely without requiring any specific trigger beneath it. It also can be rotated and adjusted in real-time through Lua. Additionally, any items placed on a moving platform will be transported along with it.
  • The surface that the player can stand on is taken from the bridge object’s collision.
  • The only condition is that pickup must be activated (1-5 bits set in the edit object window or manually activated).

Corpse #

  • OCB 0 for a carcass that is eaten by the Compsognathus dinosaur.
  • OCB 1: Hangs in the air as if used as bait and will fall if shot.
  • Please note you must use the patched version found here.

Color/Pulse/Strobe Light #

  • The light colour is chosen in Tomb Editor by changing the object tint.

Electrical Light #

  • The light colour is chosen in Tomb Editor by changing the object tint.
  • OCB + (mesh number) allows light to behave like a neon light.
  • OCB – (mesh number) makes the light flicker.

Pushable Objects & Blocks #

Pushable objects can now be pushed over the edge with new custom animations to make the transition smoother (credit: GeckoKid)

  • OCB 0: Standard behaviour.
  • OCB +1: Can Fall, If added, Lara can push the pushable through border edges.
  • OCB +2: Don’t Align Center, If added, Lara’ll be able to grab the pushable without the need to position Lara in the middle of the sector to interact.
  • OCB +4: Is Buoyant. If added, the pushable will float to the surface when it is in a water room.
  • OCB +8: Animation System, If added, Lara will use the classic TR1-TR3 push/pull animations. (Need WAD update).
  • Change the OCB to a negative number to prevent the pushable from being moved.
  • For example: if you require a pushable object that you could push over an edge and float in water you will do OCB 1 + 4 = 5. If you then wanted to use the classic TR1-TR3 animations: you would add 8 bringing your total OCB to 13.

Ropes #

  • OCB 0: Straight when triggered.
  • OCB -1: Coiled and folds out when triggered.

Waterfall Mist #

  • OCB xx yy where xx in width, and yy is sprite size.
  • Example: 1050 would make the mist appear for the width of a sector and a medium-sized sprite.

Winston (Lara’s Butler) #

The ever-faithful Winston: Lara Croft’s long time, multi-generational butler is back. 
  • OCB 0: Butler mode. Will continually follow Lara in an attempt to server her with tea. 
  • OCB 1: Target practice mode. Lara will use Winston for target practice.
    • In order to swap between the two versions: you must use MESHSWAP_ARMY_WINSTON_OUTFIT and swap the meshes if the OCB is 1. Feel free to use the below code to do this in-game:

You must use the provided version linked below. The animations from the TR2 and TR3 version of Winston have been combined.

-- Function to swap Winston to Army meshes
local function WinstonToArmyMeshswap(winstonNormal, winstonNormalOCB)
    local numMeshes = 26 -- Total number of meshes to swap
    local winstonArmyID = 1120 -- Object ID number
    
    if winstonNormalOCB == 1 then 
        for i = 0, numMeshes - 1 do
            winstonNormal:SwapMesh(i, winstonArmyID, i)
        end
    end
end

-- Function to swap Army to Winston meshes
local function ArmyToWinston(winstonNormal, winstonNormalOCB)
    local numMeshes = 26 -- Total number of meshes to swap
    local winstonNormalID = 298 -- Object ID number
    
    if winstonNormalOCB == 0 then 
        for i = 0, numMeshes - 1 do
            winstonNormal:SwapMesh(i, winstonNormalID, i)
        end
    end
end

LevelFuncs.OnLoop = function()
    local winstonNormal = GetMoveableByName("WINSTON") 
    local winstonNormalOCB = winstonNormal:GetOCB()  
    
    if winstonNormalOCB == 1 then 
        WinstonToArmyMeshswap(winstonNormal, winstonNormalOCB)
    elseif winstonNormalOCB == 0 then 
        ArmyToWinston(winstonNormal, winstonNormalOCB)
    end
end

--code: Stranger1992, 23/03/24

Traps

Crumbling Platform #

  • OCB = 0: Default behaviour. The platform will start to shake when Lara steps on and will crumble for 1.2 seconds (35 frames) and then fall.
  • OCB = crumble length (in frames):  The platform will start to shake when Lara steps and will crumble during the number of frames indicated in the OCB.
  • A positive number will crumble automatically
  • A negative number will require a trigger.
  • ItemFlags[0]: Delay in frame time.
  • ItemFlags[1]: Fall velocity.

Dart #

  • Can be freely rotated and positioned in Tomb Editor. Now uses a 3D mesh for the dart instead of a sprite and fires towards the pointed end of the nullmesh.
  • OCB 0: Does damage only.
  • OCB -1: Does damage and poisons Lara.

Ember Emitter #

Available in TombEngine Version 1.4 – not currently released.

  • Positive OCB = Lava spitting effect from TR1 and TR2. The effect is harmful to Lara.
    • Choose the colour of the effect via object tint in Tomb Editor.
    • Choosing a 100% black value (RGB 0,0,0) will result in a subtractive blending mode and appear black.
    • Can change the effect size by increasing OCB value. For example: OCB 20 will be 2.0 sectors wide.
  • A negative OCB that creates a lava spitting effect in the Ireland Labyrinth level of TR5. The effect can damage Lara if she gets too close. The OCB value determines the size of the effect. (The default value is 31 in TR5)

Explosion #

The effect of the explosion is a formula:
  • Add 0-99 to OCB for delay (quarter seconds)
  • Add 100-900 to OCB for size (1-9)
  • Add 400 to make the explosion deadly.
  • Add 10000 to OCB for green explosion.
  • Add 1000 to OCB for blast wave ( 0 or 1)
The explosion object itself is not rendered in-game. The video included uses OCB 1400.

Fish Emitter #

Available in TombEngine Version 1.4 – not currently released.

  • You can add multiple versions of fish by adding a mesh in the skeleton editor inside Wadtool. The fish uses the meshes from the FISH_EMITTER object. Mesh 0 should be a common nullmesh.
  • You can set the amount of fish by using a volume in Tomb Editor to change the Hit Points of the FISH_EMITTER.
  • You must change the OCB as it cannot be 0.
  • Positive OCB + mesh number: friendly fish
  • Negative OCB + mesh number: deadly fish
  • You can make the fish patrol between AI_FOLLOW objects:
  • A path can have any number of AI_FOLLOW objects, but it needs at least 3. The first AI_FOLLOW object should be on the start square of the FISH_EMITTER, and it should have the first OCB value. The fish will swim from there to the next two AI_FOLLOW objects in the path. The last AI_FOLLOW object in the path should have the last OCB value. Then, the fish will swim back to the first valid AI_FOLLOW object after the start square (the one with the first OCB value).
  • To create a different path for another school of fish, you need to skip an OCB number between the last OCB of the previous path and the first OCB of the new path. This way, the engine can distinguish which numbers belong to which swarm. The first AI_FOLLOW (the one on the same square as the FISH_EMITER) is not part of the patrolling, but it also requires an OCB. If you omit an AI_FOLLOW object on the fish emitter square, the fish will follow a random target within a solid spheroid inside the water room.
  • In the above example: Between the last ocb (4) and start of the new path (OCB 6) has to be a gap (no object with OCB 5) so that the engine knows there are 2 different paths.
  • If a CORPSE object is in the water, then the fish will be distracted and feast on that, rather than the player.

Flame Emitter 1 #

  • Whilst this is now more flexible to code via Lua: these OCBs are also useful for quick effects. Information taken from this post

Flame Emitter 2 #

  • OCB 1: Small flame (does not burn Lara)
  • OCB 2: Small flame moving slowly along the floor in the direction of the cone and will go up and down slopes. The flame will produce a bright flash and extinguish on contact with water.
  • OCB 4: tiny flame (perfect for candles).
  • OCB 123: small flame in the centre of the tile.

Flame Emitter 3 #

  • OCB 1: small blue electric arc.
  • OCB 2: blue electric arc from point of the cone.
  • OCB 3: large electric arc projecting holograph
  • OCB 888: Big ball of lightning that follows Lara.

Hammer #

  • OCB 0: It does not animate but will cause Lara damage if collided.
  • OCB 2: Hardcoded Obelisk set up.
  • OCB 3: Triggers once, then raises up and stays there.
  • OCB 4: Works like OCB 3 but will not stop. So once triggered will continuously raise, smackdown, raise up and then loop every two seconds.

Laser Barrier #

  • The colour of the laser is chosen in Tomb Editor by changing the object tint.
  • The room height decides laser height.
  • OCB value indicates how wide the laser will be. Ie: OCB 7 will mean it will be 7 sectors across.
  • Negative OCB: triggers heavy trigger and can be crossed without causing damage to the player
  • Positive OCB: Fatal to the player if crossed.

Laser Beam #

Available in TombEngine Version 1.4 – not currently released.

  • Positive OCB = lethal
  • Negative OCB = not lethal (activates trigger)
  • The colour of the laser is chosen in Tomb Editor by changing the object tint.
  • Laser thickness = OCB value. (For tripwire use OCB 1)
  • Can be freely rotated in Tomb Editor
  • If you are using a volume: you must set the activator type as “other” 

Rollingball #

  • OCB 1: Rollingball silent mode: No camera shake or sound.

Spiky Ceiling #

  • Can be any size or shape.
  • OCB = speed.
  • Negative OCB: travels up.
  • Positive OCB: travels down.
  • The speed can also be changed via Lua: Moveable::SetItemFlags[0]

Spiky Wall #

  • OCB number = speed
  • positive OCB : travels along the positive X axis.
  • Negative OCB – travels along the negative X axis.

Squishy Block 1 #

The squishy block is a block that will move side-to-side and crush Lara.

  • OCB 0: Default behaviour. 
  • OCB 1-300: Sets speed of the block.
    • Will travel between walls so to contain you must use WALL segments.
  • The direction of travel is set by rotating object in Tomb Editor

Squishy Block 2 #

The second version of this is a block that will fall to the ceiling and crush Lara on the floor.

Teeth Spikes #

  • Can be freely rotated inside Tomb Editor.
  • OCB 0: Ordinary TR4 teeth spikes behaviour
  • OCB 1: Spikes stuck out constantly
  • OCB 2: Stick out once and retract forever
  • OCB 3: OCB specifies spikes retraction delay in frames, i.e. OCB 30 = spikes will delay for 1 second, OCB 60 = 2 seconds, etc
  • Damage from teeth spikes is now dependent on the object’s collision.

Wolf #

  • OCB 0: Attacks player when triggered.
  • OCB 1: Starts sleeping. Trigger to wake them up.

Wraith Trap #

New object in place of the hardcoded Animating from TR4. Used to trap the Wraith entity.

  • OCB 0: Original TR4 effect
  • OCB 1: Enhanced effect where the wraith is pulled into the trap.

Vehicles

Jeep #

  • The vehicle no longer requires a key to operate and can be used like any other vehicle.
  • Improved handling and collision handling.
  • It can be driven into 2-click deep water. Previously was 1 click.
  • New graphic elements were added for water wakes and ripples if driven in shallow water.

Kayak #

  • If you wish to create a drowning effect as seen in Tomb Raider III, you need to assign a “water” footstep sound to the texture and attach a death flag to the specific sectors where you want Lara to drown. To gain more insight on this process, refer to this tutorial available HERE.
  • New graphic elements were added for water wakes and ripples.

Minecart #

  • The animating object used as the switch has been replaced with a dedicated Minecart_Switch object. To use this: place a HEAVY trigger underneath the switch and it will trigger this when it is hit with the wrench if Lara is riding in the minecart.
  • New graphic elements were added for water wakes and ripples if rode through shallow water.
  • New spark effects are added when braking harshly.

Motorbike #

  • Improved dynamic light on the front of the bike.
  • Improved handling and collision handling.
  • Does not currently support the nitrogen dioxide boost.

Speedboat & Rubberboat #

  • New graphic elements were added for water wakes and ripple on the top of the water’s surface.

Underwater Propulsion Vehicle (UPV) #

  • Restored dynamic light.
  • Bubble effects when in use.
  • Can fire harpoons as shown in Tomb Raider III.
  • Improved handling and unified controls.