Unofficial Fallout 4 Patch

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

FS#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.

Closed by  Arthmoor
May 06 2017 05:40 AM
Reason for closing:  Fixed
Additional comments about closing:  

Fixed for UFO4P 2.0.1.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing