Jump to content

[Modding] Quest aliases not filling


Recommended Posts

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:

 

image.png.d701993ddd1b4ec853a75401a7ea6dbc.pngimage.png.86a01aadcc69ca4a7ee74e83e6d4d530.png

 

 

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.

 

image.png.fa0b96153fa89021683816da35800979.png

 

 

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.

 

image.thumb.png.47a816db57e9039c42f817ea51ee3740.png

 

 

[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!

 

 

Link to comment

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

 

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use