• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Problem with verifying unit life

Status
Not open for further replies.
Level 12
Joined
Mar 23, 2008
Messages
942
  • Ally enter in base 1
    • Events
      • Unit - A unit comes within 50.00 of Base Teleporter 0043 <gen>
    • Conditions
      • ((Owner of (Triggering unit)) is an ally of Player 1 (Red)) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Arena Equal to Mystic Fountain
          • (Integer((Life of (Triggering unit)))) Greater than or equal to ((Integer((Life of (Triggering unit)))) x (Integer(0,4)))
        • Then - Actions
          • Unit - Move (Triggering unit) instantly to (Point(-6974.50, 5569.50))
        • Else - Actions
          • Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player))) for 5.00 seconds the text: Your life need to b...
The unit got teleported to the right place, but... Don't matter the life! I tried with a 14hp with (max hp is 500) and it still got teleported!

What is wrong?
 
Level 2
Joined
Mar 19, 2008
Messages
59
Ok I see it
"(Integer((Life of (Triggering unit)))) Greater than or equal to ((Life of (Triggering unit)) / 4.00)"
The integer of .4 is 1... so your just comparing the life of the triggering unit with the unchanged life of the triggering unit.
So what you do is
(Integer((Life of (Triggering unit)))) Equal to ((Integer((Life of (Triggering unit)))) / 4)
I think that should do it correct me if I am wrong
 
Level 12
Joined
Mar 23, 2008
Messages
942
  • Ally enter in base 1
    • Events
      • Unit - A unit comes within 50.00 of Base Teleporter 0043 <gen>
    • Conditions
      • ((Owner of (Triggering unit)) is an ally of Player 1 (Red)) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer((Life of (Triggering unit)))) Greater than or equal to ((Integer((Life of (Triggering unit)))) / 4)
        • Then - Actions
          • Unit - Move (Triggering unit) instantly to (Point(-6974.50, 5569.50))
        • Else - Actions
          • Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to (Matching player))) for 5.00 seconds the text: Your life need to b...
Didn't worked.

(How I use real numbers ?)
 
Level 2
Joined
Mar 19, 2008
Messages
59
Snap sorry bout that multiplying by .4 isnt the same as dividing by 4
It would be 2/5'ths >.< lol oops
Ok um but why dont u use percentages? instead
(Integer((Percentage life of (Triggering unit)))) Greater than or equal to 25
I tested it and percentages arent messed with by the integer
Plus ady_illydan from what I see you woundnt be able to use a real number in this case because Unit-property is an integer and can only be accessed that way.
 
Level 12
Joined
Mar 23, 2008
Messages
942
Snap sorry bout that multiplying by .4 isnt the same as dividing by 4
It would be 2/5'ths >.< lol oops
Ok um but why dont u use percentages? instead
(Integer((Percentage life of (Triggering unit)))) Greater than or equal to 25
I tested it and percentages arent messed with by the integer
Plus ady_illydan from what I see you woundnt be able to use a real number in this case because Unit-property is an integer and can only be accessed that way.
Because I didn't know how to do that, but I found at Conversion Real to ...
Thanks ^^

I would kiss you, but I will only give you rep xD (I know you prefer the kiss... :3)
 
Status
Not open for further replies.
Top