HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

a discussion on how to make AI scripts working

08-18-2002, 10:13 AM#1
Guest
hi there

im working on a solo campaign, and but i'm locked because i dont know how to load AI scripts for computer players... ive made this scripts, but the Start Campaign AI script dont works (and im sure the trigger works).

I think its becauze the program dont founds the file, so where to put the ai files?
08-18-2002, 04:41 PM#2
Guest
Well, seems as if just about anyone has this same problem... i can't wait to see how the Krill guys solved it (or didn't they?)

Personally, I already tried those:

- put the .ai into the directory of the map
- put the .ai into the wc3 main directory
- put the .ai into warcraft3.mpq
- put the .ai into war3patch.mpq

Well... none of those worked, as could be seen on the score screen: the computer player didn't even appear.

Sorry I can't help you, but at least this will save you time :(

Anyone knows the solution?
08-18-2002, 06:47 PM#3
bg77
I got an ai script to work in my map... the only way to do it is to put the .ai file into the map file. here's an example using mpq2k:
mpq2k a mymap.w3m myai.ai script\myai.ai

the script\ part is IMPORTANT because it won't work without it. to run your ai, use campaignai or meleeai, and use myai.ai as the name. if there are ANY errors in your ai script, it will not tell you. the computer will simply sit there and mine. a good way to see if it's working is to put the following in the main function of your ai:

call DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Test")

this assumes you are player 1 when you test your map. if you see the word test, then it is working properly.

Hope this helps.
08-19-2002, 03:03 PM#4
Guest
Thx for the answer... well, it sounds like the right idea, but in practice has some problems.

1) Downloaded mpq2k from this server and proceeded as told. Never before has one program shown me such a variety of error messages :(

2) Tried to do the same with WinMpq. This got even weirder: it told me of an error in mpqcontrol.ocx and after that each and every program refused to load the file (and crashed). I'm pretty glad I had a backup copy...

Now what have I done wrong? Plz?
08-19-2002, 04:04 PM#5
Rio
Extracting the AIs and getting them to work in your map is one thing, actually suiting them to your map is another. No one has made an .ai editing guide yet (to my knowledge), so the AI issue is still a huge gray area. The campaign AIs are lousy substitutions.

I heard RoK uses triggers instead of AI scripts to command the enemy. Of course, this is a much cruder way to do things, but it's better than nothing. It's hypothetically possible for someone to create a trigger structure as complex as an AI script, but no one's gotten near doing that yet.
08-19-2002, 04:16 PM#6
bg77
try this:
open regedit and browse to HKEY_CURRENT_USER\Software\Blizzard Entertainment\Warcraft III

Create a new DWORD value called Allow Local Files and set it's value to 1. now goto your war3 directory and create a new directory called scripts. put an ai script in there and see if that works.
08-19-2002, 06:37 PM#7
Guest
@Rio: My problem is not the creation of a working script (I think I have a pretty good understanding of the theory by now) but getting the damn thing to work... :(

@bg77: Sorry to have to say this, but this still didn't work. But now the strange part, which may either be part of the problem or just another facet of the result:

- My Map contains 3 players: Player 2 (i.e. blue, Orc, yourself), Player 4 (purple, Undead, comp) and player 6 (orange, Orc, for rescue)

- When I open the map from within the main WC3, it randomizes the races and sets the colors as it would in melee. The user is red, the computer blue, the frame is nightelf or human or whatever, and the worker icon for player 6 is that of still another race. On the score screen, Player 1 and 2 are shown (with "Computer" for the comp instead of "The Scourge", as written in the player characteristics).

- When I open the map from the editor (i.e. test it), the same randomization process occurs, except the colors remain like devised. On the score screen only player 1 is shown, the comp player (I refrain from calling it "AI") is not.

It seems as if the war3.exe still tries to treat the level as a melee map, whereas the editor has no idea where to put it. If I only why that is...

Oh yeah, I also wonder why all those MPQ-viewers crash when I try to add the .ai to the .w3m?
08-19-2002, 07:54 PM#8
Guest
salid, try to check the "Fixed Players Settings" box in force properties.
And to use mpq2k, copy all files you need (map and scripts) in mpq2k folder and dont use gui program... it works for me like that
I tried to use winMPQ to load ai scripts in map too, and this makes the map crashes too..

i'm testing my modified map now
08-19-2002, 08:15 PM#9
Guest
it dont works :(

see :


and the calls to files:


what's wrong?
08-19-2002, 09:04 PM#10
bg77
looks like mp2k worked correctly. make sure you didn't open your map and resave it after adding the files. it's probably the .ai file, if it has errors, the computer will do nothing but mine gold (if that).
08-19-2002, 09:41 PM#11
Guest
yea but ive put in ai files DisplayTimeTextToPlayer and no text is displayed in game...
r u sure its script/ and not scripts/ (like in war3.mpq)?
08-19-2002, 10:41 PM#12
bg77
bah, it is scripts... stupid typo... if it still doesn't work, i made a test ai that does (just builds a bunch of stuff). you can download it here:
http://www.erie.net/~amgates/files/test.ai