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: Far Harbor DLC
Category: Papyrus
Assigned To: Sclerocephalus
Platform: All
Severity: Low
Votes: 0
Watching: N/A
Opened By Sclerocephalus on Mar 12, 2017 9:33 pm
Last Edited By Arthmoor on May 5, 2017 10:40 pm
Closed By Arthmoor on May 5, 2017 10:40 pm
Resolution: Fixed
Comment: Fixed for UFO4P 2.0.1.

Issue #22125: DLC03:TrapBear - repeating errors

A very frequent error on the log when you are on the island. Always several errors in no particular sequence:

[03/12/2017 - 12:24:49PM] error: (0302E146): does not have a node named 'REF_ATTACH_NODE'.
stack:
[ (0302E146)].DLC03:TrapBear.PlaceAtNode() - "<native>" Line ?
[ (0302E146)].DLC03:TrapBear.OnCellAttach() - "g:\_F4\DLC03\Art\Raw\Scripts\DLC03\TrapBear.psc" Line 46
[03/12/2017 - 12:24:49PM] error: (0302E141): does not have a node named 'REF_ATTACH_NODE'.
stack:
[ (0302E141)].DLC03:TrapBear.PlaceAtNode() - "<native>" Line ?
[ (0302E141)].DLC03:TrapBear.OnCellAttach() - "g:\_F4\DLC03\Art\Raw\Scripts\DLC03\TrapBear.psc" Line 46
[03/12/2017 - 12:24:59PM] error: Cannot register for an event from a None object
stack:
[ (0302E145)].DLC03:TrapBear.RegisterForRemoteEvent() - "<native>" Line ?
[ (0302E145)].DLC03:TrapBear.Open.OnBeginState() - "g:\_F4\DLC03\Art\Raw\Scripts\DLC03\TrapBear.psc" Line 113
[ (0302E145)].DLC03:TrapBear.GotoState() - "g:\_F4\Art\Raw\ScriptsMilestone\ScriptObject.psc" Line 42
[ (0302E145)].DLC03:TrapBear.OnLoad() - "g:\_F4\DLC03\Art\Raw\Scripts\DLC03\TrapBear.psc" Line 36
[03/12/2017 - 12:24:59PM] error: Cannot register for an event from a None object
stack:
[ (0302E147)].DLC03:TrapBear.RegisterForRemoteEvent() - "<native>" Line ?
[ (0302E147)].DLC03:TrapBear.Open.OnBeginState() - "g:\_F4\DLC03\Art\Raw\Scripts\DLC03\TrapBear.psc" Line 113
[ (0302E147)].DLC03:TrapBear.GotoState() - "g:\_F4\Art\Raw\ScriptsMilestone\ScriptObject.psc" Line 42
[ (0302E147)].DLC03:TrapBear.OnLoad() - "g:\_F4\DLC03\Art\Raw\Scripts\DLC03\TrapBear.psc" Line 36
[03/12/2017 - 12:24:59PM] error: Cannot register for an event from a None object
stack:
[ (0302E142)].DLC03:TrapBear.RegisterForRemoteEvent() - "<native>" Line ?
[ (0302E142)].DLC03:TrapBear.Open.OnBeginState() - "g:\_F4\DLC03\Art\Raw\Scripts\DLC03\TrapBear.psc" Line 113
[ (0302E142)].DLC03:TrapBear.GotoState() - "g:\_F4\Art\Raw\ScriptsMilestone\ScriptObject.psc" Line 42
[ (0302E142)].DLC03:TrapBear.OnLoad() - "g:\_F4\DLC03\Art\Raw\Scripts\DLC03\TrapBear.psc" Line 36

Sadly, this is another mess of a script:

(1) The 'does not have a node named 'REF_ATTACH_NODE' arror is a bogus error, because the ref in question (always the trap itself) has this node (I checked the mesh). This is actually nothing else than a disguised 3D error because the offending line is in an OnCellAttach() event where chances are hight that the ref has not loaded yet:

event onCellAttach()
debug.Trace(self + ": onCellAttach";)

;RegisterForRemoteEvent(MyTrigger, "OnTriggerEnter";)
if GetState() == "Open"
MyTrigger = PlaceAtNode("REF_ATTACH_NODE", DLC03BearTrapTrigger, aiCount = 1, abForcePersist = false, abInitiallyDisabled = false, abDeleteWhenAble = true, abAttach = true)
hitBase.goToState("CanHit";)

endif
EndEvent

If the node is not found, no trigger is created. This explains all of the subsequent errors which occur because MyTrigger is 'none'.

Adding a WaitFor3DLoad check here will cause a conflict with the OnLoad event though:

event onLoad()
debug.Trace(self + ": onLoad";)
hitBase = (self as objectReference) as DLC03:DLC03TrapHit
if StartOpen
;playAnimation("StartOpen";)
goToState("Open";)
endif
;MoveToNearestNavmeshLocation()
endEvent

As soon as the trap enters its 'Open' state, an OnBeginState event will start running and try do run stuff on the trigger - but this will still be missing if OnCellAttach has not finished running due to the added 3D check. It's probably best therefore to sack the OnCellAttach() event entirely and move the trigger creation elsewhere.

(2) If the script would work as intended, it would create a new trigger on every load. It does delete the trigger only after the trap has been fired or disarmed (but this is only the last created trigger). All other references will pile up until the cell resets - unless you place the trap at a workshop (you can do that!). To fix this, the script would only have to check whether there already is a trigger before creating a new one.

EDIT: Note: When the script creates the trigger via PlaceAtNode, it does so with abDeleteWhenAble = true (which marks created refs for deletion as soon as they are not in a script property or in a quest alias anymore). This doesn't work here though because the script property that holds the trigger ref is never cleared.