• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Auto-attack off

Status
Not open for further replies.
Level 4
Joined
May 2, 2009
Messages
69
Hey, I need help to turn off a unit's auto attack. I want it so you have to right click somebody to have your unit attack them.
Plz help soon.
 
Level 9
Joined
Apr 28, 2009
Messages
538
or you can make a trigger something like this:

Event: Map startup
Conditions: None
Actions: Make player 1 treat player 2 as neutral.

Then, you'll have to press attack and select the unit to attack it.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
just add chain to your unit with damage that you want and 1 target max
(chain damage is stronger that attack damage)
use this icon to make it look like attack icon
ReplaceableTextures\CommandButtons\BTNAttack.blp

set mana cost - 0
cooldown - 0
missile speed - 9999999999

(Hotkey - A)

if you want to attack when right click......
  • unit is ordered
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Ordered unit) Equal to (You unit with "fake" attack - chain lightning)
    • Actions
      • Wait 0.00 seconds
      • Unit - Order (Ordered unit) to Orc Far Seer - Chain Lightning (Target unit of issued order)
You must use action Wait 0.00seconds


or you could add classification - worker
 
Last edited:
Level 4
Joined
May 2, 2009
Messages
69
Oh I see, thanks. I did that before, but instead of doing it with attack, I made a whole new spell, and that was weird because then there were two new spells. :p Thanks man.
 
  • unit is ordered
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Ordered unit) Equal to (You unit with "fake" attack - chain lightning)
    • Actions
      • Wait 0.00 seconds
      • Unit - Order (Ordered unit) to Orc Far Seer - Chain Lightning (Target unit of issued order)
You must use action Wait 0.00 seconds
NEVER in the hell use waits...
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
NEVER in the hell use waits...
I think it is better than WarCraft crash
i don´t really care what some people are saying,like removing player groups can cause some leaks,and you need 1000000 to make that leak that will cause lags

waits are working on some events,like unit dies,you can wait 15 sec and it will work

besides,how would you order ordered unit to attack if you don´t use wait?
 
I think it is better than WarCraft crash
i don´t really care what some people are saying,like removing player groups can cause some leaks,and you need 1000000 to make that leak that will cause lags
Player groups do not leak.

waits are working on some events,like unit dies,you can wait 15 sec and it will work
It will work everytime, but the smoothest wait is 0.27 seconds, thats Blizzards dumb fault.

besides,how would you order ordered unit to attack if you don´t use wait?
I would use timers...

Like this:
JASS:
scope TheAttack

    struct Attack
        static unit theUnit = null
        static timer theTimer = CreateTimer()

        public static method releaseAttack takes nothing returns nothing
             // Do whatever you want...
        endfunction

        public static method create takes unit u returns Attack
            Attack.theUnit = u
            call TimerStart(Attack.theTimer, 0.01, false, function Attack.releaseAttacK)
        endmethod
    endstruct
endscope

Edit: This would wait 0.01 seconds.
 
Level 19
Joined
May 1, 2008
Messages
1,130
sorry i didnt saw that somebody already posted that idea
i gues everybody likes the complicated shit instead of the clean and easy one :cool:
 
Level 19
Joined
May 1, 2008
Messages
1,130
change the worker icon to whatever
then if you are using a unit instead of a hero you have your very own icon :D
 
Status
Not open for further replies.
Top