Background for Skyrim SE
Member of the Actor script
voidfunctionModActorValue(stringasValueName, floatafAmount)Native

Description

Wiki Description

Modifies the specified actor value on the actor.

Documentation Comment

Modifies the specified actor value


Caveats

CK Wiki - Notes

  • This function modifies the current value as opposed to the base value.
  • ModActorValue is distinct from DamageActorValue because it adjusts the maximum value for the AV, while DamageActorValue or RestoreActorValue only adjust the current value. For example, if an actor has 100 Health, ModActorValue by -10 will lower the health total to 90/90, whereas DamageActorValue by 10 will result in 90/100 Health.

Parameters

stringasValueName

CK Wiki Description

The name of the actor value to modify. Actor Value List

floatafAmount

CK Wiki Description

How much to modify the value by.


Examples

; Modify the player's current health actor value by 10
Game.GetPlayer().ModActorValue("health", 10.0)
; Modify Jake's current health actor value by -5.0
Actor Jake= Jake_Alias.GetReference() as Actor
Jake.ModAV("Health", -5.0)

Auto-Generated Example

string myString__asValueName
float myFloat__afAmount

myActor__toCallFunctionOn.ModActorValue(myString__asValueName, myFloat__afAmount)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.