• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

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 21
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 16
Joined
May 2, 2011
Messages
1,351
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.

but that does not make it attack when it is attacked, or does it?
 
Level 21
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: 91
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