HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How do i order units to auto cast custom abilities?

01-13-2006, 02:45 PM#1
SmileyJeff
A custom made shockwave for example:
Computer controled units attack each other, but they don't seem to cast their shockwave automatically, why? Do i need AI to do this?? Hope someone can help me..
01-13-2006, 03:00 PM#2
HEZZA
You need to program your own AI, although there are many preset AIs that people have made on this site, which rock, its not hard to use basic triggers to give events of when to cast it.

You could have a set of events, if then elses, conditions of when you would like him to cast it.
E.g number of enemy units around him + his mana and hp equal to....think when would use Shockwave on a multiplayer game? Generaly when a bunch of grouped up enemy units are infront of ur hero. So just trigger that. So easy!
01-13-2006, 03:03 PM#3
Blade.dk
The game will do it itself, in exactly the same situations as it would've casted the base spell in melee. That is hardcoded, so you can't change it, if you want them to cast custom spells at other times, do it by checking and issuing orders.
01-13-2006, 03:04 PM#4
Vexorian
well wc3 already has an AI that can cast spells that are based on 'normal' spells.

But most of the times conditions have to be met, for example in the case of shockwave:
- The unit should have the ability (if it is a hero ability, the unit should have it learned, make sure your computers learn the abilities)
- The unit should have enough mana/cooldown to cast the spell
- Specifically for shockwave it requires the unit to be harassed by many units.


You can always make your own AI

Trigger:
Collapse Events
Unit - A unit is attacked
Collapse Conditions
The unit is the unit that you want to use shockwave
Collapse Actions
Unit - Order (triggering unit) to (Tauren chieftain - Shockwave) targeting (attacking unit)

That will make it cast shockwave on any unit that attacks him as long as he has enough mana and shockwave is not waiting for cooldown.

Edit: Hezza and blade are fast
01-13-2006, 03:10 PM#5
SmileyJeff
okay, thx! :)