• 🏆 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!

AI and Custom Abilities

Status
Not open for further replies.
Level 7
Joined
May 11, 2010
Messages
278
First, a really short question:
If a move a unit with triggers (the "move unit (instantly)" function), will it interrupt channeled spells?

Second:
If I want a NPC to use a custom ability in combat, without triggers, what do I need to do?
Say I've got a unit based on a Blood Elf Priest (or whatever they're called) with a custom ability based off of Flamestrike and a standard Heal. His AI won't tell him to use flamestrike, but he will use heal. How do I make him use the custom spell?
Do you need to do it differently for toggle abilities (like Heal or Black Arrow)?
Are there differences in what you do for unit-target abilities vs. ground target abilities?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Level 30
Joined
Nov 29, 2012
Messages
6,637
2. Try putting the Heal ability to the Unit in Object Editor in this field: Abilities - Default Active Ability. The unit will maybe cast it but only one spell is allowed here so you will really need to use trigger if the unit has more than one spell.

YOU CANT REALLY AVOID USING TRIGGERS, bro.
 
Level 7
Joined
May 11, 2010
Messages
278
1) Yes.

2) There are different AI behaviours for different base spells. Like Flamestrike won't be cast id there aren't at least three enemies around. Try to choose a similar base spell that the custom spell would be. There was a thread about this, I'll try to find it.

EDIT: http://www.hiveworkshop.com/forums/...ustom-spells-cast-melee-game-ai-units-193280/

1) Excellent.

2) Thanks for the link, I'm sure it'll be useful.

2. Try putting the Heal ability to the Unit in Object Editor in this field: Abilities - Default Active Ability. The unit will maybe cast it but only one spell is allowed here so you will really need to use trigger if the unit has more than one spell.

YOU CANT REALLY AVOID USING TRIGGERS, bro.
I'll try that. Thanks!

Also, I don't mind using triggers to make specific unit cast spells at specific points and such, but for standard melee units, it's kinda silly to trigger their spellcasts.
I could make triggers checking for conditions and forcing the units to cast spells. But when making a big map with many units that's not really a great solution.
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
1) Excellent.

2) Thanks for the link, I'm sure it'll be useful.


I'll try that. Thanks!

Also, I don't mind using triggers to make specific unit cast spells at specific points and such, but for standard melee units, it's kinda silly to trigger their spellcasts.
I could make triggers checking for conditions and forcing the units to cast spells. But when making a big map with many units that's not really a great solution.

If incase Default Active Ability didnt work, you can try triggering it, doesn take much space you know. So there is no risk.
 
Status
Not open for further replies.
Top