Unofficial Fallout 4 Patch

  • Status Closed
  • Percent Complete
  • Task Type Bug Report
  • Category Papyrus
  • Assigned To
  • Operating System All
  • Severity Low
  • Priority Medium
  • Reported Version Fallout 4: Vanilla
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Unofficial Fallout 4 Patch
Opened by Sclerocephalus - March 15 2017
Last edited by Arthmoor - May 06 2017

FS#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):

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):

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).

Closed by  Arthmoor
May 06 2017 07:41 PM
Reason for closing:  Fixed
Additional comments about closing:  

Fixed for UFO4P 2.0.1.

Sclerocephalus commented on March 15 2017 09:35 PM

Note: Fix requires modifications to this script and RETriggerScript.


Available keyboard shortcuts


Task Details

Task Editing