-- Standard GCO v2.3 Map File -- Using programmatic placement of battle forces levelDesc = "myTest - rename me!" maxPlayers = 5 player = {} player[0] = { id = 0, name = "North", resources = 0, raceID = 1, startPos = 1, startPoint = {50000, 0, 0}, startAngle = {0, -90, 0}, stackSep = {0, 0, -500}, forces = {}, } player[1] = { id = 1, name = "South", resources = 0, raceID = 1, startPos = 1, startPoint = {-50000, 0, 0}, startAngle = {0, 90, 0}, stackSep = {0, 0, 500}, forces = {}, } player[2] = { id = 2, name = "West", resources = 0, raceID = 1, startPos = 1, startPoint = {0, 0, -50000}, startAngle = {0, 0, 0}, stackSep = {-500, 0, 0}, forces = {}, } player[3] = { id = 3, name = "East", resources = 0, raceID = 1, startPos = 1, startPoint = {0, 0, 50000}, startAngle = {0, 180, 0}, stackSep = {500, 0, 0}, forces = {}, } player[4] = { id = 4, name = "Observer", resources = 0, raceID = 1, startPos = 1, startPoint = {0, 50000, 0}, startAngle = {-90, 0, 0}, stackSep = {0, 0, 500}, forces = {}, } -- ******************************* -- START COMMONLY-MODIFIED SECTION -- Define battle forces for each player -- List per player in the following format: -- {"gco_abbr",,[fighter list, if any]}, -- If you want to give a SINGLE specific ship predocked fighters, make a fighter list: -- {"gco_carrier",1,{{"gco_fightertype1",amount},{"gco_fighter2",amount},[optional more types]}} }, -- NOTE: the carrier MUST be present on that line as a SINGLE quantity, or the fighters will not be added player[0]["forces"] = { {"gco_ven",1,{{"gco_r41",4},{"gco_xw",4},{"gco_clut",4}} }, {"gco_ven",1,{{"gco_r41",4},{"gco_xw",4},{"gco_clut",4}} }, {"gco_ven",1,{{"gco_r41",4},{"gco_xw",4},{"gco_clut",4}} }, {"gco_ven",1,{{"gco_r41",4},{"gco_xw",4},{"gco_clut",4}} }, {"gco_mcrv",12}, } player[1]["forces"] = { {"gco_hsd",1,{{"gco_td",4},{"gco_tf",4}} }, {"gco_hsd",1,{{"gco_td",4},{"gco_tf",4}} }, {"gco_hsd",1,{{"gco_tf",8}} }, {"gco_hsd",1,{{"gco_tf",8}} }, {"gco_lfrg",2}, {"gco_nfrg",5}, {"gco_strk",3}, --{"gco_isd3",1}, } player[2]["forces"] = { } player[3]["forces"] = { } -- END COMMONLY-MODIFIED SECTION -- ***************************** --Utility function function tableSumMult(t1, t2, t2mult) tt = {} for i,k in t1 do tt[i] = t2[i]*t2mult + k end return tt end function DetermChunk() setWorldBoundsInner({0, 0, 0}, {500000, 500000, 500000}) --Set data values by player for pnum,pdata in player do --Starting point for the buoy addPoint("StartPos" .. pnum, tableSumMult(pdata["startPoint"], {0, 10000, 0}, 1), pdata["startAngle"]) --Starting forces curoff = 0 --print("** player" .. pnum .. " forces:") for fnum,fdat in pdata["forces"] do --Add this ship for i=1,fdat[2] do addSquadron(fdat[1]..fnum, fdat[1], tableSumMult(pdata["startPoint"], pdata["stackSep"], curoff), pnum, pdata["startAngle"], 0, 0) curoff = curoff + 1 end --Only continue if there's a fighter entry if ((fdat[3] ~= nil) and (fdat[2] == 1)) then --Create new SOBgroups createSOBGroup("carrier_"..pnum.."_"..fnum) createSOBGroup("fighters_"..pnum.."_"..fnum) --Add carrier SOBgroup print("** Adding squadron " .. fdat[1]..fnum .." to SOBgroup carrier_"..pnum.."_"..fnum) addToSOBGroup(fdat[1]..fnum, "carrier_"..pnum.."_"..fnum) --Add fighters and fighter SOBgroup for finum, fidat in fdat[3] do for i=1,fidat[2] do addSquadron(fidat[1].."_"..fnum.."_"..finum.."_"..i, fidat[1], tableSumMult(pdata["startPoint"], pdata["stackSep"], -(curoff/5+i/5)), pnum, pdata["startAngle"], 0, 0) print("** Adding squadron " .. fidat[1].."_"..fnum.."_"..finum.."_"..i .." to SOBgroup fighters_"..pnum.."_"..fnum) addToSOBGroup(fidat[1].."_"..fnum.."_"..finum.."_"..i, "fighters_"..pnum.."_"..fnum) end end end --print("** " .. fdat[1] .. ": " .. fdat[2]) end end end function NonDetermChunk() fogSetActive(0) setGlareIntensity(0) setLevelShadowColour(0,0,0,1) loadBackground("m15") setSensorsManagerCameraDistances(1000, 300000) setDefaultMusic("Data:sound/music/battle/battle_keeper") end