I am pretty new to the editor and the forum, I hope this is the right place to ask this question (it may be in data). I am building a Tug Of War game. I have waves of units spawning for each player and attacking the enemy base. To do that until now, I used these steps after a unit was created:
Issue order to unit
Order targeting point
Ability Command: Attack
Target Point: a point in enemy base
This works fine for units that only need to use their auto attacks. Now I am adding units with abilities and I want them to use them (smartly) during the attack. For instance I have a priest (I am using Renee's war3 mod) and I want him to heal allied units and not just use its auto attack. Another example is for a sorceress to use her "polymorph" ability smartly (e.g. only on enemies with more than X life).
I've seen this done in most Tug Of War maps but I have no idea how this is implemented (in data? in triggers? in some AI setting?). For instance, in the Desert Strike mod, the Stalker uses its blink ability after being attacked, the marines use stimpack when they see the enemy, high templar use psionic storm on enemies, etc...
So how can I implement this? Any help will be really appreciated!
Ps: I would like more control on unit behaviors than just issuing some "scan move" which doesn't fully work.
There are lots of fields in there, and for auto cast to work properly a few of them need to be configured. I joined a screen shot of which ones had to be customized for the High Templar - Psi Storm, and here they are in plain text:
(Basic) Ability: Commands + : will have the normal execute and cancel.
Ability: Auto Cast Validators + (High Templar - Psionic Storm U TargetFilters | Psi Storm Test Buff)
Ability: Smart Validators + (Psi Storm Test Buff)
I managed to make the Priest's heal ability and the Ogre Lord's shockwave ability work by configuring the above fields in my map. Afterwards, I just had the units use a "Attack target Point" ability command in my triggers/scripts.
In most cases the "Auto Cast Validators+" will not be needed, since the "Target FIlters+" and "Auto Cast Filters+" already cover a lot of cases.
In the case of the psy-storm there is a "smart validator" which I think isn't related to auto casting. I think it is useful when you select a group of high templars and send a psy-storm, so that only one storm is cast. (A command on regular ability commands, like "Attack", will command all selected units to use their ability).