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

On which abilities should I base my scripted custom abilities?

Macielos

Hosted Project: W3E
Level 18
Joined
Jul 9, 2010
Messages
224
I've already made quite a lot of LUA-based custom abilities that need a "dummy" ability that upon casting on target or location run my script magic. At first I based them on Channel ability like the ones made by e.g. @chopinski . But I ran onto a problem: Heroes controlled by AI or simply computer player do not use these abilities at all. Most basic abilities probably have their use condition hardcoded (e.g. cast Holy Light when ally has less than X% health), but Channel most likely doesn't. Also I can't order using these abilities against particular targets via triggers (Channel is only available in "no target" ability order), although perhaps it's doable via script with custom order id.

So now I'm trying to use some vanilla abilities as base and while abilities cast around player work great based on Fan of Knives and for ones against groups of targets I use Carrion Swarm, with those against a single enemy I'm hitting the wall. Some have hardcoded behaviours that can't be disabled while others e.g. Shadowstrike or Stormbolt retain their original graphical effect and sound even though I removed every effect and buff from my custom ability based on them (I think it worked before Reforged). Finger of Death doesn't have this problem and can be easily turned into "dummy", but AI isn't using it either.

Reforged of course.

So, how else can I approach this? How the hell can I make script-based abilities usable by AI without a bunch of ugly hacks?
 

Antares

Spell Reviewer
Level 22
Joined
Dec 13, 2009
Messages
523
You can order units to use abilities based on Channel against targets. That shouldn't be a problem. You have to set the order id of the channel ability to a base ability that has the same targeting mode, such as stormbolt for unit-targeted, stampede for point-targeted etc. to avoid potential bugs.

As for the abilities the AI will use, here someone made a list. Hope this will help.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
You would change the Base Order Id of Channel to be different for each Ability, then you can reference that in your IssueOrder functions.

If a custom ability retains it's original art then try modifying the base ability, sometimes the ability is setup to get it's data from that instead of the new copy.

Creating your own basic spellcasting AI is actually pretty simple, I showcase a GUI implementation in the map I attached here:
Of course it could be expanded to great lengths with the help of Lua.
 
Last edited:

Macielos

Hosted Project: W3E
Level 18
Joined
Jul 9, 2010
Messages
224
Thank you both. This list is exactly what I needed. Also good tip with modifying the base ability, this indeed did the trick.

While I know a lot of mechanics can be implemented by scripts/triggers, my campaign's scale, including its LUA repository, is already massive and I'm trying to simplify stuff whenever I can :p.
 
Top