Difference between revisions of "GetActorValue - Actor"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Moorleiche2k
imported>JustinOther
(Floatified vars. Added note about expedience via use of native version.)
Line 20: Line 20:
<source lang="papyrus">
<source lang="papyrus">
; Obtain the player's current health actor value
; Obtain the player's current health actor value
int playersHealth = Game.GetPlayer().GetActorValue("health") as int
Float fPlayerHealth = Game.GetPlayer().GetActorValue("Health")
</source>
</source>
<br/>
<br/>
<source lang="papyrus">
<source lang="papyrus">
; Obtain Bob's current health actor value
; Obtain Bob's current health actor value
int bobsHealth = Bob.GetAV("Health") as int
Float fBobSneak = Bob.GetAV("Sneak")
</source>
</source>
==Note==
*GetActorValue is slightly faster than GetAV as it is native.


== See Also ==
== See Also ==

Revision as of 23:53, 26 January 2013

Member of: Actor Script

Gets the specified actor value from the actor.

Syntax

float Function GetActorValue(string asValueName) native
float Function GetAV(string asValueName) native

Parameters

Return Value

The value of the requested actor value.

Examples

; Obtain the player's current health actor value
Float fPlayerHealth = Game.GetPlayer().GetActorValue("Health")


; Obtain Bob's current health actor value
Float fBobSneak = Bob.GetAV("Sneak")

Note

  • GetActorValue is slightly faster than GetAV as it is native.

See Also