Create a new map and set at least one AI player
modify common.ai
Add these two lines of code to the global variable
constant integer AAA = 'oalt' // must be a four digit code and constant --------------
integer array cyxx // must no constant --------------
Add a line of code during initialization
function StandardAI takes code heroes, code peons, code attacks returns nothing
local boolean isNewbie = (MeleeDifficulty() == MELEE_NEWBIE)
call InitAI()
call SetMeleeAI()
set cyxx[AAA] = 1 // must add here -------------- if add last line of this function, it will crash the first time you enter the game but compilation won't report any errors
call SetDefendPlayer(true)
...... // Original code --------------
endfunction
The above two modifications , compilation common.ai won’t report any errors
Implant this modified file into the map
You will find that entering the game like this is normal
Immediately save the game after entering it and load this game save file
The program will crash when loading the map, similar to a self-test failure