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

Warcraft 3 AI cannot learn Hero spells (fix!)

Status
Not open for further replies.
Level 3
Joined
Apr 1, 2019
Messages
48
Hey all.

Since one of the latest patches, the AI in Warcraft 3 cannot choose Hero spells for their heroes.
In any melee or custom map, it fails the standard AI script and somehow they don't know how to learn a hero spell.
However, if the spell is learnt, they can use it like in the old days.

That was really annoying when I wanted to practice agaisnt AI or similiar occasions.

So I did a kind of "fix".
I did some GUI and jass and it doesn't look very nice, but I made it work and you can easily adjust the settings. I made some triggers which make the AI heroes learn spells via trigger. The order in which they learn them can be adjusted, if you like to do it. I just did write it very fast, so ... no thoughts about the order.

How to use it:
I attached a trigger file to this post ('AI fix triggers.zip').
There are 2 files in it you must have both of them in the same directory!
Just download it, open the map you wanna play with AI in the World Editor. Copy that map or save it with different name to not override it.
Then go to the "Trigger"-Section in the World Editor (it is the 'a'-Symbol).
Then: File -> Import Triggers -> Choose the .wtg file (but make sure the other file is in same directory).
Save map and play or adjust the settings.

This will make a melee map marked as "non melee", because it has triggers. Anyway I did nothing else but make the computer-controlled heroes learn their spells, so they can use it.


Thank you!
PS: I also uploaded a "Secret Valley"-Version, which has this triggers, so you can try out the map first, if you wanna see if it works.
PPS: I hope it is the right section to post this, as that came with patch 1.31
 

Attachments

  • AI fix triggers.zip
    2.6 KB · Views: 176
  • (2)secretvalley - AI fix.w3x
    222 KB · Views: 149
Last edited:
Level 3
Joined
Apr 1, 2019
Messages
48
The JASS trigger in your .wtg file does not contain any lines of code.
This is true.
I just checked my own file and it works when I import that.
Then I reuploaded it and downloaded it from here and it doesn't work.

Thus I just saw, that I have a .wct-File, which only purpose is to add those lines of code.
So I edited the post. Now it contains a zip, extract it, it has 2 files. they need to be in same directory and you can import the .wtg file without any problems.
Should work now, tested it.

PS: Thank you for your help to make this work.
PPS: If it works, you can leave a message, please.
 
Last edited:
Status
Not open for further replies.
Top