Welcome to the AFK Mods bug tracker. In order to report an issue, you need to have a VALIDATED account to post one. Once you have followed the link the registration email sent you, please select a project from the drop down menu below. Select “Open New Issue” and fill out the form with as many details as possible.

Please also consider sending your bug report to Bethesda if you are reporting on an issue with Skyrim Special Edition, Fallout 4, or Starfield. Doing so will help everyone on all platforms.

Issue Data
Status: Closed
Issue Type: Bug Report
Project: Unofficial Fallout 4 Patch
Component: Fallout 4: Nuka-World DLC
Category: Papyrus
Assigned To: Nobody
Platform: Windows PC
Severity: Low
Votes: 0
Watching: N/A
Opened By Sclerocephalus on Jun 14, 2016 8:44 am
Closed By Arthmoor on Jun 16, 2016 9:08 pm
Resolution: Fixed

Issue #20640: SpotLightTriggerScript - Cannot clear a None array

 
[05/27/2016 - 06:22:20PM] error: Cannot clear a None array

stack:

[ (000D852B)].spotlighttriggerscript.Shutdown() - "<unknown file>" Line ?

[ (000D84FA)].SpotlightScript.active.OnCellLoad() - "<unknown file>" Line ?

[05/27/2016 - 06:22:20PM] error: Cannot clear a None array

stack:

[ (000D84E3)].spotlighttriggerscript.Shutdown() - "<unknown file>" Line ?

[ (000D84D8)].SpotlightScript.active.OnCellLoad() - "<unknown file>" Line ?

[05/27/2016 - 06:22:20PM] error: Cannot clear a None array

stack:

[ (000D84E3)].spotlighttriggerscript.Shutdown() - "<unknown file>" Line ?

[ (000D84D8)].SpotlightScript.active.OnCellLoad() - "<unknown file>" Line ?

[05/27/2016 - 06:22:20PM] error: Cannot clear a None array

stack:

[ (000D852B)].spotlighttriggerscript.Shutdown() - "<unknown file>" Line ?

[ (000D84FA)].SpotlightScript.active.OnCellLoad() - "<unknown file>" Line ?

Remotely related to bug no. 20636 (that post has additional information). The arrays in question are supposed to be initialized in the OnLoad event of spotlighttriggerscript. This may not yet have happened though when the spotlightscript calls the Shutdown function on spotlighttriggerscript. Therefore, sanity checks are needed in the Shutdown function.

The fix goes a little farther in that it initializes the arrays as zero-length arrays if they are none (as this is how an array that is not none would end up anyway after the Clear function has run). The OnLoad event of spotlighttriggerscript already checks for the arrays being none before it initializes them, so it will not re-initialize them unwantedly when the Shutdown function has already run. Whatever code runs first - the Shutdown function or the OnLoad event - will now make sure that the arrays are initialized as zero-length arrays:

<pre class="_prettyXprint _lang-">
Function Shutdown()

GoToState("Shutdown";)
;Clear the present detection array, we don't care what was in it. Only what is there when we turn the Spotlight back on.
targetActorIndex = -1

;debug.trace("CLEAR THE ARRAY!!!!";)

;EDIT: Added sanity checks for triggerActors and detectedActorArray being none. If none, they will now be initialized as zero-length arrays
;(as this is how they would end up if they were not none after the clear function has run)

if triggerActors
triggerActors.Clear()
else
triggerActors = new objectReference[0]
endif

if detectedActorArray
detectedActorArray.Clear()
else
detectedActorArray = new objectReference[0]
endif

mySpotlight.shutdown = true
mySpotlight.mySpotlightLight.disable()

if mySpotlight.startsoff
mySpotlight.playAnimation("StartOff";)

else
;mySpotlight.playAnimation("TurnOff";)

endif
;We are shutdown and therefore should not be receiving any events.
UnregisterForAllEvents()



endFunction
</pre>

Comments

1 comment(s) [Closed]
Arthmoor said:
 
Fixed for UFO4P 1.0.3.

Showing Comments 1 - 1 of 1