• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Help?

Status
Not open for further replies.
Level 2
Joined
Nov 1, 2011
Messages
16
Here's what, After I manage to remove attack command, I dunno what the hell will I do to make an ability to damage units by pressing the ability.

There are a lot of things I want with the system/ability, I want it to be multi-unit instancable.

Image ---> untitled.JPG
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
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


http://www.hiveworkshop.com/forums/pastebin.php?id=awydcn

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.
 
Status
Not open for further replies.
Top