Talk:IsDisabled - ObjectReference

From the CreationKit Wiki
Jump to navigation Jump to search

Disabling when moving[edit source]

I discovered this while investigating how the game handles moving references, so I don't know if it will ever actually pose a problem for Papyrus scripters. Still, it seems worth documenting:

When you move a reference through any means, its 3D unloads and then reloads. The game accomplishes this by unloading 3D, disabling the reference (so it can be enabled), and re-enabling the reference (which reloads 3D as a side-effect), all in rapid succession. Because of the way the Papyrus VM works, I don't think it'd ever be possible for a script to execute "between" those steps and get a false value when checking IsDisabled (though if anyone has that happen, please do note it here!). However, this means that it'd be a bad idea for anyone to implement "OnDisable" or "OnEnable" events via an SKSE plug-in, because there'd be tons of false-positives. DavidJCobb (talk) 2016-04-15T22:10:21 (EDT)