• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to make Computer use custom hero?

Status
Not open for further replies.
Level 26
Joined
Nov 5, 2010
Messages
1,383
Hi, I'm making a fourth map for my campaign and in it, I made a custom hero for undead. And I know computer won't use that hero, but how do I make it so that he uses it? Do I need to make an AI or just use some triggers?
Thanks
 
Level 9
Joined
Oct 11, 2009
Messages
477
Yes you need triggering for it or an AI editing will do but consumes more memory for your map. For the triggering, set that hero as a Unit-Type into a specific indexed(if many) Unit-Type variable. After that, order that player to train that type of unit. Use movement triggers for the custom hero using the variable set previously as far as I know that default AI's don't control custom hero(es).
 
Level 26
Joined
Nov 5, 2010
Messages
1,383
Yes you need triggering for it or an AI editing will do but consumes more memory for your map. For the triggering, set that hero as a Unit-Type into a specific indexed(if many) Unit-Type variable. After that, order that player to train that type of unit. Use movement triggers for the custom hero using the variable set previously as far as I know that default AI's don't control custom hero(es).

I'm kind of new to world editor so I don't really understand what triggers to use. Can you show me?
 
Level 3
Joined
Oct 5, 2010
Messages
26
if u want the AI to simply use the spells of the hero and attack your units with it, then just use the AI editor to modify the skill build of the hero which the AI uses, and the AI is smart enough on it's own to use it to attack you. However, if you need the hero to function like in an RPG (i.e. DotA) with advanced micromanaging like running, ganking and so forth, then you need triggers and stuff which can be quite complicated whether you use JASS or not


go read some trigger tutorials, and basically for an AI trigger it is like this:

for a simple escape mechanism
Event: unit is attacked
Action: Order "triggering unit" to "move to (fountain of healing)"

or to make it flee only when it is low health
event: unit health falls below 200
action: Order "triggering unit" to "move to (fountain of healing)"


And so on
 
Level 9
Joined
Oct 11, 2009
Messages
477
Open some unprotected maps through the world editor which has conventional AI's and review its triggers or analyze my method. But I'm sorry I can't create triggers/a test map for you because my Warcraft III on my PC got recently removed.
 
Status
Not open for further replies.
Top