In my mod I use trigger boxes to detect whether the user enters or exits a cage. Therefore I have attached a script to the cage door base object that moves two trigger boxes to the door when it is activated or addressed in any other way. One in front of the door and one behind. It works perfectly with any vanilla cage - but now I want to do something similar with jail doors. I don't know why - but this won't work. Two questions: does anybody have another idea how to detect passing a vanilla door?can I visualize trigger boxes in the game like in CK?Here is the code that does the trick:
scriptname MyCageDoorScript extends ObjectReference
ObjectReference Property MyCageTriggerBoxIN Auto
ObjectReference Property MyCageTriggerBoxOUT Auto
function PrepareTrigger()
float angle = GetAngleZ()
float xoffset = -(100 * math.sin(angle))
float yoffset = -(100 * math.cos(angle))
MyCageTriggerBoxIN.MoveTo(self, xoffset, yoffset, abMatchRotation = true)
xoffset = (100 * math.sin(angle))
yoffset = (100 * math.cos(angle))
MyCageTriggerBoxOUT.MoveTo(self, xoffset, yoffset, abMatchRotation = true)
endfunction
event OnActivate(ObjectReference ActorREF)
PrepareTrigger()
endevent
event OnOpen(ObjectReference ActorREF)
PrepareTrigger()
endevent
event OnClose(ObjectReference ActorREF)
PrepareTrigger()
endevent