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

[General] Unit attacking nearest

Status
Not open for further replies.
Level 2
Joined
Dec 5, 2015
Messages
11
So I want "Player 12"'s units to be able to attack the nearest target.

  • Player 12 is computer controlled
  • Player 12 has global vision
  • Player 12's units have max acquisition range
  • Player 12's units prioritize units over buildings

Is there any way to fix this? So that Player 12's units attack the closest thing, rather than prioritizing units specifically...

Thanks in advance ^^
 
Level 19
Joined
Jul 2, 2011
Messages
2,161
turn off your AI.

if their auto acquire targets range is global, then they will automatically acquire the closest target.

unless you need AI for some big reason but then your AI will always fight with the orders you give it
 
Level 2
Joined
Dec 5, 2015
Messages
11
turn off your AI.

if their auto acquire targets range is global, then they will automatically acquire the closest target.

unless you need AI for some big reason but then your AI will always fight with the orders you give it

I don't think I have AI on, how do I check it's off? I don't have the default map initialization trigger anymore, they have global AR but they still prioritize units over structures :\, I just need the "Player 12" units to be "neutrals" pretty much, that spawn every x seconds and attack random players in essence... I'm trying to make a basing kinda defense map with my friends

Sorry for lengthy reply >_<
 
Level 2
Joined
Dec 5, 2015
Messages
11
how are you spawning them

if you are using a goblin factory spell, then it won't work.

I'm using a trigger like so

  • For each (Integer A) from 1 to 30, do (Actions)
    • Loop - Actions
      • Unit - Create 1 Female for Player 12 (Brown) at (Random point in (Playable map area)) facing Default building facing degrees
      • AI - Ignore (Last created unit)'s guard position
      • Unit - Set (Last created unit) acquisition range to 1000000000.00
 
Level 19
Joined
Jul 2, 2011
Messages
2,161
sorry for the double post, my phones a bit dodgy.

your setting for acquired range may be too high, if it's too high it sometimes starTs counting at 1 again.

you need to look for a trig that triggers at map initialization, this trig may have a AI trigger setup. delete it.

I think disable your AI ignoring guard position, for now. it can cause problems during lan.

you will also need to look into making temporary points, because calling out a point to create units can cause your game to slow down later on
 
Level 2
Joined
Dec 5, 2015
Messages
11
Hmm nothing seems to fix it so yeah... But thanks anyway! And yeah, I plan to fix that later to prevent memory leaks :D, thanks for your help, have a good day :)
 
Status
Not open for further replies.
Top