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

how to make unit defend itself?

Status
Not open for further replies.
Level 4
Joined
Jul 24, 2013
Messages
95
hey its me again,i have 1 more problem,im making rpg map,whats the trigger to make unit that is being attacked to attack that whateva unit that is attacking it..

+1 rep for good reply
 
Last edited:
Level 16
Joined
Dec 15, 2011
Messages
1,423
I don't understand your question very well but I guess you can just set the acquisition range of the monsters to 0. That way they will not acquire targets automatically and only retaliate when attacked. Warcraft III is also kind enough to force them to attack the attacking unit as priority, which is probably what you want to achieve.
 
Level 4
Joined
Jul 24, 2013
Messages
95
i want the whateva unit to attack only when it is attacked by whateva thats attacking em
 
Level 28
Joined
Sep 26, 2009
Messages
2,548
I think acquisition range also affects attack range - if attack range is higher than acquisition range, attack range will be reduced - e.g. if you have 1000 acquisition range and 500 attack range, you will acquire targets at 1000 but attack at 500; however if oyu have acquisition range 100 and attack range 500, you will be able to attack at 100 range only.
 
Level 9
Joined
Apr 23, 2010
Messages
312
Attack range is how far away the unit can be for it to attack another unit, acquisition range is how close an enemy unit has to be before it is attacked.

^That smells like an infinite loop. Have you tested it?

You could store the source and then check it, only order if the source is different.

No I haven't tested it, I didn't have time when I posted my reply to test it. Yeah it would be easy to set a condition for it to not loop, something like "Unit is already attacking = true, then do nothing." or something. I can't use the editor to check at the moment >.<
 
Level 4
Joined
Jul 24, 2013
Messages
95
Assuming the acquisition range is 0 as Doomlord suggested, this is what you're looking for?
  • Self Defense
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Unit - Order (Attacked unit) to Attack (Attacking unit)
ok,iv put a little bit of my magic touch and it work perfectly,thc for guiding me,silly me such simple trigger i can even sort it out..thx 1 rep for ya
 
Status
Not open for further replies.
Top