HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Enemy Abilities

11-19-2008, 07:07 PM#1
myntanis
Hi, i am new here gooday. I was wondering, this may sound noob sorry in advance if i could have fond this info elsewhere, but i feel it is a bit too specific.

Ok, in short how do you get your enemies on a CG to cast spellls? For example, if i want a certain unit which is controlled only by the comp, to cast blizzard on a target, how do you get the comp unit to cast blizzard in the right place, and have it use its mana as a human player would? and for that matter, also friendly CPU units.

Is that clear? If not let me know i'll see if i can clarify this question. HAI!
11-19-2008, 08:06 PM#2
Anopob
What do you mean cast blizzard in the right place? If you want a specific routine (timing-wise, like every 15 seconds cast blizzard on X spot), then you'll have to go through the triggers and go to Unit - Order ... Otherwise, if you're trying to figure out when a cpu WOULD cast blizzard, well then it's their AI that is regular in warcraft and therefore just go to melee game and check it out.
11-19-2008, 08:07 PM#3
Zerzax
Doing this is essentially equivalent to ordering any of your own units to cast a spell by way of GUI or JASS. Don't worry, you posted in the right place. In the Trigger editor there is an action referred to as "Unit - Issue Point Order". If you know the unit whom you want to order to cast blizzard, you can say "Order (the unit) to Human Archmage - Blizzard (target point) in your own custom trigger. Make sense? If you've worked with the trigger editor before, this should make sense, otherwise it will be gibberish.
11-19-2008, 08:38 PM#4
xombie
Trigger:
Untitled Trigger 001
Events
Conditions
Collapse Actions
Unit - Order (Random unit from (Units owned by Neutral Hostile)) to Human Archmage - Blizzard (Position of (Random unit from (Units owned by Player 1 (Red))))

Does this make any sense to you?
11-19-2008, 10:09 PM#5
myntanis
NICE! you guys rule, yea that trigger there makes sense, so would my event be "when unit is in range of X unit" then the action?

For example on this map im trying to make, you have a group of heroes, then an enemy spawn. What event would i give the enemies so that they would try to kill you with abilities i give them? and i mean use them intelligently
11-19-2008, 10:25 PM#6
Zerzax
That's getting into AI - I have no idea how to do that, it would probably go deeper than just a trigger like that. Typically people use scripts in JASS to code their AI.