• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Non-player Units Won't Use Skills

Status
Not open for further replies.
Level 2
Joined
Jun 25, 2008
Messages
6
I'm currently working on an RPG map, but I can't seem to get some of the enemy and neutral units to use skills. I've given the units enough mana to use the skill, but they still won't use it. Can someone please help me with this?

-The neutral unit(s) should use a healing skill on damaged player units when in range.

-The enemy unit(s) should use attack skills on the player because they are jerks (lol).
 
Level 2
Joined
Jun 25, 2008
Messages
6
I'm not sure how to use AI, or turn it on. If you mean that the skills are auto-cast, yes, they are.
 
Level 11
Joined
Aug 16, 2007
Messages
847
You have to use triggers.

you could a make on like
  • Healing
    • Events
      • Unit - A unit is attacked
    • Conditions
      • (Priests within 512 of (Position of (Attacked Unit)) is equal to or greater than 1
    • Actions
      • Unit - Order Random Unit from (Units within 512 of (Position of (Attacked Unit)) matching condition (((Matching Unit) is equal to Priest) is equal to True) to (Priest - Heal) at (Attacked Unit)
Just replace the Event and Attacked to whatever situation you want to use, and Priest to whatever unit it is.

Or alternatively if you make the Priest be controlled by an ally of the player Autocast will work just fine.


for attacking enemies Autocast should work fine.
 
Level 2
Joined
Jun 25, 2008
Messages
6
That's what I did: gave the unit an autocast heal skill, made them controlled by player 2 (set to neutral) and allied with player 1 in forces. Even so, when my character was severely damaged, the healer simply ignored him. Is there something I need to do to make them use autocast?
 
Level 11
Joined
Aug 16, 2007
Messages
847
In Object Editor go to teh unit and make sure that the very first field

which should be labeled "Ability - Normal - Autocast" is equal to the ability you want them to autocast.

Also what do you mean by he's set to neutral? do you mean hes a comp or soemthing?
 
Level 6
Joined
May 13, 2005
Messages
164
  • Heal
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
      • (Number of units in (Units within 370.00 of (Position of Priest 0000 <gen>) matching (((((Matching unit) is alive) Equal to True) and ((Percentage life of (Matching unit)) Less than 100.00)) and ((((Matching unit) is A structure) Equal to False) and (((Owner of (Matching unit)) equal to (Player 1 (Red))) or ((Owner of (Matching unit)) equal to (Player 2 (Blue))) Greater than or equal to 1
    • Actions
      • Animation - Play Priest 0000 <gen>'s spell animation
      • Unit Group - Pick every unit in (Units within 370.00 of (Position of Priest 0000 <gen>) matching (((((Matching unit) is alive) Equal to True) and ((Percentage life of (Matching unit)) Less than 100.00)) and ((((Matching unit) is A structure) Equal to False) and (((Owner of (Matching unit)) equal to (Player 1 (Red))) or ((Owner of (Matching unit)) equal to (Player 2 (Blue))) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to 100.00%

Alternatively you could use this trigger, it does not use any ability. What this trigger does is check whether there is any living units with life below their max. hit points belonging to Player 1 OR 2 within 370 area of the priest and then heals them if there is at least 1 of that unit. Of course, you must modify this trigger to add more players to the action and condition if there is more players and not just Player 1 and 2. You can also add the special effect of the heal through the Special Effect action.
 
Level 2
Joined
Jun 25, 2008
Messages
6
Ardnived: I only see two Ability fields on the units: Ability - Default Active Ability and Ability - Normal. Maybe the first one is "autocast"?

LeviathanReborn: That was my original idea, except you seemed to have posted a slightly better version. However, my map is going to be loaded with triggers and I'd like to have units use skills automatically. Triggers like that would work fine for healing units, but would be more of a pain for hostile monsters.
 
Status
Not open for further replies.
Top