Modding:Lua/Tables/Self

From Starbounder - Starbound Wiki
Jump to: navigation, search

Description

This table contains data for the entity. It is available to all types of entities and can be used to temporarlity store information. For persistent storage, see the Storage table.

Since this table doesn't have a definition, here are some common variables stored in it.

Variables

self.aggressive

Used to store the default aggressive state of this entity.
Type: boolean
See also: No related links.

self.debug

Whether or not debug mode is active. Currently useless.
Type: boolean
See also: util.debugLog util.debugLine util.debugRect

self.dead

Commonly used in helpers to tell the entity that it should be dead.
Type: boolean
See also: No related links.

self.ownerEntityId

Commonly used to store the owners entity id, usually as an uuid.
Type: number
See also: No related links.

self.position

Commonly used to store the entities position.
Type: table<Vector2>
See also: self.targetPosition

self.sensors

Commonly used to store this entities sensors or sensor groups.
Type: table
See also: Sensors

self.target

Commonly used to store the current targets entity id.
Type: number
See also: self.targetId util.trackTarget util.trackExistingTarget

self.targetId

Commonly used to store the current targets entity id.
Type: number
See also: util.trackTarget util.trackExistingTarget

self.targetPosition

Commonly used to store the last known position of the target when losing sight of it.
Type: table<Vector2>
See also: util.trackTarget util.trackExistingTarget

Quick Navigation

Quick Navigation