obj.AvatarControl
This property requires further investigation
Bug: Setting the value of this property can crash the game
##Overview
[](Avatar (Entity)) [](Prisoner (Entity))
In escape mode, this property of Prisoner
and Avatar
entity objects indicates whether the player can or is controlling them (not sure which yet).
##Syntax
-- get
local userCanControl = someEntity.AvatarControl -- <value>
-- set
someEntity.AvatarControl = <value> -- does not seem to work
Where someEntity
is either a Prisoner
or Avatar
type of entity, and <value>
can be one of the following:
-
true
- the player can control the entity -
false
- the player can not control the entity -
nil
- equivalent meaning tofalse
Setting the value of this property generally has no effect, other than sometimes crashing the game (eg. if you try setting it on a Warden
object). As such it should be treated as a read-only property.
##Example
-- find all .AvatarControl entities
local controllable = {} -- to store the list
local function AddToList( type, list )
local entities = this.GetNearbyObjects( type, 9001 )
for entity in next, entities do
if entity.AvatarControl then
controllable[ #controllable + 1 ] = entity
end
end
end
AddToList( 'Prisoner' )
AddToList( 'Avatar' )
##Notes
The Avatar
represents the entity that the user was initially playing as, and any Prisoner
entities with the property will have been added to the players group (and can also be controlled by the player, even if the original Avatar
entity is killed and removed from the map).
##See Also
^ Open "Pages" to Search
- [Lua Basics](Lua Basics Guide)
- [Save-Load Cycle](Save-Load Cycle Guide)
[Globals](Object Globals):
- [
Game
](Game (Global)) - [
me
](me (Global)) - [
Object
](Object (Global)) - [
this
](this (Global))
[Events](Object Events):
- [Rotation table](Rotation table)
- [Id table](Id table)
- [Location table](Location table)
- [Velocity table](Velocity table)
[Methods](Object Methods):
.ApplyVelocity()
.ClearRouting()
.CreateJob()
.Delete()
.GetNearbyObjects()
.LeaveMap()
.NavigateTo()
.Sound()
[Properties](Object Properties):
.Active
.Age
.AiSetTarget
.AiWalkSpeed
.AnimateRotation
.AnimateVelocity
.AssignedRoom
.Attacker
.AttackTimer
.AvailableMoney
.AvatarControl
.BodyArmour
.BoilingPoint
.BookInCell
.Carried
.CarrierId
.Carrying
.CarryingBook
.Category
.Cell
.CellId
.CellIdTimer
.CloseTimer
-
.Connections
⚠️ .Contents
.CutsceneActor
.Damage
.Dest
.Door
.Driver
.Energy
.Equipment
.Entity
-
.ExternalPower
⚠️ .FailedToFindCell
.FeedJobId
.FireEngine
.Fireman
.FollowerId
.Fuel
.Gang
.Garbage
.HealingJobId
.Hidden
.Hose
.HoseOffset
.Hostage
.Id
.Intensity
.IsExternalTeacher
.IsNewIntake
.JobId
.LastAccess
.LastAte
.LastTreated
.LastVisitors
.LeavingMap
.Library
.Loaded
.Locked
.Misbehaviour
.Mode
.Naked
.Name
.Needs
.Office
-
.On
⚠️ .Open
.OpenDir
.Opened
.OpenOnTrigger
.OpenTimer
.Operation
.OperationTimer
.Or
.Patrol
.PermitPlayerControl
.PlayerOrderPos
.Pos
-
.Powered
⚠️ .Prisoner
.ProcessingRoom
.Quantity
.ReloadTimer
.RemotelyOpenable
.RequiredCellType
.RestState
.Result
.RotateDir
.SectorTimer
.Shackled
.Slot0..7
.SnitchTimer
.Speed
.State
.Station
.StatusEffects
.SubType
.TargetObject
.TazerTrained
.TimeOfLastMisconduct
.Timer
.Tooltip
.Triggered
.TriggeredBy
.TriggeredTime
.Type
.UnlockingDoor
.Vel
.WallCheckTimer
.Walls
.WatchingFight
.Weight
-
.Wired
⚠️ .WorldObject