HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

AIs and Custom Spells

12-31-2007, 05:40 PM#1
Burning Rose
Two Questions about AI editing here.

One: How do you make an AI use a custom ability? Obviously you could do it with a bunch of triggers, but the more abilities you had, the more that would get REALLY annoying. I know that you can edit spells already in their and the com will use it (Like changing a few of the stats on Silence (Neutral Hostile) so that a creep will use it), but when making a lot of abilities for an RPG, it would be nice if the enemies would actually use them, especially when dealing with triggered abilities.

Two: Is there any more (Besides with Triggers) That you can do with the AI editor. I finally figured out how to import custom data into an AI, but it's still not very helpful. For one thing, the abilities for learning will only give you Four, and only allow the computer to level them up for ten levels. The whole editor just seems pretty limited, and I was wondering if there's any tricks or programs that can help you increase the capability.

Thanks for the help you Gurus :P
12-31-2007, 05:48 PM#2
TaintedReality
Quote:
One: How do you make an AI use a custom ability? Obviously you could do it with a bunch of triggers, but the more abilities you had, the more that would get REALLY annoying. I know that you can edit spells already in their and the com will use it (Like changing a few of the stats on Silence (Neutral Hostile) so that a creep will use it), but when making a lot of abilities for an RPG, it would be nice if the enemies would actually use them, especially when dealing with triggered abilities.

I could be wrong on this one, but I'm pretty sure you have to trigger them, at least if you want a solution that's at all reasonable.

Quote:
Two: Is there any more (Besides with Triggers) That you can do with the AI editor. I finally figured out how to import custom data into an AI, but it's still not very helpful. For one thing, the abilities for learning will only give you Four, and only allow the computer to level them up for ten levels. The whole editor just seems pretty limited, and I was wondering if there's any tricks or programs that can help you increase the capability.

Not really :). The AI Editor is extremely limited. You can code the whole AI script yourself (look around the MPQ for the existing AI scripts), or you can use triggers.
12-31-2007, 06:18 PM#3
moyack
1. Base your abilities on those that have the behavior you want to achieve. Example: If you want to make one custom ability which works when the caster is surrounded, then base it on War Stomp. Positive custom abilities must be based on positive abilities and the same with negative abilities (if you want to make an ability that benefits any ally (positive), then base it on one that benefits it). Avoid Channel as much as possible because the AI don't know how to manage it.

2. JASS AI or trigger it.
12-31-2007, 06:20 PM#4
TaintedReality
Guess I was wrong about the first one :).
12-31-2007, 06:34 PM#5
moyack
Quote:
Originally Posted by TaintedReality
Guess I was wrong about the first one :).
Actually, triggering is other option, but if you can put the AI to do the hard work.... much better. Personally I never use Channel unless I don't other option.
12-31-2007, 06:42 PM#6
rain9441
Well I'll mention this again but I do have an Autocast System WiP that is designed to allow you to easily achieve exactly what you are looking for.

By easily, I mean not that easily, but easier than doing it from scratch!

Such features include being able to control all aspects of when the ability is to be used, who (or where) to cast it on, and what conditions/thresholds must be met.

The standard AI won't do what you want it to do, but my Autocast will (or will try ^^).

http://wc3campaigns.net/pastebint.ph...bc5abb981d0386

Not a whole lot has been done to it since then, just bug fixes and tweaks, but you get the general idea of what I am trying to achieve. I designed it while making my Tower Defense map, but it should work for anything.

To give you any sort of one line info on it I'd say.

Yes, it makes "nobody controlled player" units fire off debuffs, buffs, dispels, heals, AOE's on enemies, allies, areas with dense populations of enemy units, etc, while maintaining its current order, channel states, prioritizing certain enemies (higher level or point value or lowest HP etc, custom threat values), and even allows you to use animation canceling to make it just a tidbit more "pro" :P.

Oh yeah, and nothing prevents you from autocasting "attack" either.

All I can say is, I would love to be able to put this out soon, within 2 weeks. But its not going to be something you just put into your map scripts and see magic happen =[.
12-31-2007, 08:18 PM#7
TaintedReality
Sounds very neat rain. Gonna download it and check it out, this could be useful for me. Although actually it sounds like a lot of fun to make so maybe I'll try and make my own system :) (not to try and compete with yours, but just for fun).

Edit: Tried the demo, it seems very effective. Nothing complex, just spams its abilities as fast as its able to, but that's what autocast is supposed to do ^^. Could I see the code via PM? The custom script section just imports the AutocastDemo2Interface.j file, and the war3map.j is all ugly because of the preprocessor.
12-31-2007, 08:37 PM#8
Burning Rose
Quote:
Originally Posted by moyack
1. Base your abilities on those that have the behavior you want to achieve. Example: If you want to make one custom ability which works when the caster is surrounded, then base it on War Stomp. Positive custom abilities must be based on positive abilities and the same with negative abilities (if you want to make an ability that benefits any ally (positive), then base it on one that benefits it). Avoid Channel as much as possible because the AI don't know how to manage it.

Well I've tried that before, and it seems like if it's technically a new ability (I.E., A001 instead of Ahea) that the computer doesn't use it. But if what you're saying works, that would be fantastic!

Oh, and I'll definitely check out that AI thing Rain, Sounds like fun.
12-31-2007, 08:57 PM#9
Pyrogasm
If you based it off of Heal and it didn't work, Burning Rose, you probably forgot to make the unit with the ability turn it on autocast.
12-31-2007, 09:22 PM#10
rain9441
Abilities based on heal = bleah. Heal is a channeled ability that casts only once and continually heals until the unit is full... Very awkward.

Holy Light is a much much better base spell.

I'll see if I can get a rough cut of Autocast up later today or tomorrow, as if now the demos havent been updated with the latest features, and I encountered a few glitches (especially with Neutral Players trying to autocast).
01-01-2008, 10:31 PM#11
Burning Rose
Well, that's not what I meant. I've done a lot of other abilities and they don't seem to work that well, heal was just an example I picked out of a hat.

But I'll try a few more times, When I last tried I was a lot more Noob at editing :P

EDIT: Yeah, tried again with a new Chain Lightning on an enemy Far Seer. This time it was RED!
:D

So I suppose I was wrong, but I'm happy :P