SAC Posted January 19, 2021 Posted January 19, 2021 Most likely related to this problem Instead of trying to use various flavors of FindReference, I have implemented a couple of quests trying to script actors in the loaded area. The problem is, some NPCs don't fill aliases, despite having the prerequisites. Implementation is as following: 1. sac_hanging_persistence_alias_array_quest has 20 identical reference aliases configured like this: Each reference alias has a script which works just fine if the reference alias fills, the script is not the issue. This quest does not start game enabled, I am starting it on each cell refresh, collect the aliases, trigger the reference alias script, then stop and reset the quest. This method is described here. 2. The second quest is sac_autohang_quest, which starts game enabled, with a reference alias script attached to a player alias, which detects cell changes, starts sac_hanging_persistence_alias_array_quest, lets it fill the aliases and trigger the scripts, then stops and resets it. Scriptname sac_autohang_playeralias_script extends ReferenceAlias import PO3_Events_Alias ReferenceAlias[] Property sac_hanging_persistence_alias_array Auto Event OnInit() player = game.getplayer() RegisterForCellFullyLoaded(self) EndEvent Function getTheActors() debug.trace("sac_ starting collecting alias array") sac_hanging_persistence_alias_array_quest.start() Utility.wait(1) int i = sac_hanging_persistence_alias_array.length debug.trace("sac_ alias array count is "+i) while i i -= 1 Actor a = sac_hanging_persistence_alias_array[i].getActorRef() if a Debug.Trace("sac_ alias array Found: " + a.getDisplayName()) endIf endWhile sac_hanging_persistence_alias_array_quest.stop() sac_hanging_persistence_alias_array_quest.reset() debug.trace("sac_ finished collecting alias array") EndFunction Event OnCellFullyLoaded(Cell akCell) debug.trace ("sac_ calling actors from oncellfullyloaded") getTheActors() endevent The entire setup works just fine on some NPCs, however some other NPCs, which correspond to the alias conditions, just don't get filled. Here I am looking at two dead NPCs, console confirms the two conditions haskeyword actortypenpc returns 1 getdead returns 1 However, the reference alias script does not fire. [01/19/2021 - 12:20:27PM] sac_ starting collecting alias array [01/19/2021 - 12:20:29PM] sac_ alias array count is 20 [01/19/2021 - 12:20:29PM] sac_ alias array Found: Khajiit [01/19/2021 - 12:20:29PM] sac_ finished collecting alias array Trace shows that another NPC ("khajiit") fills one of the reference aliases, but not the two NPCs in front of me. I don't understand what's happening and how to fix. It does not matter if I teleport away and back to this cell, or if I load the game in this cell directly, the result is the same. Other NPCs work as designed. cc @zaira you have mentioned to me something about SKSE cell scanning TY!
SAC Posted January 19, 2021 Author Posted January 19, 2021 I think I've solved it, the reference aliases did not have "allow reserved" enabled. I've enabled that option and now the two NPCs fill aliases.
Scrab Posted January 19, 2021 Posted January 19, 2021 Allow Reserved Aliases is a flag that you should always always tick if your Quest doesnt involve killing said Actor or doing something else to him that may affect his place/status in the game for a long time (or even permanently) Bounty Quests are a great example for Quests that should leave this unticked. You dont wanna kill a Bandit for a bounty if that Bandit is needed for a Quest later in the game
Recommended Posts
Archived
This topic is now archived and is closed to further replies.