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

[Trigger] AI attack issues

Status
Not open for further replies.
Level 11
Joined
Jun 13, 2007
Messages
570
Having a few issues with some AI attack commands:

When A preplaced unit is told to attack a point, when it hits that point it turns around and walks back to its guard position

So i use call RemoveGuardPosition(unit), which is fine, when it hits that location it doesn't return back. But when i use the RemoveGuardPosition(), the unit seems to lose its AI completely and no longer auto uses it's abilities or do anything besides auto attack units that come near it.

Is there a different way that I am overlooking to make a unit attack a given location and not return to its guard position...
 
Level 11
Joined
Jun 13, 2007
Messages
570
Code:
  call RemoveGuardPosition(udg_quest_TakingBackLugardEGuards[1])
  set l = GetRectCenter(gg_rct_QuestTakingBackLugardP03)
  call IssuePointOrderLocBJ(udg_quest_TakingBackLugardEGuards[1], "attack", l)
  call RemoveLocation(l)

this is an example of the code i use. If i remove the first line (RemoveGuardPosition), when he hits the location, he just turns around and walks back to the starting point.

And when I use that function, the AI stops attempting to use his abilities (one which is important, the heal)
 
Level 6
Joined
Mar 2, 2006
Messages
306
my ai units always cast spells when on stop/attack orders, but i never used preplaced units. so try this: delete those guards of yours, create them on map init and assign them to variables; then try the order thingy...
 
Status
Not open for further replies.
Top