• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Unit Aggro Broken Need Help

Status
Not open for further replies.
Level 1
Joined
Apr 12, 2019
Messages
1
Hey Guys,

Really at my wits end so I hope some experienced editor has some insight.

I'm currently almost done creating my first Warcraft III minigame, it's a moba/tug of war style game, everything works fantastically other than one huge issue. Unit aggro is completely broken.

The second any hero approaches an opposite teams basic spawned soldier units, the enemy soldiers will break off of fighting your units and chase the hero unit infinitely until they die, not breaking off for any reason.

Ideally I'd have a system where the enemy units only break off once your are hitting an enemy hero and otherwise will just fight eachother and not aggro you unless you are the closest target, and even then I'd want the units to disaggro once the hero has moved away.

I've tried many things and nothing seems to have any effect, including editing unit priority etc. I really appreciate any help in advance.

Edit: A really weird thing that's also happening is, the second a single footman unit attacks a hero, all the other nearby footman units on that team will proceed to dis-aggro their current fight and gang up on the hero
 
Level 12
Joined
Nov 3, 2013
Messages
989
use "ai - remove (unit)'s guard position" on every unit that you create, that should fix most of those problems (including creep wave units sometimes running back to base)


So if you're creating one unit at a time, do it like this:
  • Actions
    • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
    • AI - Ignore (Last created unit)'s guard position
And when/if you're creating more than one unit at a time, you'll do it like this:
  • Actions
    • Unit - Create 6 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
    • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
      • Loop - Actions
        • AI - Ignore (Picked unit)'s guard position

It could get a bit annoying if you have to add that after each 'create n units', so you could create another trigger with the event "a unit enters (playable map area)", check whether it's a computer-owned player or whatever, and then simply use a single "AI - Ignore (Triggering Unit)'s guard position" and that should also do it.
 
Status
Not open for further replies.
Top