Why won't AI units use base game abilities?

Status
Not open for further replies.
Level 4
Joined
Mar 10, 2021
Messages
26
I've seen the AI use abilities before but I've fiddled with this unit for awhile now, what are the rules on how AI uses its abilities? How can I get the AI to do its job without forcing it with a bunch of triggers?

EDIT: Upon further testing my question is: why won't units use Curse? It was on the list of abilities the AI will use, does anyone know how when or why?
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
 
Level 28
Joined
Dec 3, 2020
Messages
968
Have you assigned a Computer player as the owner of the unit(s)?
Like going to the Player Properties thingy.

The AI should cast spells such as Curse if you have done that.

Also, just in case, make multiple forces. For example:
Force 1 contains Player Red (you for example)
Force 2 contains Player Blue (computer player)

And make each player in each force Allied (even if there is 1 player per Force)
 
Last edited:
Level 4
Joined
Mar 10, 2021
Messages
26
Yes I read that thank you very much for linking it, knowing its there is helpful. It was the first thing that came up when I looked up the question. It did not have the answer.

Now what about an ability like Cripple? Curse started to work but Cripple refuses too.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
The hard-coded tactical AI used by the AI to cast the standard abilities has very specific cast conditions. I think the cast condition for curse was that the unit auto attacks. It is also possible that it relied fully on the auto cast mechanics of curse.

You might need to experiment around a bit to find the exact cast conditions for the abilities. Some might require more than 1 possible victim unit to be cast, or a victim unit that meets specific requirements.
 
Level 5
Joined
Mar 18, 2023
Messages
52
Yes I read that thank you very much for linking it, knowing its there is helpful. It was the first thing that came up when I looked up the question. It did not have the answer.

Now what about an ability like Cripple? Curse started to work but Cripple refuses too.
From my testing, the AI only uses Curse when they're getting physically attacked. For Cripple, they don't seem to use at all. I had to trigger them to use it. The only time I can get the AI to cast abilities that they normally can't cast is when I used the Unit get Attacked event. Otherwise, if I did something like Create a Spell Dummy Unit for the AI and then immediately order that unit to cast Volcano (they don't know how to use Volcano) under a different event such as a Periodic event, it doesn't work.

Also, know that some of the info from the "Base abilities for custom spells cast by melee-game AI units" thread seems outdated. I've tested the Rain of Fire and Blizzard condition before for around an hour and never got it to work either.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
1. Pick an ability whose cast-logic replicates how you want your other ability to work. Give the AI units this ability.
2. When a unit casts that ability, dummy-cast whatever the actual real ability is.
3. Hope that the real ability's source being a locusted dummy unit doesn't affect AI behavior in some way.
 
Level 28
Joined
Dec 3, 2020
Messages
968
Yes I read that thank you very much for linking it, knowing its there is helpful. It was the first thing that came up when I looked up the question. It did not have the answer.

Now what about an ability like Cripple? Curse started to work but Cripple refuses too.
AI casts Cripple on units such as Abominations, Crypt Fiends, Doom Guards, Knights, Riflemen, Tauren etc...
Basically big units with a lot of hp. I don't know if the unit's level is taken into account but generally make the units be at least level 3.
 
Status
Not open for further replies.
Top