Difference between revisions of "ModActorValue - Actor"
Jump to navigation
Jump to search
imported>JustinOther m (→Examples: Floatified float parameters in examples) |
imported>Egocarib |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 9: | Line 9: | ||
Function ModActorValue(string asValueName, float afAmount) native | Function ModActorValue(string asValueName, float afAmount) native | ||
Function ModAV(string asValueName, float afAmount) | Function ModAV(string asValueName, float afAmount) | ||
ModActorValue(asValueName, afAmount) | |||
EndFunction | |||
</source> | </source> | ||
Line 29: | Line 31: | ||
Jake.ModAV("Health", -5.0) | Jake.ModAV("Health", -5.0) | ||
</source> | </source> | ||
== 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. | |||
== See Also == | == See Also == |
Latest revision as of 07:11, 12 April 2014
Member of: Actor Script
Modifies the specified actor value on the actor.
Syntax[edit | edit source]
Function ModActorValue(string asValueName, float afAmount) native
Function ModAV(string asValueName, float afAmount)
ModActorValue(asValueName, afAmount)
EndFunction
Parameters[edit | edit source]
- asValueName: The name of the actor value to modify. Actor Value List
- afAmount: How much to modify the value by.
Return Value[edit | edit source]
None.
Examples[edit | edit source]
; 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)
Notes[edit | edit source]
- 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.