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.

      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