• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Button Attack

Status
Not open for further replies.

El13urrito

E

El13urrito

hey i would like to know how to make a unit attack an enemy unit when you press a certain button, preferably without using a spell, but if that is the only way then that would be fine too

but if it could be a sword attack that would be great, i would also take a ranged attack too

aslo, if it includes using JASS i need to know how to apply that because ive never used JASS before

thnx much
 
Using a spell makes it very easy, and if u want it without a spell, i guess you need JASS.
Anyways, if youre using a spell, this would work:

  1. Create a custom Unit Ability based on 'Howl of Terror' (Or any ability without targets)

  2. Set its values to what you want, most important the hotkey will be the button.
    You should set: Targets Allowed = None , Mana Cost = 0, etc.

  3. Add the Ability to the Unit you're talking about

  4. Make a trigger, looking like this:

    • Button Attack
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Button Attack
      • Actions
        • Unit - Order (Triggering unit) to Attack ("Some unit")
You are not so clear about which unit is to be attacked. A random unit in range? Or a specific unit? Anyways you can just make sure you set "Some unit" to the unit that should be attacked.

Everything clear?
 
thnx that was very helpful


btw i want the guy to attack everything in front of him


Edit: i just tried this out but i cannot get him to attack any faster, is this possible?
 
Last edited by a moderator:
To attack everything in front of him you'd have to make it more complicated, e.a. create a trigger to select all units in a certain zone in front of him and then apply some damage, yet these triggers are very sensitive to memory leaks. You will also have to learn to use coordinates and facings. Since you would want all units within certain coordinates, facing in front of the attacker be damaged.

Attacking faster isn't always possible, there's several things that can restrain:
- Ability cooldown
- Global ability cooldown
- Animations

People can probably think of more. I think the best think you can do at this point is scour the spells section for something similar or put a request up at the request forum. This spell would become a bit too complicated if you didn't know how to trigger the simple version in the first place.
 
@ El13urrito:

Sorry, I dont really get what you're saying.

If you want the unit to attack "everything in front of him", you should simply use this action:

  • Unit - Order (Triggering unit) to Attack-Move To (Position of (Triggering unit))
---

If you want him to move a bit aswell, use another point. Attack move orders the unit to move to the point, attacking anyone around him as he goes (as you may know).

  • Unit - Order (Triggering unit) to Attack-Move To ((Position of (Triggering unit)) offset by 500.00 towards (Facing of (Triggering unit)) degrees)
---

This trigger orders him to attack move to a point at 500 range in front of him.

Hope that helped, but i didnt really understand what you meant about having him attack faster... can you be more clear perhaps?
 
i need him to basically attack whenever i hit a button (doesn't matter), i already knew about the spell hotkey method, but i was trying to stay away from that because it is too slow

i know that ive seen the kind of attack i want in an Uther Party mini-game with arthas, that's the kind of thing im going for
 
Status
Not open for further replies.
Back
Top