IsBoundGameObjectAvailable - ScriptObject

From Creation Kit
Jump to: navigation, search

Member of: ScriptObject Script

Returns whether this script is attached to a valid and available in-game object. If it returns false, then calling native functions from one of the ScriptObject-extended scripts (like Form, or Alias, or ActiveMagicEffect) will immediately fail because it has no in-game object to operate on. The most common cases of this happening would be a magic effect that has expired, or a reference that is stored in a container.


bool Function IsBoundGameObjectAvailable() native



Return Value

True if this script is attached to a valid in-game object. False if not.


; Make sure we have a reference to manipulate before we try to do so
if MyReference.IsBoundGameObjectAvailable()
  ; Do cool stuff with MyReference here, as it is available to be manipulated

See Also