Difference between revisions of "HasVariable"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>Odessa
(can also be called on ref)
imported>Odessa
m (category + see also)
Line 1: Line 1:
{{Function
{{Function
  |origin = NVSE
  |origin = NVSE
  |summary = Returns true if the specified object's script has a variable of the specified name. Works for any scriptable object for all variable types. Added by NVSE V4.1.
  |summary = Returns true (1) if the specified object's script has a variable of the specified name. Works for any scriptable object for all variable types. Added by NVSE V4.1.
  |name = HasVariable
  |name = HasVariable
  |returnType = bool
  |returnType = bool
Line 27: Line 27:
</pre>
</pre>
==See Also==
==See Also==
*[[ShowVars]] / [[Con_ShowVars]] to print all variables and values to the console
*[[GetVariable]] (to retrieve the actual value of a numeric variable)
*[[GetVariable]] (to retrieve the actual value of a numeric variable)
*[[GetRefVariable]] (as above for ref variables)
*[[GetRefVariable]] (as above for ref variables)
Line 33: Line 34:
*[[SetRefVariable]] (Aded by NVSE 4.5.6)
*[[SetRefVariable]] (Aded by NVSE 4.5.6)
[[Category:Functions_(NVSE)]]
[[Category:Functions_(NVSE)]]
[[Category:Script Functions]]

Revision as of 11:44, 5 August 2014

< [[::Category:Functions|Category:Functions]]

A function added by the New Vegas Script Extender.

Description

Returns true (1) if the specified object's script has a variable of the specified name. Works for any scriptable object for all variable types. Added by NVSE V4.1.

Syntax

[help]
(bool) ref.HasVariable VarName:string Parent:Object

Example

ref rActor

if rActor.HasVariable "Waiting"
     ; Set or get it, etc
endif

; Alternatively, (or required if rActor holds a base form): 

if HasVariable "Waiting", rActor

See Also