Difference between revisions of "SetActorValue - Actor"
Jump to navigation
Jump to search
imported>Jlundin (→Syntax) |
imported>Bug64 m (Cosmetic edit) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 8: | Line 8: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
Function SetActorValue(string asValueName, float afValue) native | Function SetActorValue(string asValueName, float afValue) native | ||
Function SetAV(string asValueName, float afValue) | Function SetAV(string asValueName, float afValue) | ||
SetActorValue(asValueName, afValue) | |||
EndFunction | |||
</source> | </source> | ||
Line 21: | Line 24: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
; Set the player's health actor value to 50 | ; Set the player's health actor value to 50 | ||
Game.GetPlayer().SetActorValue("health", 50) | Game.GetPlayer().SetActorValue("health", 50.0) | ||
</source> | </source> | ||
<br/> | <br/> | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
; Set Nancy's current health actor value | ; Set Nancy's current health actor value | ||
Nancy.SetAV("Health", 20) | Nancy.SetAV("Health", 20.0) | ||
</source> | </source> | ||
== Notes == | |||
*While GetActorValue returns the current value, SetActorValue sets the base value. To modify the current value, use [[DamageActorValue - Actor]], [[RestoreActorValue - Actor]], [[ModActorValue - Actor]], or [[ForceActorValue - Actor]]. | |||
== See Also == | == See Also == |
Latest revision as of 16:06, 10 August 2015
Member of: Actor Script
Sets the base value specified actor value on the actor to the passed-in value. Any modifiers are left intact.
Syntax[edit | edit source]
Function SetActorValue(string asValueName, float afValue) native
Function SetAV(string asValueName, float afValue)
SetActorValue(asValueName, afValue)
EndFunction
Parameters[edit | edit source]
- asValueName: The name of the actor value to set the value of. Actor Value List
- afValue: What value to set the actor value to.
Return Value[edit | edit source]
None.
Examples[edit | edit source]
; Set the player's health actor value to 50
Game.GetPlayer().SetActorValue("health", 50.0)
; Set Nancy's current health actor value
Nancy.SetAV("Health", 20.0)
Notes[edit | edit source]
- While GetActorValue returns the current value, SetActorValue sets the base value. To modify the current value, use DamageActorValue - Actor, RestoreActorValue - Actor, ModActorValue - Actor, or ForceActorValue - Actor.