Making the AI cast custom spells

Ratata

Member
Reaction score
0
So as the title suggest i've had trouble of making AI cast custom spells.The custom spell im using for my map is "Ancestral Spirit".Pretty much the shame thing just a diffrent name and less mana cost,so if anyone knows how to make the AI cast it using triggers i could use some help,this is as far as i got but it doesn't work:
Events
Unit-A unit dies
Conditions
(Unit type of(Dying unit)) equal to tauren
Action
Unit-Order (Random unit from (Units owned by player 9 (Gray))) to Orc spirit walker - Ancestral Spirit
 

O.A

Quantum physics rules
Reaction score
29
I think the problem is that you're not specifying the Unit Type that should cast the spell (or the range). This way the game is choosing a random unit from all units (player 9), even ones that do not necessarily have the spell and therefore cannot cast it, like buildings e.g.

Try using the point of the Dying Unit to check if there are units in range that should do the casting, and then order that Unit Type (in range) or one of them directly to cast the spell.

Edit: You might run into a problem where the spell cooldown is still running or they are out of mana and won't cast the spell, so it might be a good idea to order all the valid units in range to cast the spell, and whoever gets there first casts it.
 
Last edited:

Ratata

Member
Reaction score
0
I think the problem is that you're not specifying the Unit Type that should cast the spell (or the range). This way the game is choosing a random unit from all units (player 9), even ones that do not necessarily have the spell and therefore cannot cast it, like buildings e.g.

Try using the point of the Dying Unit to check if there are units in range that should do the casting, and then order that Unit Type (in range) or one of them directly to cast the spell.

Edit: You might run into a problem where the spell cooldown is still running or they are out of mana and won't cast the spell, so it might be a good idea to order all the valid units in range to cast the spell, and whoever gets there first casts it.
Ill try that then ill report back,if i still have problems with this is it ok if i PM you?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top