Lua API
On this page

PhysicsEnvironment

Inherits from

Allows access to information about the local physics environment. If in a dungeon, its the entire dungeon environment. If in a building, it will be the building and outside landblocks if they are visible. If outside, it will be all adjacent landblocks.

Fields:

CanSeeOutside boolean

read only

True if you can see outside from your character's location

CurrentLandblock number

read only

Current landblock your character is in (landcell 0xFFFF0000)

CurrentLandcell number

read only

Current landcell your character is in

IsDungeon boolean

read only

True if your character is inside a dungeon. This does not count buildings.

IsInside boolean

read only

Wether your character is inside or not. Inside is buildings / dungeons.

IsOutside boolean

read only

Wether or not your character is outside. Outside meaning on the landscape, not in a building or dungeon.

VisibleLandblocks number[]

read only

A list of landblocks visible from your character's location. This does not mean you have a direct line of sight, but rather that it is close enough to not be despawned by the client.

VisibleLandcells number[]

read only

A list of landcells that are visible from your characters location. This does not mean you have a direct line of sight, but rather that it is close enough to not be despawned by the client.

Methods:

GetPropertyKeys() : string[]

Returns a list of strings of all public property / field names. Useful for reflection on UserData in lua scripts

Returns:string[]

IsLandcellVisible(landcell: number) : boolean

Check if the given landcell id is visible. This does not mean you have a direct line of sight, but rather that it is close enough to not be despawned by the client.

Parameters:
NameTypeDefaultSummary
landcellnumber

The landcell to check

Returns:boolean

ToString() : string

Returns a string that represents the current object.

Returns:string