HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

AI - supporting hero abilities

04-29-2006, 09:52 PM#1
Doomhammer
how can I tell my triggered AI heroes to efficiently use abilities like Tranquility, Voodoo, Immolation, (and others), especially when surrounded by a large amount of friendly/enemy units? I triggered the learning, which works fine, and the heroes make good use of abilities like mana burn and chain lightning.
04-29-2006, 10:29 PM#2
FatalError
Two ways you could do this:

1. Make a custom AI script.
2. Use triggers for each ability. For example, for immolation, make a trigger that activates it whenever there are x (4? 5?) or more units around him.

I recommend the first option because it is more flexible, it doesn't lag, and you don't have to make a trigger for each ability. However, the drawback is that it is (in my opinion) harder, but if you know JASS well enough it shouldn't be at all hard.
04-29-2006, 11:03 PM#3
Doomhammer
So far I excluded 1. since the AI script messes up the game play (which is in a zone control map quite different to a normal melee game)
another downside was that those scripts pumped up my map size a lot. Only a few k's you might say, but my map is just about 300k, and it should really stay neat and efficient. So, if I knew it was possible to downsize AI scripts to the mere fragments necessary to my needs, I'd definitely go for it. Yet, I'm not sure about it at all.
04-30-2006, 01:13 AM#4
Mystic Prophet
I triggered ai for the heroes in my map. The only problem I've encountered is that it doesn't seem to work on computer units. it will work on user controlled units and nuetral hostile units though.

and for efficiency that just depends on what conditions you set. for my heroes I made them cast spells when they're attacked and heal when they're attacked with low life.
04-30-2006, 01:39 AM#5
FatalError
Quote:
Originally Posted by Mystic Prophet
and for efficiency that just depends on what conditions you set. for my heroes I made them cast spells when they're attacked and heal when they're attacked with low life.
Yeah, you could do that, but you'd have to write a lot of functions (depending on how many spells your hero(es) have).

@Doomhammer: As for the trigger, do something like this:
Trigger:
HeroSpells
Collapse Events:
Unit - A unit is attacked
Collapse Conditions:
Type of (Attacking Unit) Equal to Hero
Collapse Actions:
Unit - Issue order to Attacking Unit - Cast "Voodoo" at target (Location of (Attacked Unit))
I'm not sure exactly how it would look (especially that Issue Order thing...don't know what that looks like in the GUI), but this should get you started. Also, that last line will leak, but I'm too lazy to fix it. :P If you know JASS this will be a lot easier, because I don't use the GUI anymore.
04-30-2006, 02:15 AM#6
xXx-Tricky-xXx
well if you dont mind me asking an AI question of my own on ur topic else Ill remove it:

Im also having a trouble with AI, I have this ability that everyone uses that is 100% triggered, it just has a channel-ability. Just a point target ability that when casted it shoots a bullet where you aimed. Problem is, I cant seem to get computer units to use the ability to like shoot enemies with it. I dont know how, nothing about AI either, but using triggers is inefficient. Is there anything I can do, and is there a lil tut or something for AI. Because I have the feeling ill need to learn because my map is sort of a global war map that required two pc forces to consantly be attacking and pursuing positions ect while at the same time strategically attacking and using there abilities.
04-30-2006, 02:26 AM#7
illlusion
Just add the ability also to "Default Active Ability" in object editor. Then computer will use it automaticly when conditon is satisfied. for example, if you add a "thunder clap", the computer will cast it by self when surrounded by a large portion of enemy. No need the trigger or scripts, except you want it to be cast on specail occasion.
04-30-2006, 02:46 AM#8
xXx-Tricky-xXx
how can i change for when the conditions are satisfied.
Like i may want a certain ability to be used when a unit is within a certain range, or a different type of unit being stationary and sniping people.
04-30-2006, 03:01 AM#9
illlusion
then use the trigger and script =P, as I had said "except you want it to be cast on specail occasion"
04-30-2006, 11:13 AM#10
Doomhammer
Quote:
Originally Posted by illlusion
Just add the ability also to "Default Active Ability" in object editor. Then computer will use it automaticly when conditon is satisfied. for example, if you add a "thunder clap", the computer will cast it by self when surrounded by a large portion of enemy. No need the trigger or scripts, except you want it to be cast on specail occasion.

Are you saying that all I have to do is add the hero abilities in the object editor to "Default Active Ability" , and it will work? as simple as that?
04-30-2006, 05:41 PM#11
FatalError
Quote:
Originally Posted by Doomhammer
Are you saying that all I have to do is add the hero abilities in the object editor to "Default Active Ability" , and it will work? as simple as that?
Just think of that as turning on auto-casting. Of course, this wouldn't give you any control over the conditions (the game decides when to use it), but if you want something simple, go with that.
05-01-2006, 07:48 PM#12
Doomhammer
simple, yes. BUT: including the Ultimate Ability, your usual hero has 3 active abilities. Yet you can only place 1 into Default Active Ability.
I most probably HAVE to go with AI scripts here. And there's absolutely NOTHING around to get into the details of AI scripts. argh!