Difference between revisions of "Talk:OnCellAttach - ObjectReference"

no edit summary
imported>Egocarib
imported>Rasikko
 
(One intermediate revision by one other user not shown)
Line 10: Line 10:


Thanks for the helpful testing DayDreamer. The fact that OnCellAttach fires before OnCellLoad is especially useful to know. Can you clarify what you meant about the OnCellDetach() issue, though? I'm not sure I understood that - if the cells you were testing were not 5 cells apart, it would seem normal for them to stay attached an not trigger an OnCellDetach event. Also, I found the added warning on the page "This event may be called multiple times without any intervening [[OnCellDetach - ObjectReference]]" to be confusing - I don't think it's true that OnCellAttached could be called multiple times on an object before OnCellDetach is called. You are talking about a single object with that event in its script, right? I tried testing but couldnt make an object fire an OnCellAttach() event while it was still attached (before OnCellDetach() fired). Maybe that's not what you meant exactly? Egocarib 2013-11-11T11:31:18 (EST)
Thanks for the helpful testing DayDreamer. The fact that OnCellAttach fires before OnCellLoad is especially useful to know. Can you clarify what you meant about the OnCellDetach() issue, though? I'm not sure I understood that - if the cells you were testing were not 5 cells apart, it would seem normal for them to stay attached an not trigger an OnCellDetach event. Also, I found the added warning on the page "This event may be called multiple times without any intervening [[OnCellDetach - ObjectReference]]" to be confusing - I don't think it's true that OnCellAttached could be called multiple times on an object before OnCellDetach is called. You are talking about a single object with that event in its script, right? I tried testing but couldnt make an object fire an OnCellAttach() event while it was still attached (before OnCellDetach() fired). Maybe that's not what you meant exactly? Egocarib 2013-11-11T11:31:18 (EST)
: I have arrived from the future to explain what I know about this event. I set up some engine-level tests (i.e. hooking directly into the event subsystem that Papyrus relies on, rather than going through Papyrus itself) to basically log ''every single attach/detach event'' regardless of whether any Papyrus scripts actually existed on the references involved. Testing indicates that the event fires per ObjectReference, and that it fires when the ObjectReference's parent cell attaches (with the detach event behaving similarly). The event ''does not'' fire as a result of an object changing cells. Internally, the only data that is sent through the event subsystem (and therefore the only data that Papyrus could ever act on) is the ObjectReference itself and a bool indicating whether it's an attach event or a detach event.
: I don't know the exact testing methodology that DayDreamer used, and after seven years, I doubt they know either. If they had placed a script on a single object, and if that object had traveled with them as they moved around, then it never would have been inside of a cell at the time that that cell detached, and so OnCellDetach never would've fired. [[User:DavidJCobb|DavidJCobb]] ([[User talk:DavidJCobb|talk]]) 2020-07-24T22:44:57 (EDT)
:: On that OnCellDetach bit - It will still fire and at the same time as OnAttachedToCell, if both the reference and the player move to the same cell. I've tested that scenario multiple times now and I get the same result each time. Here's my analysis: https://www.creationkit.com/index.php?title=Cell_Attachment_Analysis
--[[User:Rasikko|Rasikko]] ([[User talk:Rasikko|talk]]) 2021-10-17T12:36:42 (EDT)
Anonymous user