Welcome to the AFK Mods bug tracker. In order to report an issue, please select a project from the drop down menu below. Select “Open New Issue” and fill out the form with as many details as possible.

An account will be required to submit an issue, so if you need one and are unable to register, please contact us via the forums at https://afkmods.iguanadons.net/

Issue Data
Status: Closed
Issue Type: Bug Report
Project: Unofficial Fallout 4 Patch
Component: Fallout 4: Vanilla
Category: Papyrus
Assigned To: Sclerocephalus
Platform: All
Severity: Low
Votes: 0
Watching: N/A
Opened By Sclerocephalus on Mar 15, 2017 1:37 pm
Last Edited By Arthmoor on May 6, 2017 12:41 pm
Closed By Arthmoor on May 6, 2017 12:41 pm
Resolution: Fixed
Comment: Fixed for UFO4P 2.0.1.

Issue #22144: REChokepointTriggerScript tries to set stages on wrong quests

As a result, various chokepoint RE quests frequently throw an 'attepmted to start an event scoped quest outside of story manager' error. There's nothing wrong wit those quests though (at least not in relation to this particular error): those errors are all caused by the same bug in REChokepointTriggerScript.

I'll close all tickets that reported this error for individual quests and mark them as a duplicate of this one.

REChokepointTriggerScript extends RETriggerScript; it only contains an override for the OnTriggerEnter() event (note that this will fire irrespective of the state RETriggerScript is in):

<code php>Scriptname REChokepointTriggerScript extends RETriggerScript
Event OnTriggerEnter(ObjectReference akActionRef)
if (akActionRef == Game.GetPlayer())

All it's supposed to do is to set stage 11 on the current RE quest when the player enters the trigger. To understand the implications, one has to know that all chokepoint triggers are preconfigured to fire on load. That is, when RETriggerScript runs on a chokepoint trigger, it will start a quest from its OnLoad event and skip its OnTrigger event. This is all on the parent script (i.e. on RETriggerScript):

<code php>Auto State On
Event OnTriggerEnter(ObjectReference akActionRef)
if TriggerOnLoad == true || akActionRef != Game.GetPlayer()
debug.traceuser(UFO4P_RELog, self + " State = On: OnTriggerEnter: Calling StartEncounter ...";)

Event OnCellLoad()
if TriggerOnLoad
debug.traceuser(UFO4P_RELog, self + " State = On: OnCellLoad: Calling StartEncounter ...";)

There are two problems here:
(1) The StartEncounter function does not always start a quest. Some triggers have a cool down timer running to prevent another quest from being started within too short a period of time. The REChokepointTriggerScript doesn't know about this, and when the event fires, it sets stage 11 on myQuest - which then however is the last quest started by this trigger.
(2) The myQuest property may not hold the current quest. When an RE quest is started, it runs a startup procedure, and when this code has finished running, it calls the QuestStarted function on RETriggerScript to write the current quest in the myQuest property. Up to this point therefore, myQuest is not the current quest but the quest that was previously started by the trigger.

REChokepointTriggerScript doesn't know whether it sets the stage on the correct quest because it doesn't check this. Thus, it may try to set the stage on a quest that is not running anymore and an error will be thrown. Moreover though, stage 11 on the correct quest may never be set and as a result, the chokepoint quest may not work as intended (what usually happens is that the actors are just standing there instead of walking to the player and forcegreet him).



1 comment(s) [Closed]
Sclerocephalus said:
Note: Fix requires modifications to this script and RETriggerScript.

Comment #1 Mar 15, 2017 2:35 pm  Edited by on Mar 15, 2017 2:35 pm
Showing Comments 1 - 1 of 1