HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

AI script help

01-29-2003, 05:14 AM#1
Guest
Ok I cannot get my AI to work so I was wondering if you guys know whats wrong here it is:

//============================================================================
// Campagin 01 -- darkgreen player -- AI Script
//============================================================================
globals
player user = Player(1)
endglobals
//============================================================================
// main
//============================================================================
function main takes nothing returns nothing

call CampaignAI(ZIGGURAT_1,null)

call SetBuildUnit( 1, NECROPOLIS_1 )
call SetBuildUnit( 1, ACOLYTE )
call SetBuildUnit( 1, UNDEAD_MINE )
call SetBuildUnit( 1, UNDEAD_ALTAR )
call SetBuildUnit( 1, GRAVEYARD )
call SetBuildUnit( 2, CRYPT )
call SetBuildUnit( 5, ACOLYTE )
call SetBuildUnit( 1, LICH )
call SetBuildUnit( 8, ZIGGURAT_1 )
call SetBuildUnit( 8, ZIGGURAT_2 )
call SetBuildUnit( 1, NECROPOLIS_2 )
call SetBuildUnit( 1, SAC_PIT )
call SetBuildUnit( 1, DAMNED_TEMPLE )
call SetBuildUnit( 1, SLAUGHTERHOUSE )
call SetBuildUnit( 1, NECROPOLIS_3 )

call CampaignDefenderEx( 3,3,3, GHOUL )
call CampaignDefenderEx( 2,2,2, NECRO )
call CampaignDefenderEx( 2,2,2, ABOMINATION )
call CampaignDefenderEx( 1,1,1, MEAT_WAGON )
call CampaignDefenderEx( 1,1,1, LICH )

Also can you start ai's in map initialation?
cause that could be my problem but i bet it's my script...
01-29-2003, 05:27 AM#2
Guest
You can start scripts in map init, so that shouldn't be your problem. I don't see any obvious problems with the script either. You should try checking your script using Magnus99's JASS syntax checker (available in this forum).
01-29-2003, 04:05 PM#3
DKSlayer
Question is the player that you want the AI working for not seem to use that script and use the blizzard one. Or do they do nothing?
Also a nice way to do it is change it to like human.ai or whatever race you are using it for and import into the map. But remember not to open the map with WE again or it will delete it again so you will have to import it each time after opening in WE.
DKSlayer
01-29-2003, 09:23 PM#4
Guest
ok in my test map the comp has a acroylite some money and a town hall but it doesn't build any of the buildings or stuff does it need to start with everything first?

Edit: also how many triggs do you need to start an Ai I could of got that wrong... I think the trigg i used was Campaign start ai is this the right / only one i need to use?
01-29-2003, 10:10 PM#5
DKSlayer
Ok it sounds like you are using the undead. So just rename the .ai file undead.ai and import it into the Scripts\ Folder. Than just use the Melee trigger. If it works than you know at least your script has no problems.
From there we can find out about get it working otherways.
DKSlayer
01-30-2003, 01:34 AM#6
Guest
About the Jass syntex checker... How do you use it? when I double click on the .exe it doesn't do anything someone said something about java runtime files but how do i get it to work?
01-30-2003, 06:38 AM#7
PitzerMike
Ensure that:

The player has enough gold and lumber to build all that
the script is correctly imported into the map (Scripts/ folder)
it is called with the action AI- Start melee ai for Player(X): whatever.ai

and in your post

the 'endfunction' at the end of the mainfunction is missing
if you want the variable user to be Player1 this would be Player(0) becaus the computer starts counting from 0 on (but that's not the problem if the variable is not used anywhere in the script)
01-30-2003, 09:26 AM#8
AIAndy
The Java runtime files can be downloaded from the Sun homepage.
01-30-2003, 10:13 PM#9
Guest
So is the Scripts/Folder in my map or in my war3.mpq and if it is in my war3.mpq will it glitch up my game( by that I mean no battle.net or something else glitchy?)

Edit:The Jass syntax Checker says: "Undead.ai",line 34:parse error at or near EOF ,but there isn't even a line 34 to have an error.... in stops at 33 so wtf?
01-31-2003, 04:23 AM#10
magnus99
Did you try PitzerMike's suggestion above? Parse error at EOF means it expected something but reached the end of the file without finding it. In the code snipet you posted above, you are missing the 'endfunction' at the end.
02-01-2003, 08:44 PM#11
Guest
oh I see.. thx

Edit: hmmm didn't work so I think I will try to make sure my triggs are not the problem..
02-01-2003, 11:09 PM#12
Guest
Yay, finaly it works thx guys... I think it was either end function or me changing run Ai trigger so it wasn't in map sturtup..
02-05-2003, 05:55 AM#13
Guest
Ok, Is there anyway too make the AI build units/buildings quicker? after an event? could I make them build quicker with a trigger? or could I put it into the .Ai? Because if I remember correctly the last level of the human campaign the Ai built super fast after you attacked their base.. noticed it in other levels too I think..
02-05-2003, 09:48 PM#14
Guest
Ok, guys Just wondering why is this located in the human part of the Common.ai?

UPG_SENTINEL

Is it sentinel the NE or is it just a human ability named funky?
02-06-2003, 07:02 AM#15
PitzerMike
I guess is the magic defense shield of the towers (or whaterver it is called in English)

but I'm not quite sure