Object Class
An `Entity` which occupies at least a single map tile and does not move.
Inheritance: Object ยป Entity
Subclasses: AtomAnalyser, Bench, Chair, Door, EntranceDoor, Helicopter, Machine, OperatingSink, Plant, RadiationShield, Rathole, ReceptionDesk, SideObject, SurgeonScreen
Method Index
- _getUsageTile(usage_position_name)
- _tick() (inherited from Entity)
- addReservedUser(user)
- afterLoad(old, new) (overrides Entity:afterLoad)
- cancelUsage()
- clearDynamicInfo() (inherited from Entity)
- denyReservation()
- deoccupyTilesByObjectFootprintAt(x, y)
- directionParameters()
- eraseObject() (overrides Entity:eraseObject)
- getAllUsageTiles()
- getComplementaryPassableFlag(passable_flag)
- getDrawingLayer() (inherited from Entity)
- getDynamicInfo() (inherited from Entity)
- getRenderAttachTile()
- getRoom() (inherited from Entity)
- getSecondaryUsageTile()
- getState()
- getTile() (inherited from Entity)
- getWalkableTiles()
- getXYforUsePosition(object_x, object_y, object_layout, usage_position_name)
- incrementUsedCount()
- initOrientation(direction)
- isMachine()
- isReservedFor(user)
- notifyNewObject(id) (inherited from Entity)
- notifyNewRoom(room) (inherited from Entity)
- occupyTilesByObjectFootprintAt(x, y)
- onClick(ui, button, data)
- onDestroy() (overrides Entity:onDestroy)
- onPickUp() (overrides Entity:onPickUp)
- playAfterLoadSound() (inherited from Entity)
- playEntitySounds(name_pattern, min_silence_lengths, max_silence_lengths, num_silences) (inherited from Entity)
- playSound(name, played_callback, played_callback_delay) (inherited from Entity)
- processTypeDefinition(object_type)
- rebuildPassableCellFlags()
- removeReservedUser(user)
- removeUser(user)
- resetAnimation() (overrides Entity:resetAnimation)
- resetUsageAndReservaton()
- setAnimation(animation, flags) (overrides Entity:setAnimation)
- setDynamicInfo(type, value) (inherited from Entity)
- setInvisible(invisible)
- 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)
- setState(state)
- 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)
- setWaitingForSoundEffectsToBeTurnedOn() (inherited from Entity)
- slaveMixinClass(class_method_table)
- tick() (overrides Entity:tick)
- tickDay() (inherited from Entity)
- updateDynamicInfo()
- usePositionNames()
Member Index
- animation_flags
- animation_idx
- direction
- dynamic_info (*)
- footprint
- hospital
- layers (*)
- mood_info (*)
- mood_marker (*)
- num_animation_ticks
- object_type
- orientation_before
- permanent_flags
- picked_up
- playing_sounds_in_random_sequence (*)
- random_sound_sequence_parameters (*)
- 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 (*)
- waiting_for_sound_effects_to_be_turned_on (*)
- world
function Object:Object(hospital, object_type, x, y, direction, etc)
Parameters:
| Name | Type | Description |
|---|---|---|
| hospital | ? | ? |
| object_type | ? | ? |
| x | ? | ? |
| y | ? | ? |
| direction | ? | ? |
| etc | ? | ? |
Declared on: line 36 of Lua/entities/object.lua.
function Object:_getUsageTile(usage_position_name)
param usage_position_name (string) usage position name
return (table) table with {x, y, usage_position_name} table
Parameters:
| Name | Type | Description |
|---|---|---|
| usage_position_name | ? | ? |
Declared on: line 276 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 677 of Lua/entities/object.lua.
function Object:afterLoad(old, new)
Parameters:
| Name | Type | Description |
|---|---|---|
| old | ? | ? |
| new | ? | ? |
Overrides: Entity:afterLoad.
Declared on: line 892 of Lua/entities/object.lua.
function Object:deoccupyTilesByObjectFootprintAt(x, y)
param x (integer) target tile x coordinate.
param y (integer) target tile y coordinate.
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
Declared on: line 551 of Lua/entities/object.lua.
function Object.directionParameters()
Declared on: line 385 of Lua/entities/object.lua.
Note: Is a function rather than a method.
function Object:eraseObject()
Overrides: Entity:eraseObject.
Declared on: line 827 of Lua/entities/object.lua.
function Object:getAllUsageTiles()
object use positions
return (table) use positions offsets
Declared on: line 333 of Lua/entities/object.lua.
function Object.getComplementaryPassableFlag(passable_flag)
param passable_flag (string) 'passable_flag' that we want to invert.
return (string) inverted 'passable_flag'.
Parameters:
| Name | Type | Description |
|---|---|---|
| passable_flag | ? | ? |
Declared on: line 377 of Lua/entities/object.lua.
Note: Is a function rather than a method.
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 coordinates of that tile. For objects which split
their rendering over multiple tiles, one of them is arbitrarily designated as
the primary tile, and its coordinates are returned.
Declared on: line 243 of Lua/entities/object.lua.
function Object:getSecondaryUsageTile()
This function returns tile offset coordinate for "use_position_secondary"
return (int, int) x, y tile offset
Declared on: line 346 of Lua/entities/object.lua.
function Object:getState()
Gets the state of an object
The state can be later used to set the state of this object. This is
useful when we would destroy and create a new object that should represent
the same object.
Declared on: line 1049 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 358 of Lua/entities/object.lua.
function Object:getXYforUsePosition(object_x, object_y, object_layout, usage_position_name)
param usage_position_name (string) usage position name.
return (array) array with '{x, y, usage_position_name}' tables inside.
Parameters:
| Name | Type | Description |
|---|---|---|
| object_x | ? | ? |
| object_y | ? | ? |
| object_layout | ? | ? |
| usage_position_name | ? | ? |
Declared on: line 291 of Lua/entities/object.lua.
function Object:incrementUsedCount()
Call on object used. After object used increment use values accordingly.
Declared on: line 263 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 61 of Lua/entities/object.lua.
function Object:isMachine()
This function is for overriding it in the inheriting Machine class.
Declared on: line 750 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 724 of Lua/entities/object.lua.
function Object:occupyTilesByObjectFootprintAt(x, y)
param x (integer) target tile x coordinate.
param y (integer) target tile y coordinate.
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
Declared on: line 462 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 755 of Lua/entities/object.lua.
function Object:onDestroy()
Overrides: Entity:onDestroy.
Declared on: line 837 of Lua/entities/object.lua.
function Object:onPickUp()
Overrides: Entity:onPickUp.
Declared on: line 858 of Lua/entities/object.lua.
function Object.processTypeDefinition(object_type)
Parameters:
| Name | Type | Description |
|---|---|---|
| object_type | ? | ? |
Declared on: line 926 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 693 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 647 of Lua/entities/object.lua.
function Object:resetAnimation()
Overrides: Entity:resetAnimation.
Declared on: line 831 of Lua/entities/object.lua.
function Object:setAnimation(animation, flags)
Parameters:
| Name | Type | Description |
|---|---|---|
| animation | ? | ? |
| flags | ? | ? |
Overrides: Entity:setAnimation.
Declared on: line 223 of Lua/entities/object.lua.
function Object:setInvisible(invisible)
Set object invisible state.
param invisible (bool) 'true' to make the object invisible,
'false' to make the object visible.
Parameters:
| Name | Type | Description |
|---|---|---|
| invisible | ? | ? |
Declared on: line 609 of Lua/entities/object.lua.
function Object:setPosition(x, y)
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
Overrides: Entity:setPosition.
Declared on: line 207 of Lua/entities/object.lua.
function Object:setState(state)
Sets the state of an object
This is a complement to a pair function. IT will use the generated state
table to update it's state.
Parameters:
| Name | Type | Description |
|---|---|---|
| state | table | table holding the state |
Declared on: line 1061 of Lua/entities/object.lua.
function Object:setTile(x, y)
Parameters:
| Name | Type | Description |
|---|---|---|
| x | ? | ? |
| y | ? | ? |
Overrides: Entity:setTile.
Declared on: line 395 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 630 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 112 of Lua/entities/object.lua.
Note: Is a function rather than a method.
function Object:tick()
Overrides: Entity:tick.
Declared on: line 189 of Lua/entities/object.lua.
function Object:updateDynamicInfo()
Updates the object's dynamic info
Declared on: line 268 of Lua/entities/object.lua.
function Object:usePositionNames()
This function returns an array with use positions names
return (array) use positions names
Declared on: line 320 of Lua/entities/object.lua.