• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Detecting Healing and floating text

Status
Not open for further replies.
I'm trying to create healing floating text! Here is my trigger. For now, the result is - it shows some unrealistic numbers, like +340,350,364, 240 etc, even if the unit is not healing.

Where am I wrong here?
  • Healing Detection
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Set HP_Counter = (Units in (Playable map area) matching ((Owner of (Matching unit)) Not equal to Neutral Passive))
      • Unit Group - Pick every unit in HP_Counter and do (Actions)
        • Loop - Actions
          • Set HP_New[(Player number of (Owner of (Picked unit)))] = (Life of (Picked unit))
          • Set HP_Result[(Player number of (Owner of (Picked unit)))] = (HP_New[(Player number of (Owner of (Picked unit)))] - HP_Old[(Player number of (Owner of (Picked unit)))])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HP_New[(Player number of (Owner of (Picked unit)))] Greater than or equal to 2.10
            • Then - Actions
              • Floating Text - Create floating text that reads (+ + (String((Integer(HP_Result[(Player number of (Owner of (Picked unit)))]))))) above (Picked unit) with Z offset 40.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
              • Floating Text - Hide (Last created floating text) for (All players)
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
              • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
              • Floating Text - Show (Last created floating text) for (Player group((Owner of (Picked unit))))
            • Else - Actions
          • Set HP_Old[(Player number of (Owner of (Picked unit)))] = (Life of (Picked unit))
      • Custom script: call DestroyGroup(udg_HP_Counter)
 
Status
Not open for further replies.
Top