Difference between revisions of "IsBoundGameObjectAvailable - ScriptObject"
Jump to navigation
Jump to search
imported>Docclox (→Examples: Emphasized that the form must extend ScriptObject. ObjectReferences are not valid examples here.) |
imported>Docclox m (→Examples) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 19: | Line 19: | ||
== Examples == | == Examples == | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
; Make sure we have a | ; Make sure we have a reference to manipulate before we try to do so | ||
if MyScriptObject.IsBoundGameObjectAvailable() | if MyScriptObject.IsBoundGameObjectAvailable() | ||
; Do cool stuff with MyScriptObject here, as it is available to be manipulated | ; Do cool stuff with MyScriptObject here, as it is available to be manipulated |
Latest revision as of 02:47, 23 June 2020
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.
Syntax[edit | edit source]
bool Function IsBoundGameObjectAvailable() native
Parameters[edit | edit source]
None.
Return Value[edit | edit source]
True if this script is attached to a valid in-game object. False if not.
Examples[edit | edit source]
; Make sure we have a reference to manipulate before we try to do so
if MyScriptObject.IsBoundGameObjectAvailable()
; Do cool stuff with MyScriptObject here, as it is available to be manipulated
endIf