1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  4. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  5. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Button Attack

Discussion in 'World Editor Help Zone' started by El13urrito, Aug 17, 2007.

  1. El13urrito

    El13urrito

    Joined:
    Aug 15, 2007
    Messages:
    9
    Resources:
    0
    Resources:
    0
    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
     
  2. Lingonberryjam

    Lingonberryjam

    Joined:
    Feb 25, 2005
    Messages:
    230
    Resources:
    0
    Resources:
    0
    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?
     
  3. El13urrito

    El13urrito

    Joined:
    Aug 15, 2007
    Messages:
    9
    Resources:
    0
    Resources:
    0
    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: Aug 17, 2007
  4. Angelusz

    Angelusz

    Joined:
    Sep 8, 2004
    Messages:
    634
    Resources:
    2
    Maps:
    2
    Resources:
    2
    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.
     
  5. Lingonberryjam

    Lingonberryjam

    Joined:
    Feb 25, 2005
    Messages:
    230
    Resources:
    0
    Resources:
    0
    @ 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?
     
  6. El13urrito

    El13urrito

    Joined:
    Aug 15, 2007
    Messages:
    9
    Resources:
    0
    Resources:
    0
    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
     
  7. PurplePoot

    PurplePoot

    Joined:
    Dec 14, 2005
    Messages:
    11,161
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    You can speed up the spell cast time by changing the unit's

    Animation - Cast Backswing

    and

    Animation - Cast Point
     
  8. Steel_Cold

    Steel_Cold

    Joined:
    Apr 16, 2005
    Messages:
    154
    Resources:
    0
    Resources:
    0
    I made a map awhile ago that has a system i think is excatly what your looking for. see attachment
     

    Attached Files: