![]()
|
|
That's not a typo unless the game is lying to me. Both the "GetStage" and "sqs" commands indicate that the quest is at stage 150. You can take a look at the save for yourself if you'd like.
Comment #2 Feb 14, 2019 1:21 pm
Edited by BlackPete on Feb 14, 2019 1:23 pm
Happened to me when I had to clear out the ghouls at Bedford Station for the settlers at Tenpines Bluff. And I also got this on the log:
[08/18/2019 - 03:10:44AM] error: Array index 0 is out of range (0-0)
stack:
[alias GhoulBosses on quest MinRecruit07 (00186642)].DefaultCollectionAliasOnDeath.UFO4P_AddRefToTriggeredRefArray() - "C:\Users\Dr. Peter Haas\AppData\Local\Temp\PapyrusTemp\DefaultCollectionAlias.psc" Line 131
[alias GhoulBosses on quest MinRecruit07 (00186642)].DefaultCollectionAliasOnDeath.TryToSetStage() - "C:\Users\Dr. Peter Haas\AppData\Local\Temp\PapyrusTemp\DefaultCollectionAlias.psc" Line 69
[alias GhoulBosses on quest MinRecruit07 (00186642)].DefaultCollectionAliasOnDeath.OnDeath() - "g:\_F4\Art\Raw\Scripts\DefaultCollectionAliasOnDeath.psc" Line 11
This was somewhat puzzling because the UFO4P fix should actually avoid zero-length arrays on this script. As it turned out however, the UFO4P modification could not handle cases where the script creates a zero-length array on purpose, and that's was happening here. All this is a result of a script lag issue: the enemy alias collection on MinRecruit07 has two scripts running that track death counts for various purposes:
(1) ScriptA is to check whether all enemies are dead and to advance the quest
(2) ScriptB only checks whether the enemy count drops below a certain threshhold value and then sets stage 150. Once this stage is set, target markers will appear on the remaining enemies.
ScriptB also removes dead actors from the alias collection. ScriptA however creates an array and fills it with the references of the dead actors; once the number of entries in that array is equal to the number of actors in the enemy alias, it will advance the quest.
ScriptA is slower than scriptB (because it calls functions on external scripts and these are limied to one per frame). Thus, if the player kills an enemy, scriptB will have removed him from the alias already by the time scriptA starts running its array checks. Now, if the enemy alias contained only one actor (and that's what College Square and Bedford Station have in common: they only have one actor that is flagged with a boss LocRefType), the alias is empty when scriptA runs for the first time and then it sets up a zero-length array. on which all further operations fail.
To fix this, I added a GetCount() check to the start of the code on DefaultCollectionAlias. If this returns zero, all enemies must be dead (because scriptB is the only instance that removes actors from the alias and it only does this if an actor is dead). In that case therefore, the script can skip the array setup and proceed with advancing the quest.
[08/18/2019 - 03:10:44AM] error: Array index 0 is out of range (0-0)
stack:
[alias GhoulBosses on quest MinRecruit07 (00186642)].DefaultCollectionAliasOnDeath.UFO4P_AddRefToTriggeredRefArray() - "C:\Users\Dr. Peter Haas\AppData\Local\Temp\PapyrusTemp\DefaultCollectionAlias.psc" Line 131
[alias GhoulBosses on quest MinRecruit07 (00186642)].DefaultCollectionAliasOnDeath.TryToSetStage() - "C:\Users\Dr. Peter Haas\AppData\Local\Temp\PapyrusTemp\DefaultCollectionAlias.psc" Line 69
[alias GhoulBosses on quest MinRecruit07 (00186642)].DefaultCollectionAliasOnDeath.OnDeath() - "g:\_F4\Art\Raw\Scripts\DefaultCollectionAliasOnDeath.psc" Line 11
This was somewhat puzzling because the UFO4P fix should actually avoid zero-length arrays on this script. As it turned out however, the UFO4P modification could not handle cases where the script creates a zero-length array on purpose, and that's was happening here. All this is a result of a script lag issue: the enemy alias collection on MinRecruit07 has two scripts running that track death counts for various purposes:
(1) ScriptA is to check whether all enemies are dead and to advance the quest
(2) ScriptB only checks whether the enemy count drops below a certain threshhold value and then sets stage 150. Once this stage is set, target markers will appear on the remaining enemies.
ScriptB also removes dead actors from the alias collection. ScriptA however creates an array and fills it with the references of the dead actors; once the number of entries in that array is equal to the number of actors in the enemy alias, it will advance the quest.
ScriptA is slower than scriptB (because it calls functions on external scripts and these are limied to one per frame). Thus, if the player kills an enemy, scriptB will have removed him from the alias already by the time scriptA starts running its array checks. Now, if the enemy alias contained only one actor (and that's what College Square and Bedford Station have in common: they only have one actor that is flagged with a boss LocRefType), the alias is empty when scriptA runs for the first time and then it sets up a zero-length array. on which all further operations fail.
To fix this, I added a GetCount() check to the start of the code on DefaultCollectionAlias. If this returns zero, all enemies must be dead (because scriptB is the only instance that removes actors from the alias and it only does this if an actor is dead). In that case therefore, the script can skip the array setup and proceed with advancing the quest.
Comment #3 Aug 18, 2019 9:20 am
Edited by Sclerocephalus on Aug 18, 2019 12:45 pm
Showing Comments 1 - 3 of 3