Skip to content
This repository has been archived by the owner on Jul 19, 2020. It is now read-only.

Latest commit

 

History

History
147 lines (89 loc) · 3.87 KB

location.rst

File metadata and controls

147 lines (89 loc) · 3.87 KB

lua

lua

class Location

Constants

INVALID

Invalid location. Aliased globally as LOCATION_INVALID.

Functions

Location.Create(position, orientation, area)

Create a new location

param position

Location's position

type position

Vector

param orientation

Location's orientation

type orientation

Vector

param area

Location's area

type area

Area

rtype

Location instance.

Location.FromString(str)

Convert string to location.

param string str

String representation of a location. Format: "area_tag (x, y, z) orientation"

rtype

Location instance.

Methods

Location:ApplyEffect(durtype, eff, duration)

Applies an effect to a location.

param int durtype

DURATION_TYPE*

param eff

Effect to apply.

type eff

Effect

param float duration

Duration in seconds. If not passed the visual will be applied as DURATION_TYPE_INSTANT.

Location:ApplyVisual(vfx, duration)

Applies a visual effect to a location

param int vfx

VFX*

param float duration

Duration in seconds. If not passed the visual will be applied as DURATION_TYPE_INSTANT.

Location:GetNearestObject(mask, nth)

Gets nearest object to location

param int mask

OBJECT_TYPE*

param int nth

Which object to find.

Location:GetNearestCreature(type1, value1, nth, ...)

Gets nearest creature to location.

param int type1

First criteria type

param int value1

First crieria value

param int nth

Nth nearest.

param int type2

Second criteria type. (Default: -1)

param int value2

Second criteria value. (Default: -1)

param int type3

Third criteria type. (Default: -1)

param int value3

Third criteria value. (Default: -1)

Location:ToString()

Convert location to string

Location:Trap(type, size, tag, faction, on_disarm, on_trigger)

Create square trap at location.

param int type

TRAP_BASE_TYPE*

param float size

(Default 2.0)

param string tag

Trap tag. (Default: "")

param int faction

Trap faction. (Default: STANDARD_FACTION_HOSTILE)

param string on_disarm

OnDisarm script. (Default: "")

param string on_trigger

OnTriggered script. (Default: "")

Location:SetTileMainLightColor(color1, color2)

Sets the main light colors for a tile.

param int color1

AREA_TILE_SOURCE_LIGHT_COLOR*

param int color2

AREA_TILE_SOURCE_LIGHT_COLOR*

Location:SetTileSourceLightColor(color1, color2)

Sets the source light color for a tile.

param int color1

AREA_TILE_SOURCE_LIGHT_COLOR*

param int color2

AREA_TILE_SOURCE_LIGHT_COLOR*

Location:GetTileMainLight1Color()

Determines the color of the first main light of a tile.

rtype

AREA_TILE_SOURCE_LIGHT_COLOR*

Location:GetTileMainLight2Color()

Determines the color of the second main light of a tile.

rtype

AREA_TILE_SOURCE_LIGHT_COLOR*

Location:GetTileSourceLight1Color()

Determines the color of the first source light of a tile.

rtype

AREA_TILE_SOURCE_LIGHT_COLOR*

Location:GetTileSourceLight2Color()

Determines the color of the second source light of a tile.

rtype

AREA_TILE_SOURCE_LIGHT_COLOR*

Location:GetArea()

Get area from location.

Location:GetDistanceBetween(to)

Gets distance between two locations.

param to

The location to get the distance from.

type to

Location

Location:GetFacing()

Gets orientation of a location

Location:GetPosition()

Gets position vector of a location