Difference between revisions of "GetValuePercentage - ObjectReference"

changed 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
int playersHealth = Game.GetPlayer().GetValuePercentage(HealthAV)
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
int bobsHealth = Bob.GetValuePercentage(HealthAV)
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")
Anonymous user