Jump to content

Start script when protectron is activated from Terminal


F4llfield

Recommended Posts

Attach a script like this to a new placed invisible activator in the same 3dLoad cell as the pod:

 

 

 

ScriptName myProtectronPodMonitor extends ObjectReference
ActorValue Property pProtectronPodStatus Auto Const Mandatory
ObjectReference Property myPod Auto
{ link this property to the Protectron pod to monitor }
Event OnLoad()
If (myPod != None) && (myPod.Is3dLoaded() == True)
ObjectReference myProtectron = myPod.GetLinkedRef() ; some pods may not have this link
If (myProtectron != None) && (myProtectron.GetValue(pProtectronPodStatus) == 0) ; ProtectronSleepInsidePodPKG condition
Self.RegisterForAnimationEvent(myPod, "Exit")
EndIf
Endif
EndEvent
Event OnUnload()
If (myPod != None)
Self.UnRegisterForAnimationEvent(myPod, "Exit")
Endif
EndEvent
Event OnAnimationEvent(ObjectReference akSource, string asEventName)
If(akSource == myPod) && (asEventName == "Exit")
Self.UnRegisterForAnimationEvent(myPod, "Exit")
; insert the script stuff to run on wakeup
myPod = None
Self.GotoState("IdleState")
Endif
EndEvent
State IdleState
;blank
EndState

 

 

 

Link to comment
Share on other sites

Attach a script like this to a new placed invisible activator in the same 3dLoad cell as the pod:

 

 

 

ScriptName myProtectronPodMonitor extends ObjectReference
ActorValue Property pProtectronPodStatus Auto Const Mandatory
ObjectReference Property myPod Auto
{ link this property to the Protectron pod to monitor }
Event OnLoad()
If (myPod != None) && (myPod.Is3dLoaded() == True)
ObjectReference myProtectron = myPod.GetLinkedRef() ; some pods may not have this link
If (myProtectron != None) && (myProtectron.GetValue(pProtectronPodStatus) == 0) ; ProtectronSleepInsidePodPKG condition
Self.RegisterForAnimationEvent(myPod, "Exit")
EndIf
Endif
EndEvent
Event OnUnload()
If (myPod != None)
Self.UnRegisterForAnimationEvent(myPod, "Exit")
Endif
EndEvent
Event OnAnimationEvent(ObjectReference akSource, string asEventName)
If(akSource == myPod) && (asEventName == "Exit")
Self.UnRegisterForAnimationEvent(myPod, "Exit")
; insert the script stuff to run on wakeup
myPod = None
Self.GotoState("IdleState")
Endif
EndEvent
State IdleState
;blank
EndState

 

 

 

 

Thank you for your reply and tip.

 

I'm getting a missing value error on pProtectronPodStatus.

 

I'm not sure what value I should enter.

 

 

added:

 

Auto-fill under properties doesn't seem to work.

 

p.s. I don't see a reply button that's why I'm using the quote button to reply..

Edited by F4ll0uta
Link to comment
Share on other sites

  • Recently Browsing   0 members

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