Jump to content

Papyrus Fragments - need a little interpretation


pepperman35

Recommended Posts

In the nativeSpotlightTerminalSubMenu, we have the following two Papyrus Fragments for

activating and deactivating the spotlights. These appear to be the same to me so what am I not

seeing/understanding as it doesn't seem the deactivate lights Fragment is correct.


Activate Light(s)

;SpotlightScript LightScript = (akTerminalRef.getLinkedRef(linkTerminalSpotlight)) as spotlightScript

;lightScript.TurnOnSpotlight()

ObjectReference[] linkedRefArray = akTerminalRef.getLinkedRefArray(LinkTerminalSpotlight)


int i = 0

while i < linkedRefArray.length

(linkedRefArray as spotlightscript).Activate(akTerminalRef)

i += 1

endWhile



Deactivate Light(s)

;SpotlightScript LightScript = (akTerminalRef.getLinkedRef(linkTerminalSpotlight)) as spotlightScript

;lightScript.ShutdownSpotlight()

ObjectReference[] linkedRefArray = akTerminalRef.getLinkedRefArray(LinkTerminalSpotlight)


int i = 0

while i < linkedRefArray.length

(linkedRefArray as spotlightscript).Activate(akTerminalRef)

i += 1

endWhile

Link to comment
Share on other sites

You need to look at the script that fragment is calling:

 

(linkedRefArray as spotlightscript).Activate(akTerminalRef)

 

Calling activate triggers the Event OnActivate block in SpotlightScript which considers the IsDisabled() and IsDestroyed() states.

Link to comment
Share on other sites

You need to look at the script that fragment is calling:

 

(linkedRefArray as spotlightscript).Activate(akTerminalRef)

 

Calling activate triggers the Event OnActivate block in SpotlightScript which considers the IsDisabled() and IsDestroyed() states.

 

Thanks for the reply. But what is actually causing (or should cause) the spotlights to deactivate/shutdown? Granting, I am struggling to get a firm grasp on this scripting; but I am not seeing anything getting passed to the spotlight script to cause them to shutdown. When I connect a series of the spotlights in my mod, and hook them to a terminal, the terminal fails to shut them off.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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