Difference between revisions of "Talk:OnCellDetach - ObjectReference"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Rasikko
m (Add header)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Attachment and Detachment ==
==Event Timing==
* For exteriors, cell attachment/detachment means the cells which load around the player. Default is 5x5 cells. Any cell that becomes no longer part of this grid of cells is detached. For interiors, it's the cell you enter(attached) and exit(detached). Now that's cleared up, on to my real issue. This may only happen when using the COC command to leave cells as you can't normally fast travel out of dungeons, but I'll put this here anyway - if you leave a cell and into a new one too quickly, there's a chance this event will fire '''for the destination cell''' as if the engine thinks THAT cell is the one that became detached. That can be troublesome if you're using this event to track some kind of data of a ref from the previous cell upon leaving as it will instead look at data for a ref in the new cell. --[[User:Rasikko|Rasikko]] ([[User talk:Rasikko|talk]]) 2021-10-12T13:43:22 (EDT)
Testing has revealed that this event can lag behind a new call to [[OnCellAttach - ObjectReference | OnCellAttach]]. What this means is if you're checking multiple cells with these two events, it's possible that the '''next''' run of OnCellAttach in the series will come before the running of this event. To put it simply..if you're expecting this: OnCellAttach -> OnCellDetach -> OnCellAttach..'''don't'''. It can be OnCellAttach -> OnCellAttach -> OnCellDetach. Normally this isn't an issue but it will be if you need to track the time when cells have been attached or detached and use those times in other calculations. I have been working with all the attachement based events for many months now as I had thought them to be very reliable, much to my disappointment. That being said, do use these as they are more reliable than say [[OnLoad - ObjectReference | OnLoad]], but for very complex operations where attachment order is important, these 2 events fall short.
--[[User:TwilightSky|TwilightSky]] ([[User talk:TwilightSky|talk]]) 17:58, 26 September 2024 (EDT)

Latest revision as of 13:33, 27 September 2024

Event Timing[edit source]

Testing has revealed that this event can lag behind a new call to OnCellAttach. What this means is if you're checking multiple cells with these two events, it's possible that the next run of OnCellAttach in the series will come before the running of this event. To put it simply..if you're expecting this: OnCellAttach -> OnCellDetach -> OnCellAttach..don't. It can be OnCellAttach -> OnCellAttach -> OnCellDetach. Normally this isn't an issue but it will be if you need to track the time when cells have been attached or detached and use those times in other calculations. I have been working with all the attachement based events for many months now as I had thought them to be very reliable, much to my disappointment. That being said, do use these as they are more reliable than say OnLoad, but for very complex operations where attachment order is important, these 2 events fall short. --TwilightSky (talk) 17:58, 26 September 2024 (EDT)