• 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.

Spells AI

Status
Not open for further replies.
Level 6
Joined
Jan 7, 2007
Messages
247
Im not sure about this forum to post with this thing but anywayzs...
Well, i need to make creepz use triggered spells and skill. Something like *unit is attacked, attacking unit = skeletal mage, order attacking unit use sparkling discharge on position of attacked unit* etc etc, causes lags and in the end units stop do anything, moving, attacking, casting...
I wonder, if someone know how to make AI spellcasting system that wont cause lags or leakz.
sry for crappy english . -.-
 
Level 6
Joined
Jan 7, 2007
Messages
247
Naaa.. there are no lags. Erm. i mean...
  • Events
    • Unit - An unit is attacked
  • Conditions
    • (Unit-type of (Attacking unit)) equal to Skeletal Mage
    • Number of units in (Units owned by (Random player from (All enemies of (Owned of (Attacking unit)))))) more or equal to 2.
  • Actions
    • Unit - Order (Attacking unit) to Blah blah blah - Ward (Position of (Attacked unit))
This allows unit to use their AOE spellz (Ward is just base for dummies), but only one-two times, after that unit just stops doing anything. Even attacking or moving. Whatzzz the prob? Oo
 
Last edited:
Level 6
Joined
Mar 2, 2006
Messages
306
Ye i know but.. at least i want to know why unitzz get paused.

because you ordered it to stop and cast a spell... and nothing more.
bad solution to your prioblem would be to give your order, wait a second then re-issue attack/move order (you'd need a local variable for the unit)...

good solution is to order your unit to attack-move (=attack in jass) target ground point (enemy base or map corner) and ai will cast the spells by itself, as long as it knows what to do with the spell. your spell see.ms to be ground targeted offensive, so if you base it on inferno or blizzard, ai will cast it when it feels it should (and go on walking forward).
 
Level 6
Joined
Mar 8, 2007
Messages
192
tsssss... this must become more public...

Computer Controlled Units will use Spells automaticly, but they only use the spell it was intented to. So they use Stormbolt on heroes probably, Inner Fire to Buff units etc.
And now dont come and say this does not work, only when you use Channel.

I used that method 3 times now for myself and saw it atleast 4 more times.
 
[trigger="Not always. In my map, I must make my heroes cast spells via a simple trigger"]Events
Unit - A unit is attacked
Conditions
(Unit type of (Attacked unit)) = King Dragon
Actions
Unit - Order (Attacked Unit) to Night Elf Warden - Vengeance[/trigger] And so on. It seems that my king dragon uses shockwave correctly, but never casts vengeance or war stomp by himself.

Likewise, I have no idea why your trigger isn't working. Try removing some stuff from it and perhaps make it look a bit like mine.
 
Level 3
Joined
May 28, 2007
Messages
57
Why in the conditions do you have
  • Number of units in (Units owned by (Random player from (All enemies of (Owned of (Attacking unit)))))) more or equal to 2.
your unit can only attack 1 at a time and it checks the entire map for the units which might take a while try removing this and see if the trigger works than ?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
If the unit is owned by an AI it should auto cast them like it casts their based on spell no matter what, even if doing so is bad. If it is owned by a player, then thats different but since you said creeps they must be AI owned. Just base the spell off of one that the AI casts like you want it to and then be happy.
 
If the unit is owned by an AI it should auto cast them like it casts their based on spell no matter what, even if doing so is bad. If it is owned by a player, then thats different but since you said creeps they must be AI owned. Just base the spell off of one that the AI casts like you want it to and then be happy.

Again, that doesn't always work. Usually it does, but a simple trigger with one event, condition, and action should do the trick.
 
Last edited:
Status
Not open for further replies.
Top