HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Melee AIs

10-22-2002, 08:55 PM#1
AIAndy
Since the melee AI of Warcraft 3 is so boring I added some more strategies to it. I have now 3 additional strategies / race + original ( so 4 in total per race).
You can find it on my small site and I attach it to this post.
The scripts are not very optimized yet, so you are free to do so and send them back to me. If you have written any melee scripts I'd really like to put them together.
Next I will try to improve the creeping behaviour by adding more creep levels ( not just minor and major) so the AI does not feed its units to too powerful creeps.
10-22-2002, 10:09 PM#2
DKSlayer
I have tweaked the Melee AI for fun but Never enough to warrant anything.
I plan on making A total New AI Instead of working on the already built ones. I will do this after I am done with the Script Editor and The commander.
I might holler for you to help me with things since working on AI by yourself does take time.
You said you were having problems with the I2S function? How is that it works. Just but this around the Value you want to convert.
I2S(NumPeopleAlive) . Works for me what are you doing with it?
10-23-2002, 03:32 AM#3
Guest
Yeah I2S works, but when you call it from within an AI script, it doesn't return anything. There are a few functions like that it seems.
10-23-2002, 03:57 AM#4
DKSlayer
I know if you call it like this
Call I2S()
It won't return anything but I would like to see the code you guys are using that you can't get the IS2 to return anything in your AI.
Thanks
10-23-2002, 03:50 PM#5
Guest
Well, I tried to use it extensively when testing some functions from common.ai... I'd just make a function like this:

function DisplayInt takes string s, integer i returns nothing

local string finalstr

set finalstr = s + I2S(i)
call DisplayTimedTextToPlayer(user,0,0,5,finalstr)
endfunction


Then in my main function I'd do something like this:

call DisplayInt("Attack group HP percent:",CaptainReadinessHP())


It would never return anything at all, I'd usually be left with nothing after "Attack group HP percent:". If I'd try to call I2S() by itself, from the main function, it would usually just print out "(null)"

I know AIAndy has had it print out some weird stuff, but in my case, I've only seen it print out nothing.
10-23-2002, 04:02 PM#6
DKSlayer
When I get home I will test that. I actually think I got it to where you could get it to display both the String and Converted String in the same line without using an integer.
Man I am doing to many langs I would tell you where you have 2 + IS2(i) . Put a & instead of a + but I forgot wrong language. I think I might have an Idea but I'll have to wait till I get home to test it.
10-23-2002, 04:03 PM#7
AIAndy
I just tested I2S again and it is still the same. It returns the name of a function in my AI-Script no matter the value or variable I give it.
10-23-2002, 10:49 PM#8
AIAndy
I did some more testing in the AI and it seems unlike in the map script you can't access functions in blizzard.j . If I try the script is ignored.
Then I tried to use a trigger that is fired when the AI-Player wins. A call to IsTriggerEnabled returns true but the trigger seems never to be fired. I let the AI win but the message I put in the action function is not displayed.

BTW, how do you debug AI Scripts properly?
10-24-2002, 01:19 AM#9
Guest
Trial and error is how I debug them :P
10-24-2002, 08:04 PM#10
AIAndy
I now tested the timer. The handler func I specified did not get called.
I could not test the value of TimerGetElapsed since neither R2S nor R2I work (same like I2S).
Maybe no function in common.j that takes code works properly.
I wonder if that is a bug or intended.
10-25-2002, 04:56 AM#11
DKSlayer
Ok Guys, I started playing with the .AI You can't use blizzard.j or common.j commands it seems in the common.ai and the race specific AI's if so that it does nothing.
We need to get together. Please post either your ICQ or MSN k so we can fix this. It seems since beta days they but a block in their somewhere to stop Jass commmands in .ai files. Not cool.
10-25-2002, 08:17 AM#12
AIAndy
Not all functions in common.j do not work. e.g. you can set up a dialog but there will be no reaction once the buttons are pressed.
DisplayTimed... also work. The gamecache works. It seems that only specific functions do not work properly.
10-25-2002, 03:24 PM#13
DKSlayer
I just discovered that . But heck I can't even use displayTimed txt thing. It sucks the AI refuses to run if their, seems to be any code that it can't recognize. Man I loved the beta days. I am going to check some old beta AI's to see if I can find some stuff. Also AIANdy I see what you mean about the Tab that bothers me I will fix the Tab length real quick but the other stuff will have to wait a bit. PM me the easier we can chat k.
10-26-2002, 04:22 PM#14
AIAndy
I sent you a private message (don't know if it worked).

BTW, how is your progress with syntax highlighting?

I was wrong with R2I. It works, but R2S does not. The timer works but it does not call the function you passed it after expiring.