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

disables auto-acquire target

Status
Not open for further replies.
Level 9
Joined
Jan 3, 2010
Messages
359
as the title said, i want to disable the auto-acquire target, so the unit wont attack any enemy until i give him an order.

i used "worker" clasification and turned the "can flee" to false
but it shows the idle worker icon ...

anyone had a better idea than mine ?
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
Worker: Worker classification has two basic effects. It displays idle worker icons when the unit has nothing to do and it prevents the unit from acquiring any targets. However if you add the worker classification at runtime, it will only get the second effect and won't show any idle worker icon at all. That's how you can create units that ignore enemies.

JASS:
call UnitAddType(u, UNIT_TYPE_PEON)

If you additionally set the unit field can flee to false it won't even run away when attacked. To create a unit that ignores all enemies except when it is being attacked you can use 'Apiv' (Permanent Invisibility) with the duration set to -1 and auto acquire attack targets to false. Now the unit won't be invisible but still not auto acquire targets.
From here.

Also, the GUI equivalent for the Jass line is
  • Unit - Add classification of A peon-type unit to (Triggering unit)
 
Status
Not open for further replies.
Top