GetEventDamage() and GetEventDamageSource() questions

eXirrah

New Member
Reaction score
51
GetEventDamage() - Does this return the damage reduced/increaces by armor or spells or damage before that.

GetEventDamageSource() - If the damage comes from a spell, does this return the caster or null?
 

eXirrah

New Member
Reaction score
51
Ok so I got another question. How can I determine if the damage taken is from
spell or attack?

I couldn't find any kind of function or something that returns the damage type of the damage taken.
 

eXirrah

New Member
Reaction score
51
I read that thread, but since I don't want to use Damage system it's no use for me.
Another thing is that I already created that thread yesterday and instead hijacking
other threads I decided to ask the question here.
 

Viikuna

No Marlo no game.
Reaction score
265
Well, then I can just quote myself:

The proper way is to do all damage but normal attacks with triggers.

Most of damage detection systems have some functions and thingies for supporting that stuff.


Systems exist to make stuff easier. If you dont wanna use systems, there is no good way to do this.

You could do something similiar that they do in DotA, but that would suck horribly, because stuff like immolation damage and things like that will be registered as attacks.

So in other words: No, dont do it. Just get a proper damage detection system and all that will become nicely easy and cool.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Well, then I can just quote myself:
I can do it too! :D
If you're willing to give up the use of most, if not all, orb effects and buff-placers, give every unit a hidden ability based on, say, Slow Poison, and check whether the damaged unit has that buff (and if it does, remove the buff as the first thing in the trigger, of course.)
 

Viikuna

No Marlo no game.
Reaction score
265
That just dont work so well with AoE attack stuff. ( Mortar team for example )

Of course you could trigger that stuff too, but I dont know if it is worth of it just to get orb effect attack detection to work.

( Triggering ranged attacks with some projectile system is definelty worth of it, but for other reasons, though. )
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
That just dont work so well with AoE attack stuff. ( Mortar team for example )
Hm. Well, Frost Breath works for Artillery and Missile (Splash), but not Missile (Line) or Missile (Bounce).
 

eXirrah

New Member
Reaction score
51
That just dont work so well with AoE attack stuff. ( Mortar team for example )

Of course you could trigger that stuff too, but I dont know if it is worth of it just to get orb effect attack detection to work.

( Triggering ranged attacks with some projectile system is definelty worth of it, but for other reasons, though. )

Lets say one of the reasons I want to do this is to have custom splash damage.
What I wanted to do is different gun has different kind of splash. For instance:

Weapons Splash.JPG

And I had the idea of calculating the time from the moment the missile is launched
to the moment it hits the target then create a trigger that fires when a unit is attacked
and sleep till the missile arrives.
Thing is that I can't understand how missile animation speed is calculated.
In object editor there is missile speed. I thought that this is a constant
but seems that when the hero gains additional attack speed (agility) the missile
speed increaces as well... I've tested this with unit attacked-damaged trigger and
a timer, and everytime my hero levels up the time that takes the missile to hit the
target decreaces.

So .. is there any formula to calculate the missile speed ?

EDIT: I would probably need to put the distance to target in the calculations cause
I presume that if the target is further away from the attacker the missile gets to him
slower.... I've seen units with high movement speed attacked by units with slow missile
speed and if the attacked unit runs away from the attacker then the
missile may need a several seconds to catch it.
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
missle speed = total distance moved in 1s.
missle speed = periodic range x timer period
 

eXirrah

New Member
Reaction score
51
If I get that right:

Missile speed - [distance/second]

so if the missile speed is 1900 then it will travel 1900 pixels(??) per second.

Missile time to hit = (distance to target)/(Missile Speed)

mening that for a constant distance to target the Missile time to hit should be
constant as well.

[del]My testing proved that wrong....

The targets are melee fighters, my hero has attack type instant.
when they come and attack me they stay at the same distance i.e. right infront
of me meaning that the distance is a constant.
So is the missile time to hit(0.167) until I level up. After I level up I get 2 agility and
the missile time to hit changes (0.165) but the target didn't move a pixel closer to
me or me away from it, except if when I level up my position is changed.

So ...
1. this is some sort of bug ...
2. the missile speed is not a constant and it depends on attack speed(agility)

I didn't tested that for some other IAS than agility bonus so I can't be sure
if missile speed depends on agility or IAS, but I'm going to test it when I have
time.[/del]



I just figured out this formula:

Time Between Unit Attacked and Unit Damaged events = (Animation Damage Point time) + (Distance between attaker and target)/(Missile Speed)
Animation Damage Point time = (Combat - Animation Damage Point)/(1+IAS/100)

EDITL The formula calculates the time difference between the events unit is attacked and unit is damaged pretty close +-10 ms, but seems
like the functions in JASS are not that fast. I tested it and if I say the trigger to sleep the time I calculated the whole function executes with
100-150 ms delay which is alot. This system would work for units with very slow attack speed (about 1.5-2 seconds) but desn't work for my map.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Thing is that I can't understand how missile animation speed is calculated. In object editor there is missile speed. I thought that this is a constant but seems that when the hero gains additional attack speed (agility) the missile speed increaces as well... I've tested this with unit attacked-damaged trigger and a timer, and everytime my hero levels up the time that takes the missile to hit the target decreaces.
Missile speed is constant, and is in the same units as distance, so a projectile with speed 600 will take one second to reach a distance of 600.

What you're seeing is probably due to the delay between the start of an attack and when the missile fires. The actual travel time of the missile will be constant (for a certain range) but there is additional time between the unit-attacked event and when the missile is actually fired, based on the unit's Attack - Animation Damage Point and any attack speed bonuses (agility, buffs, items, etc.) and this delay can't practically be calculated. :(

I've seen units with high movement speed attacked by units with slow missile speed and if the attacked unit runs away from the attacker then the missile may need a several seconds to catch it.
This is true for homing projectiles. If you disable Attack - Projectile Homing Enabled, it'll travel straight to the position of the target at the moment of attack, and will hit when it reaches it.

but seems like the functions in JASS are not that fast. I tested it and if I say the trigger to sleep the time I calculated the whole function executes with 100-150 ms delay which is alot.
TriggerSleepAction() is not very precise; you should look into timer systems.
 

Viikuna

No Marlo no game.
Reaction score
265
Yea, TriggerSleepAction counts real time, not game time. You cant make smooth movement with it, because it cant handle very small values.
You need a periodic timer with about .03 period, because thats the speed human eye works or something.
 

eXirrah

New Member
Reaction score
51
I have calculated the time between the attack and damage events, I tried with
timer and it's the same thing. Seems like the calculations that the trigger does
are slowing the proces by 50-150 ms that's why I can't use that for units that
have attack speed of 100 ms (damage point+missile speed).
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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