pepperman35 Posted February 29, 2020 Share Posted February 29, 2020 (edited) 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 February 29, 2020 by pepperman35 Link to comment Share on other sites More sharing options...
Zorkaz Posted February 29, 2020 Share Posted February 29, 2020 Yes, you can use triggerboxes. Check out the "ontriggerenter" and "ontriggerleave" entries at the CreationkitwikiFor 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 More sharing options...
YouDoNotKnowMyName Posted February 29, 2020 Share Posted February 29, 2020 But watch out for the placement of the triggerboxes!Place them at a slight angle (so not perfectly 0 degree rotation on the Z axis, but something like 0,01 or something like that).If you don't they might not work. Link to comment Share on other sites More sharing options...
pepperman35 Posted February 29, 2020 Author Share Posted February 29, 2020 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 More sharing options...
SKKmods Posted February 29, 2020 Share Posted February 29, 2020 For radiation its ActorValue Rads To get the rads: Float fPlayerRads = pPlayerRef.GetValue(pRads) To clear the rads: pPlayerRef.RestoreValue(pRads, pPlayerREF.GetValue(pRads)) Link to comment Share on other sites More sharing options...
pepperman35 Posted February 29, 2020 Author Share Posted February 29, 2020 Thanks SKK50, much appreciated Link to comment Share on other sites More sharing options...
pepperman35 Posted March 1, 2020 Author Share Posted March 1, 2020 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 == NonetargetRef = game.getPlayer()endifendEvent auto STATE WaitForTrigger Event onTriggerEnter(objectReference triggerRef)if(triggerRef == targetRef);target has entered the triggerSetTargetInTrigger(true)debug.trace(self + " target has entered the trigger")debug.notification("Entered Trigger")endifendEvent Event onTriggerLeave(objectReference triggerRef)if (triggerRef == targetRef);target has left the triggerSetTargetInTrigger(false)debug.trace(self + " target has left the trigger")debug.notification("Leaving Trigger")endifendEventEndSTATE STATE Done EndSTATEbool function IsTargetInTrigger()return bTargetInTriggerendFunction ; PRIVATE function - do not call from outside this scriptfunction SetTargetInTrigger(bool isInTrigger)bTargetInTrigger = isInTriggerfireTriggerEvent()endFunction function fireTriggerEvent(); perform action when target enters/leaves triggerif (bTargetInTrigger == true); Open the outer airlock doorNFPP_AirlockDoor01.SetOpen(True)debug.notification("Opening Outer Door"); Close the inner airlock doorNFPP_AirlockDoor02.SetOpen(False)else; Close the outer airlock doorNFPP_AirlockDoor01.SetOpen(False)debug.notification("Closing Outer Door"); Open the inner airlock doorNFPP_AirlockDoor02.SetOpen(True)debug.notification("Opening Inner Door")endifendFunction Link to comment Share on other sites More sharing options...
Recommended Posts