• 🏆 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!

Need help with damage floating text

Status
Not open for further replies.
Level 12
Joined
Oct 28, 2019
Messages
475
The trigger is done, but there as problem, The damage displayed is all red... what condition I can use to show Green to damage enemies , and Red the player?

  • Show Text Copy
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set VariableSet TempLoc1 = (Position of DamageEventTarget)
      • -------- Use only 1 of the 2 options below --------
      • -------- 1) This will display a REAL value (e.g.: 5.589) --------
      • Floating Text - Create floating text that reads (|c00dd2200 + ((String(DamageEventAmount)) + |r)) at TempLoc1 with Z offset 100.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • -------- 2) This will display an INTEGER value (e.g.: 5) --------
      • Floating Text - Create floating text that reads (|c00dd2200 + ((String((Integer(DamageEventAmount)))) + |r)) at TempLoc1 with Z offset 100.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Custom script: call RemoveLocation(udg_TempLoc1)
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
      • Floating Text - Set the velocity of (Last created floating text) to 80.00 towards 90.00 degrees
 

Remixer

Map Reviewer
Level 31
Joined
Feb 19, 2011
Messages
1,956
You need to create an IF statement to differentiate whether the target is an enemy or not.
  • Example Trigger
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set VariableSet TempLoc1 = (Position of DamageEventTarget)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player is an ally of (Owner of DamageEventTarget).) Equal to True
        • Then - Actions
          • -------- Attacked unit is an ally: --------
          • Floating Text - Create floating text that reads |cff20ff00Green Tex... at TempLoc1 with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Else - Actions
          • -------- Attacked unit is NOT an ally (it is an enemy): --------
          • Floating Text - Create floating text that reads |cffff2000Red Text ... at TempLoc1 with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • -------- COPY HERE EVERYTHING AFTER "call RemoveLocation..." --------
 
Status
Not open for further replies.
Top