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.
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top