Scripting Reference
Introduction
T4Mod scripting
Script operation
Items and object types
Positions and Rooms
Ticks and Timers
Savegames and Hubs
Configuration file
Debug console
Audio
playMusic
- play music file
playSfx
- play sound effect
setDefaultMusic
- set background music
Configuration
config
- configuration functions
config.pushables
- pushables configuration
config.getVolFx
- get folumetric fx
config.setClipDistance
- set max visibility
config.setFogColor
- set fog color
config.setFogFar
- set far distance
config.setFogNear
- set fog near distance
config.setVolFx
- set volumetric fx
config.setVolFxColor
- set fogbulb color
pushable
:allowPull
- set sokoban mode
pushable
:setGrip
- pushable grabbing
pushable
:setHeight
- set pushable height
FlipEffect Triggers
onFlipEffect
- bind flipeffect action
unbindFlipEffect
- remove flipeffect actions
Inventory
inventory
- Inventory functions
inventory.add
- add items to inventory
inventory.count
- set item amount in inventory
inventory.remove
- remove items from inventory
inventory.set
- set item amount in inventory
Items
item
- global items table
getColliders
- get colliders at position
itemobj
:addHealth
- add health for an item
itemobj
:getAnim
- get item's current animation
itemobj
:getColliders
- get objects colliding w/item
itemobj
:getHealth
- get an item's health
itemobj
:getMeshPos
- get lara's mesh positions
itemobj
:getOcb
- get OCB value of item
itemobj
:getPitch
- rotate an item
itemobj
:getPosition
- get item position
itemobj
:getRoll
- rotate an item
itemobj
:getRotation
- get item x/y/z rotation
itemobj
:getSpecials
- get item special values
itemobj
:getSpeed
- get item speed
itemobj
:getState
- get item's animation state
itemobj
:getType
- get item's type id
itemobj
:getYaw
- rotate an item
itemobj
:kill
- removes item from the level
itemobj
:moveBy
- move an item by an offset
itemobj
:moveTo
- move an item
itemobj
:playSfx
- play sound at item position
itemobj
:setAnim
- get item's current animation
itemobj
:setAsTarget
- set an item as potential target
itemobj
:setHealth
- set an item's health
itemobj
:setOcb
- set OCB value for item
itemobj
:setPitch
- rotate an item
itemobj
:setRoll
- rotate an item
itemobj
:setRotation
- rotate item around all three axis
itemobj
:setSpecials
- set item special values
itemobj
:setSpeed
- set item speed
itemobj
:setState
- set item's animation state
itemobj
:setYaw
- rotate an item
itemobj
:shatterMesh
- shatter an item's mesh
itemobj
:trigger
- trigger item
itemobj
:turnBy
- rotate an item
Keyboard
onKey
- bind keyboard action
unbindKey
- remove keyboard callbacks
Lights
addFlash
- add temporary foglight flash
addLight
- add temporary dynamic light
Misc
binAnd
- binary and
binOr
- binary or
binXor
- binary exclusive or (xor)
changeLevel
- jump to another level
getActionState
- get Lara's hands/action state
getMouse
- get mouse coordinates and buttons
getStamina
- get Lara's stamina
rgb
- create a color
setActionState
- set Lara's hands/action state
setStamina
- set Lara's stamina
Particles
particle
- particle functions
particle.addArc
- add a electric arc beam effect
particle.addLightning
- add a lightning beam effect
particle.addShockwave
- start a shockwave effect
particle.addSprite
- add a sprite particle
particle.addStreak
- add a line streak particle
Rooms
findRoom
- find room by world coords.
flipGroup
- toggle fliproom group
getCeiling
- get exact ceiling height at room position
getFloor
- get exact floor height at room position
getFloorCeiling
- get exact floor and ceiling height
getSectorHeight
- get sector lowest/highest
Screen and Camera Effects
setFader
- screen fader
setFov
- set camera lens/field of view
setMovieBars
- cinematic borders
startQuake
- start earthquake rumble
Text Display
textBox
- display text on screen
textBoxOff
- hide text boxes
Timers
startTimer
- start a timer
stopAllTimers
- stop all timers
stopTimer
- stop a timer