Talk:OnCellAttach - ObjectReference

Revision as of 17:54, 23 September 2013 by imported>DayDreamer (→‎Meaning of Attached)

Meaning of Attached

I'm not sure what the concept of "Attached" means in this context. --Gr3y 09:34, 9 February 2012 (EST)

The only "behavior" I can isolate pertaining specifically to this "attach" term, is that the event gets triggered every time the player enters the cell from another cell, unlike the OnLoad event which happens only once in a while (whenever the cell needs to be loaded into memory). Now, is this "attachment" different from the other event OnAttachedToCell (triggered when an object is attached to an attached cell)? What constitutes an "attachment" is also an unknown for me : the 3D (what about a trigger box objects, or roombounds, or cell attachment itself which could contain nothing)? Havok? Both? Something else like some bunch of pointers, or some allowed "action area" available for the engine to process?...? --HawkFest (talk) 2013-07-04T17:35:39 (EDT)
"Attached" means the cell is part of the block of currently "live" cells that connect outward in all directions from the player's current cell (e.g. no load doors between them). This is primarily based on the uGridsToLoad setting, which defaults to 5, meaning that in the wilderness, the 5x5 square of cells centered on the player (25 in total) will all be "attached"--they are full generated, loaded, animating, filled with NPCs, etc; acting like a "normal" cell that the player might be in, for all intensive purposes. As the player moves forward one cell, the 5 cells in the furthest row behind them would be "detached" while the 5 cells in the row in front of them would become "attached".

The game loads 3D data for cells before they become attached, and also retains 3D data for some cells that have been detached; the amount is unpredictable though and depends on virtual memory, the movement path of the player, etc, etc.

In interior spaces or other places where load doors are present, the cells behind the load doors will not be considered "attached" until they are actually entered. However, it may be important to point out that cells behind load doors can be loaded, even though they are not considered attached. (thanks to Inki over at the Beth forums for much of this info, which I have subsequently tested myself: see the thread here) --Egocarib (talk) 2013-09-07T14:49:27 (EDT)

This cannot be the total answer. In tests on the main road South from Solitude, I get OnCellAttach walking out from Solitude (goes live) to the edge of Dragonbridge and back again. There was no OnCellDetach, so the cell never stopped being "live". They are not 5 cells apart.

Also, I instrumented OnCellLoad, and OnCellAttach is very reliably called before OnCellLoad. But OnCellLoad isn't always called, so the cell must remain loaded. I had to add a wait loop for 3d to be loaded. So the game doesn't load 3d before it is attached! --DayDreamer (talk) 2013-09-23T18:51:33 (EDT)

Return to "OnCellAttach - ObjectReference" page.