Some objects (potions, and some types of food) do not stay locked in place. Every time that the cell these objects are in gets reloaded, the affected objects drop a couple of units in the Z axis before locking in place again. I don't know what causes this, but I think it's something to do with the game engine, not with my mod.
The only way I can think of to fix this would be to store the information for each object's position and rotation, and moving the object to its stored location on cell load. Now obviously, I cannot place scripts on the items themselves. I also can't use reference aliases because some people go around placing hundreds, possibly thousands of objects and I don't really want to try making so many aliases.
So I have to store this information in arrays on some other object in the cell. The problem with this approach is that I have no way to tell when one of the placed objects is removed from the game world (put into inventory) and so no longer needs its information stored in arrays.
I'd thought to use http://www.creationkit.com/Is3DLoaded_-_ObjectReference in an OnUpdate loop to check whether or not the object has been removed. But the problem with this is room markers. Things in different rooms that aren't in LOS don't have their models loaded. Even though they don't have their models loaded, they are still in the game world, so that means using Is3DLoaded is unreliable.
So does anyone have some idea on how I can work around this?
EDIT: I've also tried using IsDisabled, IsInInterior, and GetPositionX with no results (they give the same results whether or not I add them to my inventory).



