• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Base abilities for custom spells cast by melee-game AI units

I read this entire thread...
...excitedly rubbing my hands together the whole time...
...planning how to use all of this greatness in my current project; 3ICE's Spell Defense...
...only to find out AI is broken currently!?

No...

Edit:

The AI_Test_Map.w3x seems to work fine
. (editor and wc3 both tested)
No crashes on launch, AI stable for over an hour. All spells did autocast.
Memory leaks galore so had to terminate wc3 upon exit. But that's not important.

Can not reproduce your original issue. AI not broken.
Or did you mean learning hero abilities?

+rep to OP for maintaining this guide. Still works today.

p.s.: Some of the units do 0 damage in the map, even though they seem to have a valid attack with non-zero damage. Apparent if attacking my own stuff.

What I was referring to was that the melee AI's heroes don't learn hero abilities. For example the Archamge at lvl 1 does not learn any skill (same is true for all levels and heroes).
I gave myself full unit-control and had an AI ally and i was able to verify that the AI had spare skill points but didn't use them to learn an ability.
This happens in ordinary melee games VS the AI and also in melee games VS AMAI (alternate melee AI)

The units do use all their abilities :)
 
melee AI's heroes don't learn hero abilities
the AI had spare skill points but didn't use them to learn an ability.
Thank you for bringing this to my attention! What a serious regression from old versions' AI. +rep
Level 5 Computer hero, normal melee AI controller. Zero abilities picked in half an hour:
upload_2019-11-2_20-58-12.png

Will compare the source code to see how Blizzard broke it.

Edit: 1.26 AI was learning spells no problem:
upload_2019-11-2_21-20-4.png
= upload_2019-11-2_21-18-46.png (click for full ver)

Now to compare Blizzard.j, common.ai, and common.j across
Warcraft III 1.31\war3.w3mod\scripts vs. Warcraft III 1.26\War3x.mpq\Scripts\
 
Last edited:
Report:
Roar/Howl of Terror does NOT work in latest patch, tried different cases:
(1) have allies to flight against enemies with hero
(2) have allies to flight against enemies without hero
(3) flight alone against enemies with hero
(4) flight alone against enemies without hero

None of them work :(
 
Report:
Roar/Howl of Terror does NOT work in latest patch, tried different cases:
(1) have allies to flight against enemies with hero
(2) have allies to flight against enemies without hero
(3) flight alone against enemies with hero
(4) flight alone against enemies without hero

None of them work :(
So no flying units will trigger the ai into casting the spell?
 
So no flying units will trigger the ai into casting the spell?

Sorry, just tested more, seems like it depends on the player -> if enemy is also a player then it will cast.

However, it will NOT cast if enemy is neutral hostile. <= I tested more, so only very limited spells (around 1/3) will be cast if enemy is neutral hostile
 
Thank you for bringing this to my attention! What a serious regression from old versions' AI. +rep
Level 5 Computer hero, normal melee AI controller. Zero abilities picked in half an hour:
View attachment 336501
Will compare the source code to see how Blizzard broke it.

Edit: 1.26 AI was learning spells no problem:
View attachment 336506 = View attachment 336504 (click for full ver)

Now to compare Blizzard.j, common.ai, and common.j across
Warcraft III 1.31\war3.w3mod\scripts vs. Warcraft III 1.26\War3x.mpq\Scripts\
This is a 1.31 specific bug and there have been several fixes from the community, but yeah, that patch AI is broken
 
Want to contribute something about Finger of Death:
The AI does not use it in Melee Range. Distance to Target has to be atleast 250-300 better more.
Update:
Finger of Death only cast when unit range around 350 or more, and if unit range higher than 350 (mostly ranged unit have 500-600 range) it wouldn't not cast.
 
Guys, how does the AI determine how and when to morph its druids, if it does it at all?
Afaik, AI determines that by AI script, not by ability behavior. If you give them a morph ability they won't use it because they have no behavior associated with morph abilities. If you want them to morph you've to either trigger them to (by using orders) or create a custom AI function to use on your melee or campaign scripts that basically orders them to "Convert" into the desired unit (neither solution is really that quick to implement, you have to add a couple more workarounds like making the AI know that both units are actually the same to prevent them from training more and more of the same unit as it converts them)
 
Afaik, AI determines that by AI script, not by ability behavior. If you give them a morph ability they won't use it because they have no behavior associated with morph abilities. If you want them to morph you've to either trigger them to (by using orders) or create a custom AI function to use on your melee or campaign scripts that basically orders them to "Convert" into the desired unit (neither solution is really that quick to implement, you have to add a couple more workarounds like making the AI know that both units are actually the same to prevent them from training more and more of the same unit as it converts them)
Thank you for the insight.
What do you think a good condition would be for custom Druids to morph into Bears?
 
Thank you for the insight.
What do you think a good condition would be for custom Druids to morph into Bears?
Well, my way to manage AI units into using morphs on my melee maps is by using both solutions together. First, I add the respective conditions in scripts so they can know that both units are the same, and then I use my own AI behavior system to manage morphs in-game so I can have better control about it.
 
Well, my way to manage AI units into using morphs on my melee maps is by using both solutions together. First, I add the respective conditions in scripts so they can know that both units are the same, and then I use my own AI behavior system to manage morphs in-game so I can have better control about it.
I mean, what if I need to use GUI triggers to make it work? Because that's what I got on my hands right now.
 
I mean, what if I need to use GUI triggers to make it work? Because that's what I got on my hands right now.
Yeah, you can surely make it work in GUI too. Either if it's for a melee map or a campaign, you can use the AI editor to create a custom AI script. Let's say you want to create a custom Night Elf script where you want them to have, at least, 2 Bears:

-You create your custom script using the AI editor, there you can add some sort of condition that makes AI know that Druids of the claw and Bears are the same unit (vanilla scripts usually do this by counting how many [Basic unit+Morphed unit] they have, and only training more Druids if that number drops below the desired amount)
-Once you have your custom script ready and running, you can add a GUI trigger that counts how many Druids you currently have (you can make it to trigger after a unit is trained and detect if that unit is a Druid). Then you pick your Druids and make 2 of them (or all) to morph into Bears using triggered orders.
-You now have Druids and Bears in your AI army. After this you can adjust it to your liking or make improvements, like ordering Bears to morph into Druids again if you have not enough Druids or things like that.
 
Yeah, you can surely make it work in GUI too. Either if it's for a melee map or a campaign, you can use the AI editor to create a custom AI script. Let's say you want to create a custom Night Elf script where you want them to have, at least, 2 Bears:

-You create your custom script using the AI editor, there you can add some sort of condition that makes AI know that Druids of the claw and Bears are the same unit (vanilla scripts usually do this by counting how many [Basic unit+Morphed unit] they have, and only training more Druids if that number drops below the desired amount)
-Once you have your custom script ready and running, you can add a GUI trigger that counts how many Druids you currently have (you can make it to trigger after a unit is trained and detect if that unit is a Druid). Then you pick your Druids and make 2 of them (or all) to morph into Bears using triggered orders.
-You now have Druids and Bears in your AI army. After this you can adjust it to your liking or make improvements, like ordering Bears to morph into Druids again if you have not enough Druids or things like that.
Hmmm, well, in my case we're also talking about stationary units in a point of the map where you need to venture into ambushes and stuff. Anyway thank you again. I might have a clue on how to sort this out. ;)
 
Back
Top