SKKmods Posted September 30, 2017 Share Posted September 30, 2017 (edited) 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 September 30, 2017 by SKK50 Link to comment Share on other sites More sharing options...
shavkacagarikia Posted September 30, 2017 Share Posted September 30, 2017 have you tried OnQuestInit() Link to comment Share on other sites More sharing options...
JonathanOstrus Posted September 30, 2017 Share Posted September 30, 2017 (edited) OnInit fires before aliases are filled. You might want to use OnQuestInit. Edited September 30, 2017 by BigAndFlabby Link to comment Share on other sites More sharing options...
SKKmods Posted October 1, 2017 Author Share Posted October 1, 2017 (edited) 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 October 1, 2017 by SKK50 Link to comment Share on other sites More sharing options...
FiftyTifty Posted October 1, 2017 Share Posted October 1, 2017 Why not just fill the aliases through the OnInit() event? https://www.creationkit.com/fallout4/index.php?title=ForceRefTo_-_ReferenceAlias Link to comment Share on other sites More sharing options...
SKKmods Posted October 1, 2017 Author Share Posted October 1, 2017 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 More sharing options...
FiftyTifty Posted October 1, 2017 Share Posted October 1, 2017 That sounds messy as heck. Set the stage, then have the stage run a script that fills the aliases. Link to comment Share on other sites More sharing options...
SKKmods Posted October 1, 2017 Author Share Posted October 1, 2017 yeah, I seem to have have more error handling and workaround code than stuff doing actual work. will give the forcefill a go as well. Link to comment Share on other sites More sharing options...
SKKmods Posted October 2, 2017 Author Share Posted October 2, 2017 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 More sharing options...
FiftyTifty Posted October 2, 2017 Share Posted October 2, 2017 (edited) 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 October 2, 2017 by FiftyTifty Link to comment Share on other sites More sharing options...
Recommended Posts