| 11-04-2003, 07:23 PM | #1 |
A long time ago back in the days of RoC I made many custom AI scripts for my campaign. Nothing impressive -> just CampaignAttacker stuff and defenders for some missions. They worked until I decided to run them in TFT. One of the AI scripts looks like this: globals player user = Player(0) constant integer DWARVENKNIGHT = 'hC20' constant integer DWARVENRIDER = 'hC35' constant integer DWARVENRANGER = 'hC21' constant integer DWARVENMORTARTEAM = 'hC23' constant integer DWARVENFLYINGMACHINE = 'hC24' constant integer DWARVENVEHICLE = 'hC25' endglobals function main takes nothing returns nothing call CampaignAI(HOUSE,null) call SetReplacements( 1, 1, 1 ) call CampaignDefenderEx( 2,2,2, DWARVENKNIGHT ) call CampaignDefenderEx( 1,1,1, DWARVENRANGER ) // SIGNAL call WaitForSignal() // OFFENSE // WAVE1 2 knights 1 ranger call InitAssaultGroup() call CampaignAttackerEx( 2,2,2, DWARVENKNIGHT ) call CampaignAttackerEx( 1,1,1, DWARVENRANGER ) call SuicideOnPlayerEx(M5,M5,M5,user) // WAVE2 2 riders call InitAssaultGroup() call CampaignAttackerEx( 2,2,2, DWARVENRIDER ) call SuicideOnPlayerEx(M3,M3,M3,user) // WAVE3 2 knights 1 vehicle call InitAssaultGroup() call CampaignAttackerEx( 2,2,2, DWARVENKNIGHT ) call CampaignAttackerEx( 1,1,1, DWARVENVEHICLE ) call SuicideOnPlayerEx(M6,M6,M6,user) // WAVE4 2 knights 2 foalriders 2 mortars call InitAssaultGroup() call CampaignAttackerEx( 2,2,2, DWARVENKNIGHT ) call CampaignAttackerEx( 2,2,2, DWARVENRIDER ) call CampaignAttackerEx( 2,2,2, DWARVENMORTARTEAM ) call SuicideOnPlayerEx(M6,M6,M6,user) //LOOPWAVES loop // WAVE5 3 knights 3 rangers call InitAssaultGroup() call CampaignAttackerEx( 3,3,3, DWARVENKNIGHT ) call CampaignAttackerEx( 3,3,3, DWARVENRANGER ) call SuicideOnPlayerEx(M8,M8,M8,user) // WAVE6 2 knights 1 rider 1 mortar call InitAssaultGroup() call CampaignAttackerEx( 2,2,2, DWARVENKNIGHT ) call CampaignAttackerEx( 1,1,1, DWARVENRIDER ) call CampaignAttackerEx( 1,1,1, DWARVENMORTARTEAM ) call SuicideOnPlayerEx(M5,M5,M5,user) // WAVE7 2 riders call InitAssaultGroup() call CampaignAttackerEx( 2,2,2, DWARVENRIDER ) call SuicideOnPlayerEx(M4,M4,M4,user) endloop endfunction It worked fine but now it doesn't. What am I doing wrong? The constant integers were normally added only in the common.ai but I thought it had something to do with it but it didn't. I run the script with a trigger on map initialization and then I send an AI Command (0,0). The computer has 3000 gold and lumber given before the "Run AI Script" function. I even imported the AI script into the map but it still didn't work. Somebody help. Please. Martinez |
| 11-04-2003, 08:00 PM | #2 |
Have you checked your script with the syntax checker? You might have used something that Blizzard changed the name or changed a parameter or something. |
| 11-04-2003, 08:43 PM | #3 |
Thanks for the reply. The syntax checker says that it hasn't found any errors. I also tried puting the AI as Scripts\Dwarven.ai and run it with the trigger "run AI script" without the "Scripts\" just "Run Campaign AI Script: Dwarven.ai" but it still doesn't work. :( Martinez |
| 11-05-2003, 04:33 AM | #4 |
Have you asured that the player you start the script on is a computer and that he can build DWARVENKNIGHTs? Play that player yourself and look if you can build them. Also maybe the 4-letter-codes are no more correct. |
| 11-05-2003, 06:41 PM | #5 |
I've checked the last mission in Blizzard's campaign and the AI there didn't work LOL. Looks like it's something I've added to the War3Patch.mpq that ****s up the AI. At least now I know where to start searching :D Martinez |
| 11-05-2003, 07:22 PM | #6 |
In that case you probably added an old common.ai . They did rename a native there. TownThreated -> TownThreatened |
