obj.Active - originalfoo/Prison-Architect-API GitHub Wiki
This property needs further investigation
##Overview
This property seems specific to [CCTV cameras](Cctv (object)) and indicates whether the camera is currently active ('watching the room') or not.
It's possible it also appears on Phone Booths and Door Servos (not checked).
##Syntax
-- get:
local state = someCCTV.Active
-- set:
someCCTV.Active = [true|false] -- untestedValues:
-
true- the camera is active -
false- the camera is inactive -
nil- the object is not a CCTV camera
Not yet tested to see what happens when setting the property - does it actually change camera state or is it quickly overwritten by internal game code?
##Example
local find = this.GetNearbyObjects
-- delete all inactive CCTV cameras
for cctv in next, find( 'Cctv', 1000 ) do
if not cctv.Active then
cctv.Delete()
end
end##Notes
While active:
- The camera will rotate in the direction (and speed?) specified by it's
.RotateDirproperty. - It will clear the "fog of war" for up to 20 tiles within it's cone of view (something like a 30° arc emanating from the camera).
- The rotation arc is limited by adjacent
.Wallsand is periodically refreshed based on.WallCheckTimer. - When the camera reaches the limit of its arc, its
.RotateDirwill be updated to make it rotate in the opposite direction.
While inactive:
- It will not clear the fog of war
- It will not rotate
In the base game, the camera must have one or more incoming .Connections from a monitor; if any of the connections are .Triggered, the camera will be active. To prevent users from simply connecting a switch or other logic signal to the camera in order to activate it, it must be .Triggered (and thus activated) with a value of 5.
##See Also