Jump to content

Cage and Prison Enter / Exit detection


zaira

Recommended Posts

Posted

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 MariaEdensCageDoorScript extends ObjectReference  

ObjectReference Property MariaEdensCageTriggerBoxIN  Auto  
ObjectReference Property MariaEdensCageTriggerBoxOUT  Auto  

function PrepareTrigger()
	float angle = GetAngleZ()
	float xoffset = -(100 * math.sin(angle))
	float yoffset = -(100 * math.cos(angle))
	MariaEdensCageTriggerBoxIN.MoveTo(self, xoffset, yoffset, abMatchRotation = true)
	xoffset = (100 * math.sin(angle))
	yoffset = (100 * math.cos(angle))
	MariaEdensCageTriggerBoxOUT.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

 

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...