obj.TargetObject - originalfoo/Prison-Architect-API GitHub Wiki

This property is not fully tested

##Overview

This property seems specific to Prisoner entity objects, and denotes which object they are currently attacking.

##Syntax

local objId = prisoner.Target.Obj -- {i, u}

prisoner.TargetObj.i, prisoner.TargetObj.u = someObj.Id.i, someObj.Id.u -- not tested

##Example

##Notes

The targeted object behaves like a beacon that attracts nearby guards who will then rush to its defence; they will go to the object first, and only then start engaging (fighting) the prisoner who is/was attacking it.

If the property becomes nil (which can sometimes happen if the targeted object is destroyed, dismantled or dumped) any fight between the prisoner and responding guards will usually end. Setting the i and u properties to -1 or 0 might also work (not tested).

##See Also

⚠️ **GitHub.com Fallback** ⚠️