Object Class
An `Entity` which occupies at least a single map tile and does not move.
Inheritance: Object ยป Entity
Subclasses: AtomAnalyser, Bench, Door, EntranceDoor, Helicopter, Machine, OperatingSink, Plant, RadiationShield, ReceptionDesk, SideObject, SurgeonScreen
Method Index
- _tick() (inherited from Entity)
- addReservedUser(user)
- afterLoad(old, new) (overrides Entity:afterLoad)
- clearDynamicInfo() (inherited from Entity)
- getDrawingLayer() (overrides Entity:getDrawingLayer)
- getDynamicInfo() (inherited from Entity)
- getRenderAttachTile()
- getRoom() (inherited from Entity)
- getSecondaryUsageTile()
- getWalkableTiles()
- initOrientation(direction)
- isReservedFor(user)
- notifyNewObject(id) (inherited from Entity)
- onClick(ui, button, data)
- onDestroy() (overrides Entity:onDestroy)
- playSound(name) (inherited from Entity)
- processTypeDefinition(object_type)
- removeReservedUser(user)
- removeUser(user)
- resetAnimation() (overrides Entity:resetAnimation)
- setAnimation(animation, flags) (overrides Entity:setAnimation)
- setDynamicInfo(type, value) (inherited from Entity)
- setLayer(layer, id) (inherited from Entity)
- setMood(mood_name, activate) (inherited from Entity)
- setMoodInfo(new_mood) (inherited from Entity)
- setPosition(x, y) (overrides Entity:setPosition)
- setSpeed(x, y) (inherited from Entity)
- setTile(x, y) (overrides Entity:setTile)
- setTilePositionSpeed(tx, ty, px, py, sx, sy) (inherited from Entity)
- setTimer(tick_count, f) (inherited from Entity)
- setUser(user)
- slaveMixinClass(class_method_table)
- tick() (overrides Entity:tick)
- tickDay() (inherited from Entity)
- updateDynamicInfo()
Member Index
- animation_flags
- animation_idx
- direction
- dynamic_info (*)
- footprint
- hospital
- init_anim_flags
- layers (*)
- mood_info (*)
- num_animation_ticks
- object_type
- orientation_before
- permanent_flags
- picked_up
- reserved_for
- reserved_for_list
- set_passable_flags
- skip_next_tick (*)
- slow_animation (*)
- split_anim_positions
- split_anims
- th
- ticks
- tile_x
- tile_y
- timer_function (*)
- timer_time (*)
- times_used
- user
- user_list
- user_of (*)
- world
function Object:Object(world, object_type, x, y, direction, etc)
Parameters:
Name | Type | Description |
---|---|---|
world | ? | ? |
object_type | ? | ? |
x | ? | ? |
y | ? | ? |
direction | ? | ? |
etc | ? | ? |
Declared on: line 37 of Lua/entities/object.lua.
function Object:addReservedUser(user)
Adds a reserved user for this object. If multiple_users_allowed is set there can be
many users reserving the object. reserved_for will then be the user who most recently
reserved this object.
Parameters:
Name | Type | Description |
---|---|---|
user | ? | ? |
Declared on: line 538 of Lua/entities/object.lua.
function Object:afterLoad(old, new)
Parameters:
Name | Type | Description |
---|---|---|
old | ? | ? |
new | ? | ? |
Overrides: Entity:afterLoad.
Declared on: line 701 of Lua/entities/object.lua.
function Object:getDrawingLayer()
Overrides: Entity:getDrawingLayer.
Declared on: line 33 of Lua/entities/object.lua.
function Object:getRenderAttachTile()
Get the primary tile which the object is attached to for rendering
For objects which attach to a single tile for rendering, this method will
return the X and Y Lua world co-ordinates of that tile. For objects which split
their rendering over multiple tiles, one of them is arbitrarily designated as
the primary tile, and its co-ordinates are returned.
Declared on: line 242 of Lua/entities/object.lua.
function Object:getWalkableTiles()
This function returns a list of all "only_passable" tiles belonging to an object.
It must be overridden by objects which do not have a footprint, but walkable tiles (e.g. doors of any kind)
Declared on: line 281 of Lua/entities/object.lua.
function Object:initOrientation(direction)
Initializes the footprint, finds out what to draw and checks for
split animations.
Parameters:
Name | Type | Description |
---|---|---|
direction | ? | The orientation in which the object is facing. |
Declared on: line 60 of Lua/entities/object.lua.
function Object:isReservedFor(user)
Checks whether the object is reserved for the specified user.
If the argument is nil a check for any reserved user is done.
Parameters:
Name | Type | Description |
---|---|---|
user | ? | ? |
Declared on: line 585 of Lua/entities/object.lua.
function Object:onClick(ui, button, data)
Called when the object is clicked
Parameters:
Name | Type | Description |
---|---|---|
ui | UI | The active ui. |
button | string | Which button was clicked. |
data | table | If some data should be retained after moving an object it is in this table. |
Declared on: line 611 of Lua/entities/object.lua.
function Object:onDestroy()
Overrides: Entity:onDestroy.
Declared on: line 673 of Lua/entities/object.lua.
function Object.processTypeDefinition(object_type)
Parameters:
Name | Type | Description |
---|---|---|
object_type | ? | ? |
Declared on: line 727 of Lua/entities/object.lua.
Note: Is a function rather than a method.
function Object:removeReservedUser(user)
If multiple_users_allowed is true: Removes the user specified from this object's list of reserved users.
If the argument is nil it is assumed that the list should be emptied.
Note that if there are many humanoids reserving this object reserved_for might still be set after a
call to this function.
Otherwise: sets reserved_for to nil.
Parameters:
Name | Type | Description |
---|---|---|
user | ? | ? |
Declared on: line 554 of Lua/entities/object.lua.
function Object:removeUser(user)
Removes a user from the set of users if multiple_users_allowed is set to true for this
object. Otherwise it sets "user" to nil. Please don't directly change the variable "user".
Parameters:
Name | Type | Description |
---|---|---|
user | ? | ? |
Declared on: line 508 of Lua/entities/object.lua.
function Object:resetAnimation()
Overrides: Entity:resetAnimation.
Declared on: line 666 of Lua/entities/object.lua.
function Object:setAnimation(animation, flags)
Parameters:
Name | Type | Description |
---|---|---|
animation | ? | ? |
flags | ? | ? |
Overrides: Entity:setAnimation.
Declared on: line 222 of Lua/entities/object.lua.
function Object:setPosition(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
Overrides: Entity:setPosition.
Declared on: line 206 of Lua/entities/object.lua.
function Object:setTile(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x | ? | ? |
y | ? | ? |
Overrides: Entity:setTile.
Declared on: line 293 of Lua/entities/object.lua.
function Object:setUser(user)
Sets the user of this object to the given user. Note that if multiple_users_allowed
is set to true for this object "user" will always be the last added user to this object.
Please do not modify object.user directly.
Parameters:
Name | Type | Description |
---|---|---|
user | ? | The user that is about to use this object. |
Declared on: line 491 of Lua/entities/object.lua.
function Object.slaveMixinClass(class_method_table)
Add methods to a class for creating and controlling a slave object
Parameters:
Name | Type | Description |
---|---|---|
class_method_table | ? | ? |
Declared on: line 111 of Lua/entities/object.lua.
Note: Is a function rather than a method.
function Object:tick()
Overrides: Entity:tick.
Declared on: line 188 of Lua/entities/object.lua.