Jump to content

Launching quest via OnInit() fails to fill aliases


SKKmods

Recommended Posts

I have a quest set StartGameEnabled YES & RunOnce YES that fails to fill its Aliases when staged through its main script OnInit():

 

Path 1 Main Script OnInit() validates conditions OK and calls .SetStage(10)
FAIL: Quest starts but no reference aliases are filled.
Path 2 QuestPlayerRefAlias OnPlayerLoadGame() validates conditions and calls the same code to .SetStage(10)
SUCCESS: Quest starts and all reference aliases filled OK
So staging the quest through OnInit() it starts with zero aliases (Forced or Unique) filled, but OnPlayerLoadGame() works fine.
Is this unusual or a known issue, and if so is there a workaround to get a new installed quest running as soon as the game is launched ?
Edited by SKK50
Link to comment
Share on other sites

Unfortunately I am not ever seeing OnQuestInit fire in the error condition. Its quite odd:

 

Load a clean (never modded) savegame pre V111 exit (MQ102 stage 9) with the quest mod enabled and everything works great. I see Event OnInit() ... Event OnQuestInit() ... Event OnPlayerLoadGame() ... Stage(0) fragment which is set to run on start fires ... and all the quest aliases fill nicely.

 

Load any clean or dirty savegame post V111 exit (MQ102 stage >=15) with the quest mod enabled and I only ever see Event OnInit(), nothing else. That calls OnLocationChange which forces the quest to start and some stages to fire, but .... the quest aliases are never ever filled. All aliases are set to optional and allow disabled to avoid blocking. What the hell !

 

If I console SetQuestAliases it all comes to life and runs fine. Is there a similar function in Papyrus I can use to over-ride whatever is going on ?

Edited by SKK50
Link to comment
Share on other sites

Still no idea why I am seeing this but the workaround is:

 

Main quest script does validation and if the quest should start it calls setstage(0) which tests some of the quest reference aliases.

 

If stage 0 finds aliases are empty, it calls a quest reset function which includes Reset() Stop() .. stopping ... Start() .. starting ... to do it all over. This seems to fix any issues and bump start the quest aliases to fill.

 

PS I may also have a go at ForceRefTo fill the aliases in code suggestion.

Link to comment
Share on other sites

Using .ForceRefTo() on ObjectReferences fine, but whats the approach to forcing unique actors and NPCs into a quest alias ?

 

Alias_MQPlayerRef.ForceRefTo(Game.GetPlayer()) ... or any Actor reference gives: type mismatch on parameter 1 - cannot pass a actorbase to a objectreference

 

Link to comment
Share on other sites

Why are you using Game.GetPlayer()? That's bad, don't ever do it.

 

Try assigning the actor to a different variable. E.g:

Actor Property refPlayer Auto Const
 
...
 
Alias_MQPlayerRef.ForceRefTo(refPlayer as ObjectReference)
...
Edited by FiftyTifty
Link to comment
Share on other sites

  • Recently Browsing   0 members

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