• 🏆 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!

Stop a Unit From Automatically Attacking?

Status
Not open for further replies.
Level 6
Joined
Dec 9, 2014
Messages
176
So, in the map I'm making, I would like the unit you play as to only attack when either told to do so, or attacked first, this way there is a lot more control. I tried setting the "Combat Acquisition Range" to zero. I figured logically this would mean they wouldn't acquire unless told to do so, but instead, I test the map and there's the unit attacking automatically. Any help would be much appreciated!
 
Level 25
Joined
Aug 13, 2011
Messages
739
In the object editor under Stats - Unit Classification, add the Worker classification. It'll act like a peasant/peon/acolyte and only attack when told to do so.

You might also want to make sure Stats - Can Flee is false to prevent the unit from running away when attacked.
 
Level 6
Joined
Dec 9, 2014
Messages
176
In the object editor under Stats - Unit Classification, add the Worker classification. It'll act like a peasant/peon/acolyte and only attack when told to do so.

You might also want to make sure Stats - Can Flee is false to prevent the unit from running away when attacked.

Awesome! Thank you, it worked perfectly! Now I just have one more question related to this. Can I make a unit only run away if it's losing in a fight? What I mean is if the unit is low on hp it will flee?
 
Level 25
Joined
Aug 13, 2011
Messages
739
It doesn't cause the worker unit to attack back by itself, but it does give a lot more control over those units for triggers like the one in this test map.

By the way, this includes a method of causing the worker unit to run at or below 30% health.
 

Attachments

  • Worker Type Attacked.w3x
    13.1 KB · Views: 87
Level 6
Joined
Dec 9, 2014
Messages
176
but that does not make it attack when it is attacked, or does it?

Actually, I've tested it several times now and they will still suto attack as long as "Can Flee" is not checked. The only bad part of this (but I can over look it) is that it shows the hero as an idle worker in the bottom left of the screen now lol.
 
Level 6
Joined
Dec 9, 2014
Messages
176
It doesn't cause the worker unit to attack back by itself, but it does give a lot more control over those units for triggers like the one in this test map.

By the way, this includes a method of causing the worker unit to run at or below 30% health.

Nice. I might switch to that, I dunno yet. I mainly would like certain enemies to flee when they are low on health, not all enemies, just some.
 
Status
Not open for further replies.
Top