HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Issuing Orders to Neutral Hostile Units?

04-25-2009, 09:07 PM#1
JMJM7
Hello again;

I am trying to make the neutral hostile units in my map behave more intelligently. All I would like for them to do is focus fire on heroes whenever any unit classified as a hero happens to be in range. Simple, right?

Well although I have a trigger set up to issue the order to attack the hero, the neutral hostile units will instead give priority to the closest enemy unit that is attacking them. I am not sure why this happens and have messed around with the priority values more than a few times, but nothing seems to work. Is this a default feature of the NH AI? Does anyone have any ideas on how I might work around this?

If you need more information than I would be happy to provide it!
04-26-2009, 02:07 AM#2
Michael Peppers
You have to start an AI script for them, probably.
You'd have to open the AI Editor, tick "Target Heroes" in the first window, then export as an ".ai" file, import it in your map, then...
Trigger:
AI - Start Melee/Campaign AI script for Neutral Hostile: war3mapimported\map.ai
And it should work.
04-26-2009, 02:11 AM#3
Archmage Owenalacaster
The Neutral Hostile Player does not have an AI; there are AI-like behaviors for units, though, for target acquisition and ability/item use. Worker-type units for the player will harvest, for instance.

Make a trigger fire when a unit attacks; check to confirm the triggering player is neutral hostile and the target is hero; if the target is not a hero, enum units in acquisition range (typically 500 for melee, 600 for ranged, around 1000 for long-range siege) and and check if any other units are enemy and a hero; if a hero is detect, issue an order to attack it.

EDIT: Interesting, Mister Peppers. I'dl like to know if that works.
04-26-2009, 12:53 PM#4
JMJM7
I tried both of methods, but unfortunately neither worked :(

I tried to make a more demanding version of Archmage's trigger that forces the creeps to face and play their attack animation whenever a hero is nearby. Because the trigger goes off each time a neutral hostile unit attacks, the NH units are constantly being ordered to attack any nearby heroes with this approach. It seems to work although it looks quite strange sometimes (the creeps will constantly turn to face any unit that attacks them, and so they are constantly moving around.)

It might not be the most elegant solution, but it's the only thing that I could think of : \

Thank you for the screenshot by the way, MP.