HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Questions about the original .ai files.....

04-03-2003, 12:47 PM#1
Wakeman
I'm writing a new type of altered melee game. In the game the players divide into attackers and defenders. The main frame of the game is already finished. However, I was stuck on the AI part.

The AI looks acceptable for defending computer players, but terrible for attackers. They are supposed to continuously attack move to the defenders' bases at the top of the map. However, despite I used "order unit to attack move", the attackers tend to move back to the bottom of the map. I'm not sure the reason. Maybe because the "guarding position" is there. But no different after adding "ignore guard position". I tried using "melee game: run melee AI script", "AI-start melee AI", "AI-start campaign AI". None of them works.

So anyone know what's going wrong?
I tried human.ai, orc.ai, undead.ai and elf.ai. Is there other pre-existing .ai more suitable for my game?

BTW, what are the difference between melee AI and campaign AI?

Thanks in advance!
04-03-2003, 03:27 PM#2
PitzerMike
If you can remember a mission from original WC where the ai attacked constantly you could use this map's ai.

Anyway it should be a campaign ai if it has got all the necessary buildings from the beginning and the money comes from triggers. If it should build it's base itself you should use some sort of melee ai.
04-03-2003, 11:34 PM#3
Wakeman
Thanks, so there is still hope! :gsmile:

I finished the campaigns months ago...... can't quite remember much about it. ://// Anyone have suggestion for each races?
04-04-2003, 01:59 PM#4
PitzerMike
Well, you could still write your own ai script if you know jass.
04-04-2003, 10:47 PM#5
Wakeman
I asked because I don't want to use new .ai, for I'm lazy ....... I mean I don't want my map to be that complicated at this moment.

Anyway, I solved the problem! It turned out that what I need to do is to put a town hall for each computer players AT LOCATION THAT THEY CAN TOUCH. So amazing when the 4 computers "ping" the minimap for attack at the same time!

And some how I noticed they have a laughable ritual that their units must repeatedly "touch" the town hall before they attack each time.......which is likely the cause of my original problem!
04-05-2003, 08:36 AM#6
AIAndy
Well, they do not touch the town hall in my AI but the point, where they group is usually in the midst of the peon line so it might look like they try to touch the town hall.
04-05-2003, 09:00 AM#7
Wakeman
My map may have no peon sometimes. Maybe that's why they touch the town hall? emote_confused

Actually I've just realized that the matter is more complicated after 10+ testing and looking into the .ai files. There are at least 2 more conditions need to be satisfied before computer may attack:
1. there must be, for example, 4 or more melee units in orcs. This part is easy to correct.
2. it seems that computer choose a "primary hero" in each game. If unfortunately the hero I given to him is not that "primary hero", it won't attack. So this is the hard part. I can only think of giving the computer an altar and see what it summons..... Can anyone think of a better solution to know who is the primary hero the computer chose?
04-05-2003, 09:17 AM#8
PitzerMike
GetUnitTypeId(hero_id)

then compare which hero type it is,
or you could replace the call PickMeleeHero() in your main function by set hero_id = ARCHMAGE or whatever hero you want
04-05-2003, 09:27 AM#9
Wakeman
Thanks!

Although not exactly understand what you mean, I'll try! :D
04-05-2003, 09:48 AM#10
Wakeman
I guess I now understand what you mean. So both methods require modification of the .ai files, am I correct? The problem is I don't what to change the .ai files directly...... Are there any methods to achieve the same thing using trigger and custom text? Since GetUnitTypeId(hero_id) is not player specific.....
04-05-2003, 10:55 AM#11
PitzerMike
Because the random hero is chosen in the ai script the only 2 ways are:

through the ai script (what I suggested above) or

as you suggested: giving him an altar and looking what he trains first
04-05-2003, 01:45 PM#12
Wakeman
ic.....
Thanks anyway.