SC2Mapster Forums

Development > Miscellaneous Development

Is creating a single key press to attack, possible?

  • 4 posts
    #1 May 24, 2011 at 20:22 UTC - 0 likes

    How do you make a hero unit only "attack swing" once, when you press spacebar, instead of autoattack like normal?

    • Deals damage using the hero's base weapon damage + any items that increase melee damage ie. +5 damage or such item modifier behavior bonuses must be included
    • The damage dealt per swing is reduced by the target''s life armor (just as if normally attacking)
    • Deals damage in a frontal cone (with a sword swing arc graphic, dunno if there is something like this in sc2 models or not)
    • Uses not only the hero's base attack speed as cooldown but also (including all item attack speed modifiers, ie item that modifies attack speed by .98 must be counted)

    I'm not even sure if it is possible to get the hero's current attack speed (including all item attack speed behavior bonuses) (weapon cooldown and weapon speed multiplier in the trigger editor don't return the attack speed that you see by hovering over the weapon icon)

    for example, my hero has an attack speed of 2.3 with -0.35 speed bonus from item, but the debug message convert real to text of the units' weapon cooldown displayed 45, and the debug message convert real to text of the unit's weapon speed multiplier displayed 1

    Is that possible, and if so, whats the best way to do so?

    Thanks

    Last edited May 24, 2011 by HatsuneMikuMegurine
    #2 May 27, 2011 at 20:10 UTC - 0 likes

    So I kinda figured out everything except for:

    • Uses not only the hero's base attack speed as cooldown but also (including all item attack speed modifiers, ie item that modifies attack speed by .98 must be counted)

    I'm not even sure if it is possible to get the hero's current attack speed (including all item attack speed behavior bonuses) (weapon cooldown and weapon speed multiplier in the trigger editor don't return the attack speed that you see by hovering over the weapon icon)

    Anyone know how to get a unit's attack speed in game and return it as a real variable?

    #3 Jan 29, 2013 at 23:37 UTC - 0 likes

    I'd be interested in seeing how you made this ability work as I also want to make a game with the same mechanic...

    #4 Feb 01, 2013 at 22:12 UTC - 0 likes

    @Gaelidan: Go

    i just did a trigger that deals damage

    probably not the best way to do it, but it worked

    when a player presses "G" for example, then the trigger moves a region directly in front of that players hero, and deals damage to any picked unit in that region with the hero's damage effect

    and animation, sound effect, and visual impact/launch models are created at that time

  • 4 posts

You must login to post a comment. Don't have an account? Register to get one!