Welcome to the AFK Mods bug tracker. In order to report an issue, 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.

An account will be required to submit an issue, so if you need one and are unable to register, please contact us via the forums at https://afkmods.iguanadons.net/
       

Issue Data
Status: Closed
Issue Type: Bug Report
Project: Unofficial Fallout 4 Patch
Component: Fallout 4: Automatron DLC
Category: Papyrus
Assigned To: Sclerocephalus
Platform: All
Severity: Low
Votes: 0
Watching: N/A
Opened By BlackPete on Jun 12, 2018 6:17 pm
Last Edited By Sclerocephalus on Sep 7, 2018 4:44 pm
Closed By Sclerocephalus on Sep 9, 2018 1:47 pm
Resolution: Fixed
Comment: Fixed for UFO4P 2.0.5

Issue #24676: DLC01_TrackSystemTrapElectricArc: Array index 0 / 1 is out of range (0-0)

[06/11/2018 - 07:08:13PM] error: Array index 0 is out of range (0-0)
stack:
[ (FF01FFC7)].DLC01:DLC01_TrackSystemTrapElectricArc.OnTimer() - "g:\_F4\DLC01\Art\Raw\Scripts\DLC01\DLC01_TrackSystemTrapElectricArc.psc" Line 77
[06/11/2018 - 07:08:15PM] error: Array index 1 is out of range (0-0)
stack:
[ (FF01FFC7)].DLC01:DLC01_TrackSystemTrapElectricArc.OnTimer() - "g:\_F4\DLC01\Art\Raw\Scripts\DLC01\DLC01_TrackSystemTrapElectricArc.psc" Line 77

       

Comments

1 comment(s) [Closed]
Sclerocephalus said:
There's nothing wrong with the script:

int actorCount = actorsInTrigger.Length - 1
if (actorCount >= 0)
     ;If we have targets in the trigger, fire at one of them.
     ObjectReference target = actorsInTrigger[Utility.RandomInt(0, actorCount)]
     DLC01TrackSystem_TrapElectricArcSpell.Cast(myArm, target)
else
...


While this runs, however, the script is also processing OnTriggerEnter and OnTriggerLEave events, and it appears that actors were removed from the array while this code was trying to pick a random actor. Note that running this code does not take much time, so this is a pretty rare error as it can only occur when the OnTriggerLeave event removes an actor from the array just within this narrow time frame.

Fixed this by adding a tracking bool that is set to true while the timer event is picking an actor, and a waiting loop to the OnTriggerLeaveEvent that prevents it from removing any actors from the array while the tracking bool is true.

       
Showing Comments 1 - 1 of 1