Snippet GUI-Friendly Damage Detection

Mcbeazy

New Member
Reaction score
2
Hey, I am having trouble getting this to display just the damage taken and given above the heads. I don't want it to say *name of unit* damages *name of enemy* for X dmg, I jsut want Xdmg. Any ideas?
 

Sui-cookie

You can change this now in User CP.
Reaction score
49
Trigger:
  • damage text base
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
    • Actions
      • Set Tempoint = (Position of (Attacked unit))
      • Floating Text - Create floating text that reads ((String(GDD_Damage)) + <Empty String>) at Tempoint with Z offset 0.00, using font size 7.00, color ((Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%), and (Random real number between 10.00 and 50.00)% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 70.00 towards (Random angle) degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds


is what im using atm, but i do have a question. this goes into thousandths >.> if i remember right, is there a way to make it round to simple whole numbers? a small purple 8.021 looks like just 8021 when the text size is 7 and moving...
 

Chaos_Knight

New Member
Reaction score
39
When i say this i am totally serious.

JASS:
AWSOME!!


I think this gotta be one of the most useful and good Snippets ever(for GUI's). Awsome. Very useful when creating "15% chance to Effect Spell". Good Job.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
if i remember right, is there a way to make it round to simple whole numbers?
Yep, use Convert Integer to String and Convert Real to Integer, instead of Convert Real to String.
 

Darkrevenger

New Member
Reaction score
1
Trigger:
  • Reflection
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamagedUnit has buff Reflect ) Equal to True
    • Actions
      • Unit - Cause GDD_DamagedUnit to damage GDD_DamageSource, dealing (GDD_Damage x 0.50) damage of attack type Spells and damage type Normal


D: why doesn't this work?
 

Chaos_Knight

New Member
Reaction score
39
Trigger:
  • Reflection
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamagedUnit has buff Reflect ) Equal to True
    • Actions
      • Unit - Cause GDD_DamagedUnit to damage GDD_DamageSource, dealing (GDD_Damage x 0.50) damage of attack type Spells and damage type Normal


D: why doesn't this work?

Use Hardened Shell.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
D: why doesn't this work?

I don't see any reason that it shouldn't work, so check the usual things: you've specified the correct buff, the damage source is not spell immune (since you are reflecting as spell damage), the trigger is enabled... Try putting in a "display text" action for debugging, to see if the trigger is even running.

Be aware that if two units have the Reflection buff and one hits the other, you'll end up with an infinite loop as they reflect damage back and forth. You may want to disable the trigger as the first action and re-enable it as the last, to disallow recursion.
 

Darkrevenger

New Member
Reaction score
1
I don't see any reason that it shouldn't work, so check the usual things: you've specified the correct buff, the damage source is not spell immune (since you are reflecting as spell damage), the trigger is enabled... Try putting in a "display text" action for debugging, to see if the trigger is even running.

Be aware that if two units have the Reflection buff and one hits the other, you'll end up with an infinite loop as they reflect damage back and forth. You may want to disable the trigger as the first action and re-enable it as the last, to disallow recursion.

It appears to run, the only thing is it doesn't do the damage to the damage source(?!?!) :banghead:
 

jim7777

New Member
Reaction score
0
I have some problems in your system. Warcraft always disappears after Maybe because I try to add some math into the conditions because I want it to check if the attack is a backstab one or not. But it disappears. Here's the trigger:

Trigger:
  • Display Damage
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamageSource is A Hero) Equal to True
      • (Cos((GDD_FacingAngle - (Angle from GDD_BackstabPoint1 to GDD_BackstabPoint2)))) Less than (Cos(90.00))
    • Actions
      • Floating Text - Create floating text that reads (|cffffcc00 + (String((Integer(GDD_Damage))))) above GDD_DamageSource with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Show (Last created floating text) for GDD_EnabledPlayers


Trigger:
  • Display Damage BackStab
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamageSource is A Hero) Equal to True
      • (Cos((GDD_FacingAngle - (Angle from GDD_BackstabPoint1 to GDD_BackstabPoint2)))) Greater than (Cos(90.00))
    • Actions
      • Floating Text - Create floating text that reads |c00ff8000Back Atta... above GDD_DamageSource with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Show (Last created floating text) for GDD_EnabledPlayers
      • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing (GDD_Damage / 2.00) damage of attack type Hero and damage type Enhanced


Sir, if possible, If you can put an inline function regarding the backstab because I really need it. To check if the attacking unit is backstabbing or not or any help on how to prevent it or optimize my triggers.

Thanks!
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Warcraft always disappears after

Trigger:
  • Display Damage BackStab
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (GDD_DamageSource is A Hero) Equal to True
      • (Cos((GDD_FacingAngle - (Angle from GDD_BackstabPoint1 to GDD_BackstabPoint2)))) Greater than (Cos(90.00))
    • Actions
      • Unit - Cause GDD_DamageSource to damage GDD_DamagedUnit, dealing (GDD_Damage / 2.00) damage of attack type Hero and damage type Enhanced
You've created a classic "infinite loop" situation - when you deal damage in this trigger, it causes the trigger to run again, ad infinitum. The solution is to turn off the trigger before dealing the backstab damage, and turning the trigger back on afterward.
 

najrasaam

New Member
Reaction score
0
Heey question on the damage detection system

it displays the damage done in 5 digits or more like : (89.213)
I just want 89. nothing more. How to make this?

i just want 2 or more digits but nothing behind the dot.

tnx in advance
 

Sevion

The DIY Ninja
Reaction score
413
Convert the real to an integer. Though, this will not round. It'll floor it. (Drop anything after decimal.)
 

DuelPlayer

Member
Reaction score
21
Does GDD include spell damage or only normal attacks?
It happened once when I casted a spell on a unit. The unit got knockback which is in another trigger.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Is there any ways to detect spell damage or normal attacks?
If all spells in your map deal damage by triggers, you can temporarily set a boolean variable to true when dealing spell damage. Therefore, if the boolean is false when a unit takes damage, it must have come from an attack.

Otherwise, if you are comfortable triggering all buff-on-attack abilities, every unit can be given a hidden buff-on-attack ability which will let you determine whether the damage came from an attack by checking whether the damaged unit has that buff.

As far as I'm aware, these are the only reliable methods for discerning attack damage apart from spell damage in WC3.
 

tommerbob

Minecraft. :D
Reaction score
110
I guess this is an FYI more than anything.

I've been using the GDD damage detection in my spell, and referencing the GDD_DamageSource as "triggering unit" in my hashtable Key Handle. I didn't think it would work because the custom variable cannot be referenced in a Handle, but it seems to being working just fine.

Is this a bug, or was I misinformed, or what?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top