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

Im having problems with damage engine show text

Level 12
Joined
Oct 28, 2019
Messages
475
I maked a damage system like this> if a unit damages 8 and the target has 2 armor the damage taken is 6....
here all ok, but a spell damage like lightning shield this cant be happen. Idk how to solve it, theres how to say to the trigger that this is a spell damage etc
obs the normal attack is a spell (forked lightning) (it appears a normal attack )that uses strenght points to deal damage

  • Show Text Copy
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (HeroVariable has buff Defend ) Equal to False
    • Actions
      • Set VariableSet TempLoc1 = (Position of DamageEventTarget)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) is an ally of Player 2 (Blue).) Equal to True
        • Then - Actions
          • Set VariableSet DamageEventAmount = (DamageEventAmount - (Armor of DamageEventTarget))
          • Floating Text - Create floating text that reads (<Empty String> + ((String((Integer(DamageEventAmount)))) + <Empty String>)) at TempLoc1 with Z offset 100.00, using font size 10.00, color (100.00%, 0.00%, 0.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
        • Else - Actions
          • Set VariableSet TempLoc1 = (Position of DamageEventTarget)
          • Set VariableSet DamageEventAmount = (DamageEventAmount - (Armor of DamageEventTarget))
          • Floating Text - Create floating text that reads (<Empty String> + ((String((Integer(DamageEventAmount)))) + <Empty String>)) 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
 
Level 21
Joined
Dec 4, 2007
Messages
1,478
Do you have access to the condition "is damage attack = true"?
With that you can tell the damage system to leave out non-attack damage.
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
I don't think that will help him. If I understand correctly, he uses a spell instead of normal attacks as well.
I think the issue here is exactly just that - using forked lightning which deals attack type 'spells' for normal attack and then some other spell which also deals attack type 'spells'.

The solution to this would be to not use Forked Lightning, instead use Channel ability and create a trigger that will deal 'pure' damage (attack type spells, damage type universal) whenever a unit casts that Channel-based spell.
In the DamageEvent trigger you would check if the attack/damage type is 'pure' damage and if so, you know it was triggered damage for 'normal attack'
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
Lightning Shield inflicts life loss rather than damage if I recall correctly which is why it doesn't fire a damage event. If so, the solution is to trigger Lightning Shield yourself, which is rather easy to do with the standard Loop/Unit Group approach.

Also, I highly doubt you want to reference Triggering Player in response to a Damage Event:
  • ((Triggering player) is an ally of Player 2 (Blue).) Equal to True
Check the Owner of DamageSource or DamageTarget.

Edit: I think you want something like this:
  • Show Text Copy
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set Variable TempLoc1 = (Position of DamageEventTarget)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsDamageSpell Equal to False
        • Then - Actions
          • Set Variable DamageEventAmount = (DamageEventAmount - (Armor of DamageEventTarget))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of DamageSource) is an ally of Player 2 (Blue).) Equal to True
        • Then - Actions
          • Floating Text - Create floating text that reads (String((Integer(DamageEventAmount))) at TempLoc1 with Z offset 100.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
        • Else - Actions
          • Floating Text - Create floating text that reads (String((Integer(DamageEventAmount))) 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)
      • Set Variable TempText1 = (Last created floating text)
      • Floating Text - Change TempText1 : Disable permanence
      • Floating Text - Change the lifespan of TempText1 to 2.00 seconds
      • Floating Text - Change the fading age of TempText1 to 1.00 seconds
      • Floating Text - Set the velocity of TempText1 to 80.00 towards 90.00 degrees
 
Last edited:
Top