Just stick Globals.AI.GraceTimer=(9999999) at the top of your LevelSetup. That should turn it completely off for all Empires.
If you want the default AI on for some empires (in the example below, it turns the default AI on for empires 2 and 3), then put this code in your LevelSetup
function LevelSetup()
-- roids and stuff created here
for i = 0, math.huge do
if GetAsteroid(i) == nil then
highroidID = i - 1
break
end
end
for i = 0,highroidID do
if GetAsteroid(i).owner == 2 or GetAsteroid(i).owner == 3 then
GetAsteroid(i):SetGraceTime(0)
else
GetAsteroid(i):SetGraceTime(9999999)
end
end
And this OUTSIDE of any other function. Just after LevelLogic is a good place, but I don't think it would have an effect whereever you put it.
OnAsteroidTaken(id, owner)
if GetAsteroid(id).owner == 2 or GetAsteroid(i).owner == 3 then
GetAsteroid(i):SetGraceTime(0)
else
GetAsteroid(i):SetGraceTime(99999)
end
end
Basically, that's a mashup of a few snippets I've learnt from Annikk and also a few I built myself. The LevelSetup block checks a potentially infinite list of asteroids, and as soon as it hits the end of the list, saves the highest ID of the asteroids. Then, it goes through the new, shorter list of asteroids and sets the GraceTimer to 0 (turns the default AI on) for that asteroid's owner - otherwise, it turns it off.
The second bit is called every time an asteroid is captured, and does the same thing as the second FOR loop in LevelSetup.
I think it works, but I haven't tested it.