Jump to content

Trigger boxes, airlocks, and decon chambers oh my …


pepperman35

Recommended Posts

In my mod, I have a Nuclear Fusion Power Plant which generates power for the settlement on Spectacle Island. The reactor is situated within a containment chamber. What I would like to do is setup and auto-decontamination chamber for the entryway to the containment chamber. A series of decontamination arches would exist inside the containment chamber. The auto-decontamination chamber would function as an airlock, auto sense whether the player required decontamination, open/close airlock doors as required, and apply decontamination treatment as required.


I am aware of the mass fusion reactor setup, and the decon chamber there. But was wondering if trigger boxes would be an effective way to setup the airlock and auto-decontamination chamber. Never used trigger boxes before so thought I’d inquire with resident experts before proceeding down this path.

Edited by pepperman35
Link to comment
Share on other sites

Yes, you can use triggerboxes. Check out the "ontriggerenter" and "ontriggerleave" entries at the Creationkitwiki

For the doors the setopen(true/false) command should suffice. Also the .lock() command if you want't them to be locked or unlocked.

 

Haven't found anything to specifically check if the player has a certain amount of rads though.

Link to comment
Share on other sites

Thanks guys for the input. I'll start down this path and see where it leads. Opening the airlock doors should be fairly straight forward but then again nothing in the CK seems to be straight forward (at least not for me). I'll have to shake the research tree a bit and see what commands exists to indicate a play has radiation.

Link to comment
Share on other sites

Ok first trigger box setup with the following script. Might need to change somewhat as I think through the logic of the airlock and auto-decon chamber.

 

Scriptname NFPP_OpenAirlockDoorOnTriggerEnter extends ObjectReference

{Open and close airlock doors when the player enters and leaves the trigger.}

 

Group Required_Properties

;Airlock doors.

Default2StateActivator property NFPP_AirlockDoor01 auto const mandatory

{The outer airlock door.}

Default2StateActivator property NFPP_AirlockDoor02 auto const mandatory

{The inner airlock door.}

EndGroup

 

bool bTargetInTrigger = false conditional

 

objectReference property targetRef auto

{ if None (default), watching for player otherwise, watching for this reference}

 

Event onLoad()

if targetRef == None

targetRef = game.getPlayer()

endif

endEvent

 

auto STATE WaitForTrigger

 

Event onTriggerEnter(objectReference triggerRef)

if(triggerRef == targetRef)

;target has entered the trigger

SetTargetInTrigger(true)

debug.trace(self + " target has entered the trigger")

debug.notification("Entered Trigger")

endif

endEvent

 

Event onTriggerLeave(objectReference triggerRef)

if (triggerRef == targetRef)

;target has left the trigger

SetTargetInTrigger(false)

debug.trace(self + " target has left the trigger")

debug.notification("Leaving Trigger")

endif

endEvent

EndSTATE

 

STATE Done

 

EndSTATE

bool function IsTargetInTrigger()

return bTargetInTrigger

endFunction

 

; PRIVATE function - do not call from outside this script

function SetTargetInTrigger(bool isInTrigger)

bTargetInTrigger = isInTrigger

fireTriggerEvent()

endFunction

 

function fireTriggerEvent()

; perform action when target enters/leaves trigger

if (bTargetInTrigger == true)

; Open the outer airlock door

NFPP_AirlockDoor01.SetOpen(True)

debug.notification("Opening Outer Door")

; Close the inner airlock door

NFPP_AirlockDoor02.SetOpen(False)

else

; Close the outer airlock door

NFPP_AirlockDoor01.SetOpen(False)

debug.notification("Closing Outer Door")

; Open the inner airlock door

NFPP_AirlockDoor02.SetOpen(True)

debug.notification("Opening Inner Door")

endif

endFunction

Link to comment
Share on other sites

  • Recently Browsing   0 members

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