======
ISSUE:


Starfield Outpost built objects do not receive expected Papyrus script events OnUnload() or OnCellDetach() when 3d unloads as the active uGrid cells move with the player and the object is still in the active worldspace. The events are received as expected for OnPlayerTeleport transitions when the object is nolonger in the active worldspace.


==========
NARRATIVE:


Using a default base game configuration with no uGridsToLoad or associated settings changes:


(1) Most objects and actors that are placed or spawned will 3dunload at 300/400m radius from the player datum and 3dload at 200/300m radius from the player datum. They receive OnLoad()/OnCellAttach() and OnUnload()/OnCellDetach() script events when the active uGrid cells move with the player AS EXPECTED.


(2) The placed OutpostBeaconActivator [ACTI:002C60E9] behaves exactly as "normal" case (1) object AS EXPECTED.


(3) Outpost built objects will 3dunload at 1200/1300m radius from the player datum and 3dload at 1100/1200m radius from the player datum. They receive OnLoad()/OnCellAttach() script events but DO NOT receive OnUnload()/OnCellDetach() script events as the active uGrid cells move with the player and the object is still in the active worldspace: UNEXPECTED BEHAVOR. 


(4) Outpost built objects do receive OnUnload()/OnCellDetach() script events as expected for OnPlayerTeleport() transitions when the object is no longer in the active worldspace AS EXPECTED.


(5) If an outpost object form bypasses outpost build instantiation with PlaceAtMe via console or script, it behaves exactly as a "normal" case (1) object. Clearly the outpost build/place process is causing the issue. 


(6) If an outpost object form bypasses outpost build instantiation with PlaceAtMe and is connected to the outpost with WorkshopItemKeyword [KYWD:00054BA6], it behaves exactly as a "normal" case (1) object, and is recognised as a connected client or child object by the Outpost. This is an observation, not a workaround as there are likely unknown consequences (e.g. remember the Fallout 4 SCRAP CRASH issue).


Common test article: OutpostStorageSolid01Sm "Storage - Solid" [CONT:0023AED9]


=======
IMPACT:


Base game script OutpostContainerScript.psc uses the OnUnload event for state management which is compromised if the player does not teleport from the location so OnUnload can trigger. What can be inferred from the fact that script is not actually attached to any outpost containers ? 


Additional state management of Outpost built objects though OnLoad/OnLoad (OnCellAttach/OnCellDetach fallback) script events will not be possible if the OnUnLoad/OnCellDetach side of events are not generated. This is likely to result in creative use of expensive polling loops or repurposing other latent events. 


Currently impares autotransfer functionality of https://www.nexusmods.com/starfield/mods/5670


=========================================================
Starfield ISSUE Outpost objects missing script events.txt
[email protected] 06 November 2023


=================================================================================
uGridsToLoad=default
Using Outpost built OutpostStorageSolid01Sm "Storage - Solid" [CONT:0023AED9]

OutpostBeacon    3dUnload@291  Event.OnUnload@291   Event.OnLoad@374  3dLoad@374
OutpostContainer 3dUnload@1262 Event.OnUnload@never Event.OnLoad@1166 3dLoad@1156
=================================================================================
uGridsToLoad=default
Using PlaceAtMe OutpostStorageSolid01Sm "Storage - Solid" [CONT:0023AED9]

OutpostBeacon    no outpost.
Container        3dUnload@427 Event.OnUnload@276 Event.OnLoad@170 3dLoad@207
=================================================================================
uGridsToLoad=default
Using PlaceAtMe OutpostStorageSolid01Sm "Storage - Solid" [CONT:0023AED9]
Connected to outpost with SetLinkedRef WorkshopItemKeyword [KYWD:00054BA6]

OutpostBeacon   3dUnload@289 Event.OnUnload@289   Event.OnLoad@161  3dLoad@161
Container       3dUnload@296 Event.OnUnload@296   Event.OnLoad@168  3dLoad@168
=================================================================================

uGridsToLoad affects "normal" case (1) objects load/unload radius.
uLargeRefLODGridSize has no observable impact on any objects.

=================================================================================
uGridsToLoad=3
uLargeRefLODGridSize=3
Using Outpost built OutpostStorageSolid01Sm "Storage - Solid" [CONT:0023AED9]

OutpostBeacon    3dUnload@132  Event.OnUnload@132   Event.OnLoad@118  3dLoad@118
OutpostContainer 3dUnload@1238 Event.OnUnload@never Event.OnLoad@1145 3dLoad@1145
=================================================================================

Article information

Added on

Edited on

Written by

SKKmods