• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] AI ground target skill help

Status
Not open for further replies.
Level 7
Joined
Oct 6, 2022
Messages
146
Hello since ground targeting skill only just activates when the enemy is more than 2 like blizzard or carrion swarm, does anyone knows how to make an AI cast a ground targeting skill even though the enemy is only just 1 like from dota? Thanks in advance :thumbs_up:
 

Uncle

Warcraft Moderator
Level 66
Joined
Aug 10, 2018
Messages
6,729
i can't follow
Step 1: Create an autocast ability like Curse.

Step 2: Get rid of any unnecessary ability effects like Miss Chance and Mana Cost and set it's Duration to 0.001 (as short as possible).

Step 3: Create a trigger like this:
  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability being cast) Equal to Curse (new)
  • Actions
    • Unit - Order (Casting unit) to Human - Blizzard (Position of (Target unit of ability being cast))
Any unit with the Curse (new) ability will now cast Blizzard on single targets, assuming the caster has the Blizzard ability and enough Mana.

You're basically making the Curse AI (single target) replace the Blizzard AI (aoe). The Curse (new) ability is only there to run the trigger.

Chaosium suggested using a Dummy unit to cast Blizzard but that's not exactly what you want here. Dummy units are super useful though as they can cast any spell you want any number of times when setup properly. But worry about that some other time.
 
Last edited:

Uncle

Warcraft Moderator
Level 66
Joined
Aug 10, 2018
Messages
6,729
thanks, for some reason the hero only cast it once i don't know why
I'd need more information to truly know why but it sounds like either the unit still has the Curse buff so it won't get targeted again or you forgot about the cooldown. It's also possible that the AI interferes in some way.
 
Level 7
Joined
Oct 6, 2022
Messages
146
here are the things that i did, i also tried it in other autocast skills but the result are the same
 

Attachments

  • prblm.PNG
    prblm.PNG
    72.9 KB · Views: 8
  • trgr.PNG
    trgr.PNG
    7.3 KB · Views: 7
Level 7
Joined
Oct 6, 2022
Messages
146
I fixed the problem, the only thing i'm worried about now is how am i gonna hide/remove that auto cast skill if the one who picked the hero is a player and not a computer? thanks in advance
 

Remixer

Map Reviewer
Level 31
Joined
Feb 19, 2011
Messages
1,978
I fixed the problem, the only thing i'm worried about now is how am i gonna hide/remove that auto cast skill if the one who picked the hero is a player and not a computer? thanks in advance
Computers can and will cast abilities that are hidden through the object editor - simply set the Button Location of the dummy casting ability to (0, -11), and actual players cannot use it, but the computer will use it.

Also, you don't need to have an auto-casting ability as the dummy ability, it can be anything that the computer has logic for - for example, Polymorph or for example Shockwave. Attached is a little map I made - note that it is not at all optimized.

Edit: The reason why you might want to use other dummy abilities than, let's say Curse, is that the AI prioritizes different targets or conditions for casting them - what those conditions are exactly depend on the ability and might not be very well known, but for example abilities like Shockwave are not cast at random, while for example Polymorph seems quite random - although AI will not cast it on something that's not attacking them, if there is someone who is attacking them right now.
 

Attachments

  • SimpleAI.w3m
    19.5 KB · Views: 2
Status
Not open for further replies.
Top