I had a look.
The reason it's not working is that you did not put the AI init code at the end of your Function LevelSetup(). In your code, it appears after function LevelSetup() has already ended... in no man's land, between functions...
function OnAsteroidSelected(id) --select an asteroid to rally at
if GetEmpire(1):OwnsAsteroidID(id) then
selectedid = id
end
end
-- *** INFECTED AI V2 INIT ***
-- BETA VERSION 0.1
-- Author: ANNIKK.EXE [at] GMAIL [dot] COM
Globals.AI.GraceTimer=(99999)
-- Number of times the engine is run per While loop:
numberofiterations = 1
-- Set to 0 for very large maps. (50 asteroids+)
-- Set to 2-4 for small maps for quicker AI response.
metric = {}
for i = 0,200 do
metric = 500
end
-- *** END INFECTED AI INIT ***
function LevelLogic()
It's not inside function Level Setup!
To fix, you need to put the code somewhere like this:
--Rallypoint variables
pointexists = false
pointid = 0
selectedid = 0
--Added DrawBox(textureID, borderradius, left, top, right, bottom, r, g, b, a)
--Rallying button customisation
buttonleft = 950
buttontop = 660
barleft = 1010
bartop = 660
sliderpos = barleft
-- *** INFECTED AI V2 INIT ***
-- BETA VERSION 0.1
-- Author: ANNIKK.EXE [at] GMAIL [dot] COM
Globals.AI.GraceTimer=(99999)
-- Number of times the engine is run per While loop:
numberofiterations = 1
-- Set to 0 for very large maps. (50 asteroids+)
-- Set to 2-4 for small maps for quicker AI response.
metric = {}
for i = 0,200 do
metric = 500
end
-- *** END INFECTED AI INIT ***
end
function ScreenDraw()
DrawBox(0, 0, buttonleft, buttontop, buttonleft+50, buttontop+50, 0, 0, 0, 0.5) -- draws switch for quickrally
DrawBox(0, 0, barleft, bartop, barleft+250, bartop+50, 0, 0, 0, 0.5) -- draws slider BG
Hope this helps! :>