Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
I disable the default attack ability with giving the unit an ability that disables it. I created a new attack ability based on Channel.
You can tap A repeatedly to play perform an attack.
Here's a basic trigger how to deal the damage:
AttackWithAbility
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Attack
Actions
Set u1 = (Triggering unit)
Set p1 = (Position of u1)
Set r1 = (Facing of u1)
Set b = False
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within 150.00 of p1 matching ((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to u1))) and do (Actions)
Loop - Actions
Set u2 = (Picked unit)
Set p2 = (Position of u2)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
b Equal to False
(Acos((Cos(((Angle from p1 to p2) - r1))))) Less than 30.00
Then - Actions
Unit - Cause u1 to damage u2, dealing 15.00 damage of attack type Normal and damage type Normal
Set b = True
Else - Actions
It damages allies and you might not damage units with large collison size such as building. These issues can be fixed, but I'm not going to do it.
You need quite a lot of knowledge in the editor to get this system done. Like how does Art - Animation - Cast point affect this? What is Follow through time? Should you use timers? How do you change attack cooldow and attack speed? How to do unit type spesific things? And so on.
Don't get me wrong, it can be very fun if done correctly. When I complete my current project and if I start a new one, it ill use this kind of attack system.
I actually made this kind of system once.
Left arrow - quick attack with low dmg
Right arrow - slow attack with high dmg
Up arrow - Block
Down arrow - Dodge
EDIT: The solution Kobas posted could work also. However using a wait is bad, since the defined wait time is always increased by either 0.1, 0.125, 0.15, 0.175 or 0.2 seconds, chosen randomly. A timer is better solution.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.