Class Objects.LaraObject
Class for player-only functions.
Do not try to create an object of this type. Use the built-in Lara variable instead. LaraObject inherits all the functions of Moveable.
Functions
| LaraObject:SetPoison([poison]) | Set the player's poison value. |
| LaraObject:GetPoison() | Get the player's poison value. |
| LaraObject:SetAir([air]) | Set the player's air value. |
| LaraObject:GetAir() | Get the player's air value. |
| LaraObject:SetWet([wetness]) | Set the player's wetness value, causing drips. |
| LaraObject:GetWet() | Get the player's wetness value. |
| LaraObject:SetStamina([New]) | Set the player's stamina value. |
| LaraObject:GetStamina() | Get the player's stamina value. |
| LaraObject:GetAirborne() | Get the player's airborne status (set when jumping and falling). |
| LaraObject:SetAirborne(airborne) | Set the player's airborne status. |
| LaraObject:UndrawWeapon() | Undraw a weapon if it is drawn and throw away a flare if currently holding one. |
| LaraObject:DiscardTorch() | Discard a held torch. |
| LaraObject:GetHandStatus() | Get the player's hand status. |
| LaraObject:SetHandStatus(status) | Set the player's hand status. |
| LaraObject:GetWeaponType() | Get the player's weapon type. |
| LaraObject:SetWeaponType(weaponType, [activate]) | Set the player's weapon type. |
| LaraObject:GetLaserSight(weaponType) | Get player lasersight status. |
| LaraObject:SetLaserSight(weaponType, [activate]) | Set player lasersight status. |
| LaraObject:GetAmmoType([weaponType]) | Get player weapon ammo type. |
| LaraObject:SetAmmoType(Player) | Set player weapon ammo type. |
| LaraObject:GetAmmoCount() | Get current weapon's ammo count. |
| LaraObject:GetWeaponMode() | Get player HK weapon mode type. |
| LaraObject:SetWeaponMode(weaponMode) | Set player HK weapon mode type. |
| LaraObject:GetVehicle() | Get current vehicle, if it exists. |
| LaraObject:GetTarget() | Get the player's current targeted moveable (if it exists). |
| LaraObject:GetInteractedMoveable() | Get the player's current interacted moveable (if it exists). |
| LaraObject:IsTorchLit() | Check if a held torch is lit. |
| LaraObject:GetWaterStatus() | Get player water status. |
| LaraObject:GetWaterSkinStatus(flag) | Get player water skin amount. |
| LaraObject:SetWaterSkinStatus(amount, flag) | Set player water skin amount. |
| LaraObject:Interact(mov, [animNumber], [offset], [minOffsetConstraint], [maxOffsetConstraint], [minRotConstraint], [maxRotConstraint], [actionID], [objectID], [interactionType]) | Align the player with a moveable object for interaction. |
| LaraObject:TestInteraction(mov, [minOffsetConstraint], [maxOffsetConstraint], [minRotConstraint], [maxRotConstraint]) | Test the player against a moveable object for interaction. |
Functions
- LaraObject:SetPoison([poison])
-
Set the player's poison value.
Parameters:
- poison int New poison value. Default: 0, Maximum: 128. Default: 0.
Usage:
Lara:SetPoison(10) - LaraObject:GetPoison()
-
Get the player's poison value.
Returns:
-
int
Poison value.
Usage:
local poisonPotency = Lara:GetPoison() - LaraObject:SetAir([air])
-
Set the player's air value.
Parameters:
- air int New air value. Maximum: 1800. Default: 1800.
Usage:
Lara:SetAir(100) - LaraObject:GetAir()
-
Get the player's air value.
Returns:
-
int
Air value.
Usage:
local currentAir = Lara:GetAir() - LaraObject:SetWet([wetness])
-
Set the player's wetness value, causing drips.
Parameters:
- wetness int New wetness value. Maximum: 255. Default: 64.
Usage:
Lara:SetWet(100) - LaraObject:GetWet()
-
Get the player's wetness value.
Returns:
-
int
Wetness value.
Usage:
local dripAmount = Lara:GetWet() - LaraObject:SetStamina([New])
-
Set the player's stamina value.
Parameters:
- New int stamina value. Maximum: 120. Default: 120.
Usage:
Lara:SetStamina(120) - LaraObject:GetStamina()
-
Get the player's stamina value.
Returns:
-
int
Stamina value.
Usage:
local sprintEnergy = Lara:GetStamina() - LaraObject:GetAirborne()
-
Get the player's airborne status (set when jumping and falling).
Returns:
-
bool
True if airborne, otherwise false.
- LaraObject:SetAirborne(airborne)
-
Set the player's airborne status.
Parameters:
- airborne bool New airborne status.
- LaraObject:UndrawWeapon()
-
Undraw a weapon if it is drawn and throw away a flare if currently holding one.
Usage:
Lara:UndrawWeapon()
- LaraObject:DiscardTorch()
-
Discard a held torch.
Usage:
Lara:DiscardTorch()
- LaraObject:GetHandStatus()
-
Get the player's hand status.
Returns:
-
HandStatus
Hand status.
Usage:
local handStatus = Lara:GetHandStatus() - LaraObject:SetHandStatus(status)
-
Set the player's hand status.
Parameters:
- status HandStatus Status type to set.
- LaraObject:GetWeaponType()
-
Get the player's weapon type.
Returns:
-
WeaponType
Current weapon type.
Usage:
local weaponType = Lara:GetWeaponType() - LaraObject:SetWeaponType(weaponType, [activate])
-
Set the player's weapon type.
Parameters:
- weaponType WeaponType New weapon type to set.
- activate
bool
If
true, also draw the weapons or set torch lit. Iffalse, keep weapons holstered or leave torch unlit. Default: false.
Usage:
Lara:SetWeaponType(WeaponType.PISTOLS, false) - LaraObject:GetLaserSight(weaponType)
-
Get player lasersight status.
Parameters:
- weaponType WeaponType Player weapon type. Only works for HK, Revolver and Crossbow.
Returns:
-
bool
Returns true if lasersight is connected to specified weapon.
Usage:
local test = Lara:GetLaserSight(WeaponType.CROSSBOW) - LaraObject:SetLaserSight(weaponType, [activate])
-
Set player lasersight status.
Parameters:
- weaponType WeaponType Player weapon type to attach lasersight to. Only works for HK, Revolver and Crossbow.
- activate
bool
If
true, also draw the weapons. Iffalse, keep weapons holstered. Default: false.
Usage:
local test = Lara:SetLaserSight(WeaponType.CROSSBOW) - LaraObject:GetAmmoType([weaponType])
-
Get player weapon ammo type.
Parameters:
- weaponType WeaponType Weapon to retrieve ammo type for. If omitted, the ammo type of the currently equipped weapon is returned. Optional.
Returns:
-
AmmoType
Player weapon ammo type.
Usage:
local CurrentAmmoType = Lara:GetAmmoType() - LaraObject:SetAmmoType(Player)
-
Set player weapon ammo type.
Parameters:
- Player AmmoType weapon ammo type.
Usage:
Lara:SetAmmoType(TEN.Objects.AmmoType.CROSSBOW_BOLT_NORMAL)
- LaraObject:GetAmmoCount()
-
Get current weapon's ammo count.
Returns:
-
int
Current ammo count (-1 if infinite).
Usage:
local equippedWeaponAmmoLeft = Lara:GetAmmoCount() - LaraObject:GetWeaponMode()
-
Get player HK weapon mode type.
Returns:
-
WeaponMode
Player HK weapon mode type.
- LaraObject:SetWeaponMode(weaponMode)
-
Set player HK weapon mode type.
Parameters:
- weaponMode WeaponMode Player HK weapon mode type.
- LaraObject:GetVehicle()
-
Get current vehicle, if it exists.
Returns:
-
Moveable
Current vehicle (nil if no vehicle present).
Usage:
local vehicle = Lara:GetVehicle() - LaraObject:GetTarget()
-
Get the player's current targeted moveable (if it exists).
Returns:
-
Moveable
Target moveable (nil if the player is not currently targeting a moveable).
Usage:
local target = Lara:GetTarget() - LaraObject:GetInteractedMoveable()
-
Get the player's current interacted moveable (if it exists).
Returns:
-
Moveable
Interacted moveable (nil if the player is not interacting with a moveable).
Usage:
local interactedMoveable = Lara:GetInteractedMoveable() - LaraObject:IsTorchLit()
-
Check if a held torch is lit.
Returns:
-
bool
True if lit, otherwise false (also false if there is no torch in hand).
Usage:
local isTorchLit = Lara:IsTorchLit() - LaraObject:GetWaterStatus()
-
Get player water status.
Returns:
-
WaterStatus
Current water status of player.
Usage:
local waterStatus = Lara:GetWaterStatus() - LaraObject:GetWaterSkinStatus(flag)
-
Get player water skin amount.
Parameters:
- flag bool use True get the amount for Big Waterskin. False for Small Waterskin.
Returns:
-
int
Current capacity of specified water skin. For Smallwater skin (0 = Waterskin not present; 1 = Waterskin Empty; 2 = Waterskin 1L; 3 = WaterSkin 2L; 4 = Waterskin 3L).
For Largewater skin (0 = Waterskin not present; 1 = Waterskin Empty; 2 = Waterskin 1L; 3 = WaterSkin 2L; 4 = Waterskin 3L; 5 = Waterskin 4L; 6 = Waterskin 5L)
Usage:
local bigWaterSkinCapacity = Lara:GetWaterSkinStatus(true) local smallWaterSkinCapacity = Lara:GetWaterSkinStatus(false)
- LaraObject:SetWaterSkinStatus(amount, flag)
-
Set player water skin amount.
Parameters:
- amount int Current capacity of specified water skin. For Smallwater skin (0 = Waterskin not present; 1 = Waterskin Empty; 2 = Waterskin 1L; 3 = WaterSkin 2L; 4 = Waterskin 3L). For Largewater skin (0 = Waterskin not present; 1 = Waterskin Empty; 2 = Waterskin 1L; 3 = WaterSkin 2L; 4 = Waterskin 3L; 5 = Waterskin 4L; 6 = Waterskin 5L)
- flag bool use True get the amount for Big Waterskin. False for Small Waterskin.
Usage:
local bigWaterSkinCapacity = Lara:SetWaterSkinStatus(2) local smallWaterSkinCapacity = Lara:SetWaterSkinStatus(3)
- LaraObject:Interact(mov, [animNumber], [offset], [minOffsetConstraint], [maxOffsetConstraint], [minRotConstraint], [maxRotConstraint], [actionID], [objectID], [interactionType])
-
Align the player with a moveable object for interaction.
Parameters:
- mov Moveable Moveable object to align the player with.
- animNumber int The animation to play after alignment is complete. Default: 197 (BUTTON_PUSH).
- offset Vec3 Relative position offset from the moveable. Default: Vec3(0, 0, 312).
- minOffsetConstraint Vec3 Minimum relative offset constraint. Default: Vec3(-256, -512, 0).
- maxOffsetConstraint Vec3 Maximum relative offset constraint. Default: Vec3(256, 0, 512).
- minRotConstraint Rotation Minimum relative rotation constraint. Default: Rotation(-10, -40, -10).
- maxRotConstraint Rotation Maximum relative rotation constraint. Default: Rotation(10, 40, 10).
- actionID ActionID Input action ID to trigger the alignment. Default: Input.ActionID.ACTION.
- objectID ObjID Object ID required in inventory for interaction. Optional.
- interactionType InteractionType Interaction icon type to show. Optional.
Usage:
local Lara:Interact( moveable, 197, Vec3(0, 0, 312), Vec3(-256, -512, -256), Vec3(256, 0, 512), Rotation(-10, -30, -10), Rotation(10, 30, 10), TEN.Input.ActionID.ACTION)
- LaraObject:TestInteraction(mov, [minOffsetConstraint], [maxOffsetConstraint], [minRotConstraint], [maxRotConstraint])
-
Test the player against a moveable object for interaction.
Parameters:
- mov Moveable Moveable object to align the player with.
- minOffsetConstraint Vec3 Minimum relative offset constraint. Default: Vec3(-256, -512, 0).
- maxOffsetConstraint Vec3 Maximum relative offset constraint. Default: Vec3(256, 0, 512).
- minRotConstraint Rotation Minimum relative rotation constraint. Default: Rotation(-10, -40, -10).
- maxRotConstraint Rotation Maximum relative rotation constraint. Default: Rotation(10, 40, 10).
Returns:
-
bool
Returns true if the player is inside the specified bounds.