Modding:Lua/Tables/Self
From Starbounder - Starbound Wiki
< Modding:Lua | Tables
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
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
self.sensors
self.target
Commonly used to store the current targets entity id.
Type: number
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
Portal - Basics - JSON - Lua - Assets - Guides
Tables - Hooks - Tips & Tricks - Libraries - All Pages