Unofficial Fallout 4 Patch

  • Status Fix Pending
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Papyrus
  • Assigned To
    Sclerocephalus
  • 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 Sclerocephalus - March 15 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())
		myQuest.SetStage(11)
	EndIf
	Parent.OnTriggerEnter(akActionRef)
EndEvent

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()
			return
		EndIf
		debug.OpenUserLog(UFO4P_RELog)
		debug.traceuser(UFO4P_RELog, self + " State = On: OnTriggerEnter: Calling StartEncounter ...")
		StartEncounter()
	EndEvent
 
	Event OnCellLoad()
		debug.OpenUserLog(UFO4P_RELog)
		if TriggerOnLoad
			debug.traceuser(UFO4P_RELog, self + " State = On: OnCellLoad: Calling StartEncounter ...")
			StartEncounter()
		EndIf
	EndEvent
endState

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

Sclerocephalus commented on March 15 2017 09:35 PM

Note: Fix requires modifications to this script and RETriggerScript.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing