• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How can I make a unit attack when I press a keyboard key?

Status
Not open for further replies.
Level 3
Joined
Feb 23, 2010
Messages
73
remove the regular attack and do damage with the spell, and dont usedefend that just makes no sense. use any activated spell (preferably channel) and do when unit begins casting an ability. i dont know how you want to choose who to attack thats up to you.
 
Level 12
Joined
Sep 4, 2007
Messages
407
Do you want the unit to be able to attack ONLY if defend is on? I can also solve the problem of auto aquiring targets, i solve this tomorrow when i get home at night. Do you work with GUI or JASS? Show me your progress so far.
 
Level 4
Joined
Jun 22, 2009
Messages
36
Do you want the unit to be able to attack ONLY if defend is on? I can also solve the problem of auto aquiring targets, i solve this tomorrow when i get home at night. Do you work with GUI or JASS? Show me your progress so far.

I'm afraid I'm proficient with neither...:hohum:

Burnthemprisons, one of my problems is getting the spells to target and fire using triggers... otherwise, I would have tried something like carrion swarm... Or maybe I misinterpretted?

Another problem I have, though, is that my computer can't really override the spells animations too well... for some reason, my WE is missing Art-Animation, or whatever it is...
 
Level 4
Joined
Jun 22, 2009
Messages
36
I'm afraid I'm proficient with neither...:hohum:

Burnthemprisons, one of my problems is getting the spells to target and fire using triggers... otherwise, I would have tried something like carrion swarm... Or maybe I misinterpretted?

Another problem I have, though, is that my computer can't really override the spells animations too well... for some reason, my WE is missing Art-Animation, or whatever it is...

Huh, ok, I guess I'll try that...
But, still, my original question kinda stands...:confused:

Edit: Ok, I got the patch from Blizzard...

Is there a trigger order that makes a unit cast a custom ability at a certain point...?

Wait a sec- Yelyanra, I don't work with Jass, but what is GUI? Is that just what the normal world editor triggers are (I work with those)?


So, anyways, here's my code...:
  • Attack Copy
    • Events
      • Unit - Fighter 0002 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to NewAttack
    • Actions
      • Animation - Reset Fighter 0002 <gen>'s animation
      • Unit - Order Fighter 0002 <gen> to Attack Ground (Center of LiamsThreatenedZone)
      • Wait 4.00 seconds
      • Animation - Reset Fighter 0002 <gen>'s animation
Liam's Threatened Zone, by the way, is a region that always moves in front of Fighter 0002's facing direction.
The idea is, of course, is that he'll carrion swarm (i.e., new attack) the center of that region. The problem is, I can't seem to get him to do so...
 
Last edited:
Status
Not open for further replies.
Top