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

[Trigger] Unit only attacks specific unit

Status
Not open for further replies.
Level 10
Joined
Jun 16, 2007
Messages
415
Hi, how can I do, that a unit only attacks certain types of units?
Alright more detail:
I am Player 3
I build buildings
Buildings spawn units for Player 1 (NPC)
Units move and attack to base of Player 7 (Human Opponent of me)
Now I want to make a special unit called Witch-hunter.
It's supposed to only attack units like healers, mages and other of those.
but now how can i do that?
It has to be not able to attack any other units before all magicians are dead near it, and it has to move on after that to the enemy base...
Please help!
 
Level 6
Joined
Feb 25, 2005
Messages
230
I guess you could use a specific "stats -unit classification" for the spellcasters, and allow the Witch-hunter to only attack those with "combat - attack1 - targets allowed"

For example, have all the spellcasters marked as "ancient", and the Witch-hunters "combat - attack1 - targets allowed" (maybe attack2 aswell i dunno) set to ancients only.

If the witch-hunters belong to a cpu player then this would do the trick. But if a human player has a witch-hunter, and the forces hiim to attack a unit witch is not an ancient, a message will say "Can only target ancients", which doesnt sound so good. To fix that, you can do this:

World Editor --> Advanced --> Game Interface --> Text - Message - 'Unable to target Ancients' --> [set the text here to: "Can only target spellcasters"] --> then press ok
 
Level 6
Joined
Feb 25, 2005
Messages
230
True. You'll have to check your spells to be able to target ancients and so on. I dont know if there's some things you cant fix, like if they always take reduced to spells. Maybe you can choose another classification that better suits your map. Anyway you'll just have to test it out and see how it works.
 
Status
Not open for further replies.
Top