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

Heroes always get targeted first :(

Status
Not open for further replies.
Level 3
Joined
Mar 9, 2016
Messages
45
Hey. I have a map with some heroes and some basic creep waves and towers and stuff and its working well. Except that creeps and towers shift their targets to my heroes as soon as they heroes get in range. I can't seem to fix it. The "Stats - Priority" field in the data editor does do sh*t it seems. I've tried setting all the creeps' priorities to 1 and the heroes' to 20 (max), and vice versa. Neither works. Do you know if its possible to fix this in some easy way? Thanks! :)
 
Level 12
Joined
Nov 3, 2013
Messages
989
The priority field on the unit stats tab is only about the order in which you see the unit/hero portrait in your control groups. You probably want your hero and spell casters first and your normal melee units without any active abilities last, to make the microing of castable spells easier.

Make a custom AI and untick the "hero target priority" (or whatever it was called) option in the general tab.

I'm not sure whether this completely solves it or not but it should at least help. And I'm not sure how this would work for non AI players.

Picture of what I'm talking about: http://puu.sh/nJG1A/ac85d154ab.png

hmm, i know this problem, but i don't know too much about AI behaviour. However, you could try this:
  • AI - Ignore Unit's guard position

While this is useful afaik all this does is prevent the unit from returning to it's spawn point. (very useful for Dota/moba/AoS maps)
 
Level 3
Joined
Mar 9, 2016
Messages
45
hmm, i know this problem, but i don't know too much about AI behaviour. However, you could try this:
  • AI - Ignore Unit's guard position

nop :( but as always, thanks for getting involved :)

The priority field on the unit stats tab is only about the order in which you see the unit/hero portrait in your control groups. You probably want your hero and spell casters first and your normal melee units without any active abilities last, to make the microing of castable spells easier.

Make a custom AI and untick the "hero target priority" (or whatever it was called) option in the general tab.

I'm not sure whether this completely solves it or not but it should at least help. And I'm not sure how this would work for non AI players.

Picture of what I'm talking about: http://puu.sh/nJG1A/ac85d154ab.png



While this is useful afaik all this does is prevent the unit from returning to it's spawn point. (very useful for Dota/moba/AoS maps)
I read somewhere yesterday that custom AI's only work for Melees/Custom melee maps. Also, I did try making a custom AI yesterday, checking of that field youre talking about, but it doesnt save to the map, it saves as its own script file or smth (i know nothing of coding :p). Then you need to import the script, but it doesnt show in the file list... I dunno, it seems a mess :p

But if it is useful as you say (I AM making a dota-style map) I'd want to look into it. Do you know how to implement the AI? (import it and all that?)

THANKS

You have to make the player slot empty (NO AI) then set the ally properties using trigger at the start of the game, that's probably how Dota did it but I done my own research ;)

You are a HERO. Thank you so much :D

I really love how active and helpful this community is, even this long after SCII has come out!!
 
Last edited by a moderator:
But if it is useful as you say (I AM making a dota-style map) I'd want to look into it. Do you know how to implement the AI? (import it and all that?
THANKS

Don't use the custom AI editor. Use triggers to create your AI.

I fix could be:
  • Events
    • An unit is ordered to attack an unit
  • Conditions
    • Target unit of issued order is Hero equal to true.
  • Actions
    • Issue order to (triggering unit) to attack random unit in group.
(This is what i could produce out from memory).
But you should just rather just remove the "Melee AI" action from the "Initialization" Trigger.
 
Level 12
Joined
Nov 3, 2013
Messages
989
You have to make the player slot empty (NO AI) then set the ally properties using trigger at the start of the game, that's probably how Dota did it but I done my own research ;)

You are a HERO. Thank you so much :D

So in other words this worked? Afaik this only affected the starting locations for Melee maps.

It would be nice if it does work however since that means you don't have to go the roundabout way of importing basically empty AI scripts or adding the common.ai functions for triggering.
 
Level 15
Joined
Aug 14, 2007
Messages
936
I will elaborate since op already stated it is solved, the computer AI slot at the team selection will force all owned towers to attack hero as seen in standard games, unless you play only custom games you might forgot but by making it that it doesnt appear in the team selection means that it will not have AI. Attack-Move AI still works with acquire range and therefore towers will attack only those that are dangerous (Is attacking the tower) to it and then next by range (closest targets first). Since it has no team you have to set the ally options via Player actions when the game start.
 
Level 3
Joined
Mar 9, 2016
Messages
45
So in other words this worked? Afaik this only affected the starting locations for Melee maps.

It would be nice if it does work however since that means you don't have to go the roundabout way of importing basically empty AI scripts or adding the common.ai functions for triggering.
Yep. It works. So far at least. The_Silent's suggestion seems like a simple enough solution too, though. I was thinking how to solve it with triggers, but somehow that method didn't occur to me. Destiny.Knight's way seems slightly more water-proof thou :)
 
Status
Not open for further replies.
Top