Jump to content

Dynamic Bunker


Zorkaz

Recommended Posts

Yes I put one in Mobile Workshop, but have hidden the constructable hatch.

 

Rather than mess about with dynamic load doors, the access hatch and exit ladders are activators with simple OnActivate ... MoveTo scripts.

 

 

 

Scriptname SKK_MWMobileBunkerTrapdoorScript extends ObjectReference Const

Keyword 	Property pWorkshopItemKeyword 		Auto Const Mandatory
ReferenceAlias 	Property Alias_MobileBunkerTrapDoor	Auto Const Mandatory
ReferenceAlias  Property Alias_MobileBunkerMarker       Auto Const Mandatory

;********************************************************************************************************************

;The trapdoor can only be built at MobileWorkshop _co has restriction pSKK_MWMobileWorkshopKeyword
Event OnLoad()
	If Self.HasKeyword(pWorkshopItemKeyword) ; final placement connected to workshop
		ObjectReference OldTrapdoor = Alias_MobileBunkerTrapDoor.GetReference()
		If (OldTrapdoor != None) && (OldTrapdoor != (Self as ObjectReference))
			Alias_MobileBunkerTrapDoor.Clear()
			OldTrapdoor.SetLinkedRef(None, pWorkshopItemKeyword)
			OldTrapdoor.Disable() 
			OldTrapdoor.Delete() ;This may not cleanup the Workshoplink 
		EndIf
		Alias_MobileBunkerTrapDoor.ForceRefTo(Self as ObjectReference)
	EndIf
EndEvent

;********************************************************************************************************************

Event OnActivate(ObjectReference akActivator)
	If (akActivator == Game.GetPlayer())
		Game.GetPlayer().MoveTo(Alias_MobileBunkerMarker.GetReference())
	EndIf
EndEvent

;********************************************************************************************************************

Event OnWorkshopObjectDestroyed (ObjectReference akWorkshopRef)
	If (Alias_MobileBunkerTrapDoor.GetReference() == (Self as ObjectReference))
		Alias_MobileBunkerTrapDoor.Clear() ;release for cleanup
	EndIf
EndEvent

;********************************************************************************************************************

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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