Kevin Caccamo
Rear Admiral
The code below is a script function that attempts to create a minefield. I call it at the beginning of a navpoint where I want the minefield.
When I enter the navpoint, it just says "done" and does not create any mines or "minefield" ships. Am I doing something wrong here?
Code:
function minefield()
Mission_setDebugText("minefield function called")
navseq = navseq + 1;
mines = 30;
while mines > 0 do
xpos = math.random(-500,500);
ypos = math.random(-500,500);
zpos = math.random(-500,500);
Mission_addShip("minelayer", "", "", false, "Mine", IFF_ENEMY, xpos, ypos, zpos, "amine", "", "", "");
mines = mines - 1;
Mission_setDebugText("mine created")
end
if mines == 0 then
Mission_setDebugText("done")
end
end
When I enter the navpoint, it just says "done" and does not create any mines or "minefield" ships. Am I doing something wrong here?