• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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