obj.Age
This property needs further investigation
##Overview
This property, which is found on Garbage, Tree and Prisoner objects, defines their age.
##Syntax
-- get:
local age = obj.Age -- <number> or nil
-- set:
obj.Age = <number> -- not tested
Values:
-
<number>
- a number representing the age of the object (in game seconds = prison minutes) -
nil
- the object does not have an age property
##Example
-- if garbage is too old, let's destroy it
local maxAge = 720 -- 60 prison mins * 12hrs (12 real-life minutes)
local find = this.GetNearbyObjects
for garbage in next, find( 'Garbage', 9001 ) do
if garbage.Age > maxAge then
garbage.Delete()
end
end
##Notes
Prisoners seem to be given an random starting age when they first arrive in the prison. In the case of Garbage and Trees, their age starts at 0
when they are first placed on the map. Trees that are auto-generated during map creation start with an age of 7200.000
.
The age of a tree is used to determine which SubType (sprite) is used so that the trees will grow from a sapling to a mature tree over time. Testing is needed to determine what age ranges relate to each SubType.
##See Also
-
data/
scripts/
: -
data/
materials.txt
:-
Properties
Rubbish
-
Entities:
- [
Prisoner
](Prisoner (Entity))
- [
-
Trash:
- [
Garbage
](Garbage (Trash)) - [
Rubble
](Rubble (Trash))
- [
- ?:
- [
Tree
](Tree (Object))
- [
-
^ 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