how to detect when an Object reference is not valid?

Post » Sun Sep 07, 2014 10:26 am

So I need a way to see if a dropped weapon object reference (obtained by walking the cell) is no longer valid because the player or some other actor picked it up.

Will this work?

if DropWeapon.GetParentCell() == Playerref.GetParentCell()

; good keep going

else

degug.messagebox("no longer valid")

endif

I have been trying it for some time now but I am still not convinced it is actually doing what I think it is doing.

Oblivion OBSE had a function for this: ISFormValid()

That kind of function is desperately needed for Skyrim because of the multi threading. ANYTHING can happen to a reference during the execution of a script where the reference WAS valid at the beginning of the script run.

User avatar
Juan Suarez
 
Posts: 3395
Joined: Sun Nov 25, 2007 4:09 am

Return to V - Skyrim