HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

There's a way to detect the attack speed??

10-12-2006, 08:04 PM#1
GALLED
Hello everybody,

I want to know if there is some way to detect the attack speed of a unit. If someone has some idea of how could it be, I will thank him a lot.

thanks in advance
10-12-2006, 08:11 PM#2
aidan_124
I'm not gonna say i can JASS this but if youould use
Tigger 1 : when a unit attacks it starts a timer and turns off itself and turns on trigger 2. Also sets a variable equal to attacking unit
Trigger 2 : When the unit attacks stop timer turn off self, turn on trigger 1 and delete the variable...

That would time the time between attacks...i think...probably a much easier way to do it than that but thats the only way i can think off
10-12-2006, 08:31 PM#3
karukef
That's not a very awesome method of doing it. But on the other hand there might not be any sane way to do it.

This along with a multitude of other reasons is why I myself keep complete control over my units in my maps. Any kind of buff or spell or item that gives attackspeed has to call my own SetAttackSpeed function so that I can actually keep track of it _manually_ :)
10-12-2006, 08:40 PM#4
GALLED
Well.... i was think in the two triggers too. But this gave me the numer (of the cooldown time only) so late.... I have some experience in JASS, but the method, i don't know how make it!
10-12-2006, 09:57 PM#5
Rising_Dusk
Don't expect there to be some simple JASS fix for this sort of thing.
There isn't.

Timing between attacks will only be accurate if the attacker doesn't spam stop, otherwise all of a sudden they have a 0.01 attack speed.
To be quite fair, think of something else.
Attack speed detection is not worth the effort it would take.
10-12-2006, 10:25 PM#6
Deathlust
Standardly by Blizzard, each point of agility increases attack speed by 2%, but if you did it with that, it would be with heroes only and you would probably have to do each individual hero type separately.
10-13-2006, 12:49 PM#7
Chuckle_Brother
Quote:
Originally Posted by Rising_Dusk
Don't expect there to be some simple JASS fix for this sort of thing.
There isn't.

Timing between attacks will only be accurate if the attacker doesn't spam stop, otherwise all of a sudden they have a 0.01 attack speed.
To be quite fair, think of something else.
Attack speed detection is not worth the effort it would take.


Which is why you would use a controlled test, using a copy of the unit.

But like Karu, I just keep a firm grip on my units(I maintain a listing of their init statistics, damage bases, main attribute, attackspeed, etc) so I have access to all those values that blizzard screwed us on.

But yeah, short of coding in all speed boosts etc(easy if you have a BonusMod style system implemented, hellish if you don't) I would say its not worth it.
10-13-2006, 01:10 PM#8
Fireeye
And when you really want to get the attack speed i won't make something like a timer.
I would make it like.
1.) Getting Init Stats (attack speed and agi)
2.) Getting Level (so you can calculate factor gained through agi)
3.) Getting Items (only when + agi or + attack speed)
4.) multiplicate base speed with the factor
but as already told it's not worth its effort
10-13-2006, 05:40 PM#9
martix
So, there are 2 ways I can think of - one is static and needs preparation, one is dynamic and should work well enough.

1. Have your base speeds recorded and keep track of each units AS as they aquire items, start abilities, come under aura effects and stuff.

2. Detect an attack, start a timer, make sure your unit isn't given an order in between or something like this and detect the second attack.

But yea, its not worth it anyways. Maybe the second method simple enough would give your players a rough estimate.
10-13-2006, 05:44 PM#10
karukef
The static method is so difficult that it takes extreme dedication to make it work in any complex map.

The dynamic one just sucks. :)
10-13-2006, 07:07 PM#11
martix
I know, I'm not the first, nor the last to say that its simply not worth it! I'm just giving options if he does want to go thru this headache.
10-13-2006, 07:08 PM#12
The)TideHunter(
Just:
Make a copy of the unit in a unseeable/reacable place in the map, make 2 units there, 1(being something that wont die easy, maybe a unit with 10000 life or something), and ofcourse the copy.
Order the copy to attack the dummy, start a timer, create a local trigger and wait for the unit to be attacked again, record the timers duration and that should be your speed.
That should be some form of attack speed, if you wanted to do this test faster, give the copy unit a +100% or whatever increase attack speed and multiply the timer duration by 100.
10-13-2006, 07:18 PM#13
karukef
How hard can it be to figure out the BASE attackspeed of a unit? Because that's what you get if you create a copy.

The problem is to get the attackspeed of a unit at any given time, considering that units are affected by auras, items, buffs, debuffs etc that constantly changes their attackspeed. THATS the attackspeed that is difficult to find.

Not to show off or anything but.. ok to show off:
Hidden information:
This is the "is not worth it" system in action, where everything is under the control of the map. (And yes, it works)
10-14-2006, 11:33 AM#14
Toadcop
your methods are suxx ! i have a sys to detect attack spee + damage of any unit with any stuff... maybe later i will upload it...
10-14-2006, 01:23 PM#15
UnMi
You have a System? ...
Sorry man, but you must be something to be able to include the buffs based on different levels with a system that is globally multi instanceable and easily handleable by everyone.