Difference between revisions of "GetValuePercentage - ObjectReference"
GetValuePercentage - ObjectReference (edit)
Revision as of 16:00, 26 June 2016
, 16:00, 26 June 2016changed local variables in examples to type of float from int
imported>Plplecuyer |
imported>Qazaaq (changed local variables in examples to type of float from int) |
||
Line 20: | Line 20: | ||
ActorValue property HealthAV | ActorValue property HealthAV | ||
; Obtain the player's current health percentage value | ; Obtain the player's current health percentage value | ||
float playersHealth = Game.GetPlayer().GetValuePercentage(HealthAV) | |||
if (playersHealth > 0.5) | if (playersHealth > 0.5) | ||
Debug.Trace("The player has over half their health left") | Debug.Trace("The player has over half their health left") | ||
Line 29: | Line 29: | ||
ActorValue property HealthAV | ActorValue property HealthAV | ||
; Obtain Bob's current health actor value | ; Obtain Bob's current health actor value | ||
float bobsHealth = Bob.GetValuePercentage(HealthAV) | |||
if (bobsHealth < 0.1) | if (bobsHealth < 0.1) | ||
Debug.Trace("Bob has less then 10% health remaining") | Debug.Trace("Bob has less then 10% health remaining") |