HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Getting the computer to actually use abilities

04-09-2003, 01:59 AM#1
BBDino
Im Makign a Castle defence type map and im wondering how you you get the computer controled spawned units to use abilities (i.e raise dead) i asume you have to use AI scripts but im not sure.

any ideas?
04-09-2003, 02:55 AM#2
sheepofdoom
This depends on the ability. If it is a usual ability, like raise dead on a necromancer they will automatically use it, or you can use trigger orders to the unit.

For example:

Event: elapsed time is 2 seconds //or whatever
Action: unit group pick all units in entire map who match condition unit-type equal to necromancer and do :

unit - issue picked unit to stringToOrder("order string")

For the order string you can put the order that is executed when the unit does that ability, for example "avatar" for the Avatar ability. To find out what the order is create the following trigger:

event: (unit) is issued an order with no target
action : game display text message orderToString(issued order)

You can make one of these for the three order types (no target, unit target and point target) to find the order commands, and the use these commands in your trigger.

If i havent been clear enough, or havent answered your question let me know and I'll repost.

Hope this helps,
SheepOfDoom