Skip to content
aubergine10 edited this page Oct 29, 2015 · 2 revisions

This property requires further investigation

PA Bug 9969

##Overview

Defines whether an Entity is rested, needs rest, or is resting.

This property is not present on entities which have Properties DoesNotTire in their materials.txt definition.

Prisoner rest requirements are handled by their Needs.Sleep which gradually increases throughout the day, and can be decreased by suitable needs providers (namely, a Bed). That being said, they still have a .RestState property - needs more investigation!

##Syntax

local state = someEntity.RestState -- string

someEntity.RestState = <number> -- Bug 9969

Values:

  • 'RestStateRequired' – they are tired and need rest
  • 'RestStateResting' – they are currently resting
  • (unconfirmed) 'RestStateOK' – they don't currently need rest
  • nil - either not an entity, or the entity DoesNotTire

PA Bug 9969: When setting the value of the property you need to use an integer. Currently not tested to see which integer relates to the various states.

##Examples

if this.RestState == 'RestStateResting' then
   -- the entity is currently resting
end

##Mods

##Notes

When the Energy value of an entity drops to a certain point, the entity will become "Tired" and its RestState will be set to 'RestStateRequired'. It's not yet known which Energy values relate to which RestState values, or whether the two properties can be used independently of each other.

The entity will then go to its designated resting room, which depends on the type of entity:

  • [Dogs](Dog (Entity)) rest in their kennels
  • Other staff entities rest in the Staffroom

While resting, the entity will have a RestState of 'RestStateResting' and its Energy value will gradually increase until they are fully rested.

Once fully rested, the RestState will change to 'RestStateOK' (unconfirmed) and the entity will resume their work.

  • Doctor entities will often go to the Infirmary that's closest to the Staffroom they were resting in, rather than the infirmary they were previously stationed at (this might have been fixed, needs further testing)
  • Guards will look for whatever work needs doing (utility station, deployment, patrols, opening doors, watching rooms based on active regime slot) and if they can't find work they'll usually wander around Storage areas.

The Energy value will gradually decrease whilst not resting, until it reaches a point where more rest is required.

##See Also

^ Open "Pages" to Search



Guides:

  • [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):

Psuedo-Types:

  • [Rotation table](Rotation table)
  • [Id table](Id table)
  • [Location table](Location table)
  • [Velocity table](Velocity table)

[Methods](Object Methods):

[Properties](Object Properties):

Clone this wiki locally