From 10d250e3a55f8445dd4bcd57f39853d1940f80ac Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Thu, 18 May 2023 09:09:20 +0200 Subject: [PATCH] Added basic template spawning --- client/src/units/aircraftdatabase.ts | 2 +- client/src/units/groundunitsdatabase.ts | 18 + client/src/units/unit.ts | 38 +- client/src/units/unitsmanager.ts | 11 +- installer/olympus.iss | 2 +- scripts/OlympusCommand.lua | 79 +- scripts/templates.lua | 1354 +++++++++++++++++++++++ src/core/src/scriptloader.cpp | 1 + 8 files changed, 1467 insertions(+), 38 deletions(-) create mode 100644 scripts/templates.lua diff --git a/client/src/units/aircraftdatabase.ts b/client/src/units/aircraftdatabase.ts index b738b4b6..f2448468 100644 --- a/client/src/units/aircraftdatabase.ts +++ b/client/src/units/aircraftdatabase.ts @@ -322,7 +322,7 @@ export class AircraftDatabase extends UnitDatabase { }, "H-6J": { "name": "H-6J", - "label": "H-6J Badger, + "label": "H-6J Badger", "era": ["Mid Cold War, Late Cold War", "Modern"], "shortLabel": "H6", "loadouts": [ diff --git a/client/src/units/groundunitsdatabase.ts b/client/src/units/groundunitsdatabase.ts index 8610bf91..a880b8d6 100644 --- a/client/src/units/groundunitsdatabase.ts +++ b/client/src/units/groundunitsdatabase.ts @@ -4,6 +4,24 @@ export class GroundUnitsDatabase extends UnitDatabase { constructor() { super(); this.blueprints = { + "SA-2 SAM Battery": { + "name": "SA-2 SAM Battery", + "label": "SA-2 SAM Battery", + "shortLabel": "SA-2 SAM Battery", + "loadouts": [ + { + "fuel": 1, + "items": [ + ], + "roles": [ + "Template" + ], + "code": "", + "name": "Default" + } + ], + "filename": "" + }, "2B11 mortar": { "name": "2B11 mortar", "label": "2B11 mortar", diff --git a/client/src/units/unit.ts b/client/src/units/unit.ts index 35560fc2..5140b021 100644 --- a/client/src/units/unit.ts +++ b/client/src/units/unit.ts @@ -646,27 +646,25 @@ export class Unit extends Marker { } #drawTargets() { - for (let typeIndex in this.getMissionData().targets) { - for (let index in this.getMissionData().targets[typeIndex]) { - var targetData = this.getMissionData().targets[typeIndex][index]; - var target = getUnitsManager().getUnitByID(targetData.object["id_"]) - if (target != null) { - var startLatLng = new LatLng(this.getFlightData().latitude, this.getFlightData().longitude) - var endLatLng = new LatLng(target.getFlightData().latitude, target.getFlightData().longitude) + for (let index in this.getMissionData().targets) { + var targetData = this.getMissionData().targets[index]; + var target = getUnitsManager().getUnitByID(targetData.object["id_"]) + if (target != null) { + var startLatLng = new LatLng(this.getFlightData().latitude, this.getFlightData().longitude) + var endLatLng = new LatLng(target.getFlightData().latitude, target.getFlightData().longitude) - var color; - if (typeIndex === "radar") - color = "#FFFF00"; - else if (typeIndex === "visual") - color = "#FF00FF"; - else if (typeIndex === "rwr") - color = "#00FF00"; - else - color = "#FFFFFF"; - var targetPolyline = new Polyline([startLatLng, endLatLng], { color: color, weight: 3, opacity: 0.4, smoothFactor: 1 }); - targetPolyline.addTo(getMap()); - this.#targetsPolylines.push(targetPolyline) - } + var color; + if (targetData.detectionMethod === "RADAR") + color = "#FFFF00"; + else if (targetData.detectionMethod === "VISUAL") + color = "#FF00FF"; + else if (targetData.detectionMethod === "RWR") + color = "#00FF00"; + else + color = "#FFFFFF"; + var targetPolyline = new Polyline([startLatLng, endLatLng], { color: color, weight: 3, opacity: 0.4, smoothFactor: 1 }); + targetPolyline.addTo(getMap()); + this.#targetsPolylines.push(targetPolyline) } } } diff --git a/client/src/units/unitsmanager.ts b/client/src/units/unitsmanager.ts index d3e5b88d..f5bc6fd8 100644 --- a/client/src/units/unitsmanager.ts +++ b/client/src/units/unitsmanager.ts @@ -62,6 +62,7 @@ export class UnitsManager { } update(data: UnitsData) { + var updatedUnits: Unit[] = []; Object.keys(data.units) .filter((ID: string) => !(ID in this.#units)) .reduce((timeout: number, ID: string) => { @@ -75,7 +76,15 @@ export class UnitsManager { Object.keys(data.units) .filter((ID: string) => ID in this.#units) - .forEach((ID: string) => this.#units[parseInt(ID)]?.setData(data.units[ID])); + .forEach((ID: string) => { + updatedUnits.push(this.#units[parseInt(ID)]); + this.#units[parseInt(ID)]?.setData(data.units[ID]) + }); + + this.getSelectedUnits().forEach((unit: Unit) => { + if (!updatedUnits.includes(unit)) + unit.setData({}) + }); } selectUnit(ID: number, deselectAllUnits: boolean = true) { diff --git a/installer/olympus.iss b/installer/olympus.iss index 32b1c2fa..dfc937f3 100644 --- a/installer/olympus.iss +++ b/installer/olympus.iss @@ -22,7 +22,7 @@ Source: "..\scripts\OlympusHook.lua"; DestDir: "{app}\Scripts\Hooks"; Flags: ign Source: "..\olympus.json"; DestDir: "{app}\Mods\Services\Olympus"; Flags: onlyifdoesntexist Source: "..\scripts\OlympusCommand.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion Source: "..\scripts\unitPayloads.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion -;Source: "..\scripts\OlympusMission.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion +Source: "..\scripts\templates.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion Source: "..\scripts\mist.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion Source: "..\mod\*"; DestDir: "{app}\Mods\Services\Olympus"; Flags: ignoreversion recursesubdirs; Source: "..\bin\*.dll"; DestDir: "{app}\Mods\Services\Olympus\bin"; Flags: ignoreversion; diff --git a/scripts/OlympusCommand.lua b/scripts/OlympusCommand.lua index 80346a9c..68adfc0f 100644 --- a/scripts/OlympusCommand.lua +++ b/scripts/OlympusCommand.lua @@ -232,17 +232,34 @@ end function Olympus.spawnGroundUnit(coalition, unitType, lat, lng) Olympus.debug("Olympus.spawnGroundUnit " .. coalition .. " " .. unitType .. " (" .. lat .. ", " .. lng ..")", 2) local spawnLocation = mist.utils.makeVec3GL(coord.LLtoLO(lat, lng, 0)) - local unitTable = - { - [1] = + + local unitTable = {} + + if Olympus.hasKey(templates, unitType) then + for idx, value in pairs(templates[unitType].units) do + unitTable[#unitTable + 1] = { + ["type"] = value.name, + ["x"] = spawnLocation.x + value.dx, + ["y"] = spawnLocation.z + value.dy, + ["playerCanDrive"] = true, + ["heading"] = 0, + ["skill"] = "High" + } + end + else + unitTable = { - ["type"] = unitType, - ["x"] = spawnLocation.x, - ["y"] = spawnLocation.z, - ["playerCanDrive"] = true, - ["heading"] = 0, - }, - } + [1] = + { + ["type"] = unitType, + ["x"] = spawnLocation.x, + ["y"] = spawnLocation.z, + ["playerCanDrive"] = true, + ["heading"] = 0, + ["skill"] = "High" + }, + } + end local countryID = Olympus.getCountryIDByCoalition(coalition) @@ -475,7 +492,26 @@ function Olympus.isArray(t) end return true end - + +function Olympus.hasValue(tab, val) + for index, value in ipairs(tab) do + if value == val then + return true + end + end + + return false +end + +function Olympus.hasKey(tab, key) + for k, value in pairs(tab) do + if k == key then + return true + end + end + + return false +end function Olympus.setMissionData(arg, time) local missionData = {} @@ -503,14 +539,27 @@ function Olympus.setMissionData(arg, time) if groupName ~= nil then local group = Group.getByName(groupName) if group ~= nil then + -- Get the targets detected by the group controller local controller = group:getController() + local controllerTargets = controller:getDetectedTargets() + for index, unit in pairs(group:getUnits()) do + local unitController = unit:getController() local table = {} table["targets"] = {} - table["targets"]["visual"] = controller:getDetectedTargets(1) - table["targets"]["radar"] = controller:getDetectedTargets(4) - table["targets"]["rwr"] = controller:getDetectedTargets(16) - table["targets"]["other"] = controller:getDetectedTargets(2, 8, 32) + + for i, target in ipairs(controllerTargets) do + for det, enum in pairs(Controller.Detection) do + if target.object ~= nil then + local detected = unitController:isTargetDetected(target.object, enum) + + if detected then + target["detectionMethod"] = det + table["targets"][#table["targets"] + 1] = target + end + end + end + end table["hasTask"] = controller:hasTask() diff --git a/scripts/templates.lua b/scripts/templates.lua new file mode 100644 index 00000000..9c7624b1 --- /dev/null +++ b/scripts/templates.lua @@ -0,0 +1,1354 @@ +templates = +{ + ["NASAMS Bty CJTF Blue"] = + { + ["type"] = "vehicle", + ["name"] = "NASAMS Bty CJTF Blue", + ["country"] = 80, + ["units"] = + { + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "NASAMS_Command_Post", + ["skill"] = "High", + ["heading"] = 6.2765352930821, + }, -- end of [1] + [2] = + { + ["dx"] = -14.042657040991, + ["dy"] = 54.532318175887, + ["name"] = "NASAMS_LN_B", + ["skill"] = "High", + ["heading"] = 2.3561944901923, + }, -- end of [2] + [3] = + { + ["dx"] = 51.255698199675, + ["dy"] = -5.1489742484409, + ["name"] = "NASAMS_LN_B", + ["skill"] = "High", + ["heading"] = 6.2765352930821, + }, -- end of [3] + [4] = + { + ["dx"] = 29.255535502103, + ["dy"] = 55.936583879986, + ["name"] = "NASAMS_LN_C", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [4] + [5] = + { + ["dx"] = 21.063985561486, + ["dy"] = 15.680967029068, + ["name"] = "NASAMS_Radar_MPQ64F1", + ["skill"] = "High", + ["heading"] = 6.2765352930821, + }, -- end of [5] + [6] = + { + ["dx"] = -18.499094251951, + ["dy"] = -14.299637664692, + ["name"] = "M 818", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [6] + [7] = + { + ["dx"] = -7.042956299847, + ["dy"] = -18.311686379602, + ["name"] = "M 818", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [7] + }, -- end of ["units"] + }, -- end of ["NASAMS Bty CJTF Blue"] + ["NASAMS Bty CJTF Red"] = + { + ["type"] = "vehicle", + ["name"] = "NASAMS Bty CJTF Red", + ["country"] = 81, + ["units"] = + { + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "NASAMS_Command_Post", + ["skill"] = "High", + ["heading"] = 6.2765352930821, + }, -- end of [1] + [2] = + { + ["dx"] = -14.042657040991, + ["dy"] = 54.532318175887, + ["name"] = "NASAMS_LN_B", + ["skill"] = "High", + ["heading"] = 2.3561944901923, + }, -- end of [2] + [3] = + { + ["dx"] = 51.255698199675, + ["dy"] = -5.1489742484409, + ["name"] = "NASAMS_LN_B", + ["skill"] = "High", + ["heading"] = 6.2765352930821, + }, -- end of [3] + [4] = + { + ["dx"] = 29.255535502103, + ["dy"] = 55.936583879986, + ["name"] = "NASAMS_LN_C", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [4] + [5] = + { + ["dx"] = 21.063985561486, + ["dy"] = 15.680967029068, + ["name"] = "NASAMS_Radar_MPQ64F1", + ["skill"] = "High", + ["heading"] = 6.2765352930821, + }, -- end of [5] + [6] = + { + ["dx"] = -18.499094251951, + ["dy"] = -14.299637664692, + ["name"] = "M 818", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [6] + [7] = + { + ["dx"] = -7.042956299847, + ["dy"] = -18.311686379602, + ["name"] = "M 818", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [7] + }, -- end of ["units"] + }, -- end of ["NASAMS Bty CJTF Red"] + ["NASAMS Bty USA"] = + { + ["type"] = "vehicle", + ["name"] = "NASAMS Bty USA", + ["country"] = 2, + ["units"] = + { + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "NASAMS_Command_Post", + ["skill"] = "High", + ["heading"] = 6.2765352930821, + }, -- end of [1] + [2] = + { + ["dx"] = -14.042657040991, + ["dy"] = 54.532318175887, + ["name"] = "NASAMS_LN_B", + ["skill"] = "High", + ["heading"] = 2.3561944901923, + }, -- end of [2] + [3] = + { + ["dx"] = 51.255698199675, + ["dy"] = -5.1489742484409, + ["name"] = "NASAMS_LN_B", + ["skill"] = "High", + ["heading"] = 6.2765352930821, + }, -- end of [3] + [4] = + { + ["dx"] = 29.255535502103, + ["dy"] = 55.936583879986, + ["name"] = "NASAMS_LN_C", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [4] + [5] = + { + ["dx"] = 21.063985561486, + ["dy"] = 15.680967029068, + ["name"] = "NASAMS_Radar_MPQ64F1", + ["skill"] = "High", + ["heading"] = 6.2765352930821, + }, -- end of [5] + [6] = + { + ["dx"] = -18.499094251951, + ["dy"] = -14.299637664692, + ["name"] = "M 818", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [6] + [7] = + { + ["dx"] = -10.08824481722, + ["dy"] = -14.611150606768, + ["name"] = "M 818", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [7] + }, -- end of ["units"] + }, -- end of ["NASAMS Bty USA"] + ["BRITISH BOFORS AA BATTERY"] = + { + ["type"] = "vehicle", + ["name"] = "BRITISH BOFORS AA BATTERY", + ["country"] = 4, + ["units"] = + { + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "bofors40", + ["skill"] = "Average", + ["heading"] = 5.6374134839417, + }, -- end of [1] + [2] = + { + ["dx"] = 8.6139882987, + ["dy"] = 8.0418525209971, + ["name"] = "bofors40", + ["skill"] = "Average", + ["heading"] = 5.6374134839417, + }, -- end of [2] + }, -- end of ["units"] + }, -- end of ["BRITISH BOFORS AA BATTERY"] + ["SA-11 SAM Battery"] = + { + ["country"] = 0, + ["type"] = "vehicle", + ["name"] = "SA-11 SAM Battery", + ["units"] = + { + [7] = + { + ["dx"] = 120.44134814, + ["dy"] = -112.000602515, + ["name"] = "ATZ-10", + ["skill"] = "High", + ["heading"] = 2.4958208303519, + }, -- end of [7] + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "SA-11 Buk SR 9S18M1", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [1] + [2] = + { + ["dx"] = 2.6563550499995, + ["dy"] = 100.877549925, + ["name"] = "SA-11 Buk LN 9A310M1", + ["skill"] = "High", + ["heading"] = 4.7123889803847, + }, -- end of [2] + [4] = + { + ["dx"] = -105.82160159, + ["dy"] = 4.8958284879991, + ["name"] = "SA-11 Buk LN 9A310M1", + ["skill"] = "High", + ["heading"] = 0.034906585039887, + }, -- end of [4] + [8] = + { + ["dx"] = 27.63662248, + ["dy"] = 21.425097783998, + ["name"] = "ZiL-131 APA-80", + ["skill"] = "High", + ["heading"] = 1.5882496193148, + }, -- end of [8] + [9] = + { + ["dx"] = 42.172491459991, + ["dy"] = -20.017069267, + ["name"] = "Ural-4320-31", + ["skill"] = "High", + ["heading"] = 0.05235987755983, + }, -- end of [9] + [5] = + { + ["dx"] = 99.169831179999, + ["dy"] = -3.3463691979996, + ["name"] = "SA-11 Buk LN 9A310M1", + ["skill"] = "High", + ["heading"] = 3.1415926535898, + }, -- end of [5] + [10] = + { + ["dx"] = 42.172491459991, + ["dy"] = -28.818736966998, + ["name"] = "Ural-4320-31", + ["skill"] = "High", + ["heading"] = 0.034906585039887, + }, -- end of [10] + [3] = + { + ["dx"] = -3.9905785699957, + ["dy"] = -102.252741427, + ["name"] = "SA-11 Buk LN 9A310M1", + ["skill"] = "High", + ["heading"] = 1.553343034275, + }, -- end of [3] + [6] = + { + ["dx"] = 129.64229952999, + ["dy"] = -104.569064854, + ["name"] = "ATZ-10", + ["skill"] = "High", + ["heading"] = 2.3212879051525, + }, -- end of [6] + [12] = + { + ["dx"] = -13.972843719996, + ["dy"] = -17.667666831003, + ["name"] = "SA-11 Buk CC 9S470M1", + ["skill"] = "High", + ["heading"] = 1.553343034275, + }, -- end of [12] + [11] = + { + ["dx"] = 22.603219309996, + ["dy"] = 21.425097783998, + ["name"] = "Ural-375 PBU", + ["skill"] = "High", + ["heading"] = 1.5882496193148, + }, -- end of [11] + }, -- end of ["units"] + }, -- end of ["SA-11 SAM Battery"] + ["Patriot site"] = + { + ["country"] = 2, + ["type"] = "vehicle", + ["name"] = "Patriot site", + ["units"] = + { + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "Patriot str", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [1] + [2] = + { + ["dx"] = -19.60004352557, + ["dy"] = 9.2644465620397, + ["name"] = "Patriot EPP", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [2] + [4] = + { + ["dx"] = -52.779034586449, + ["dy"] = -20.804649357509, + ["name"] = "Patriot AMG", + ["skill"] = "High", + ["heading"] = 4.7123889803847, + }, -- end of [4] + [8] = + { + ["dx"] = 302.6260036147, + ["dy"] = -119.57223135463, + ["name"] = "Patriot ln", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [8] + [16] = + { + ["dx"] = -81.188374167279, + ["dy"] = -130.70164152705, + ["name"] = "Hummer", + ["skill"] = "High", + ["heading"] = 5.9341194567807, + }, -- end of [16] + [17] = + { + ["dx"] = -95.083442423507, + ["dy"] = -114.72675693111, + ["name"] = "M978 HEMTT Tanker", + ["skill"] = "High", + ["heading"] = 5.9341194567807, + }, -- end of [17] + [9] = + { + ["dx"] = 173.84730488189, + ["dy"] = -29.940192911235, + ["name"] = "Patriot ln", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [9] + [18] = + { + ["dx"] = -55.049316178425, + ["dy"] = -162.07189504143, + ["name"] = "M 818", + ["skill"] = "High", + ["heading"] = 5.9341194567807, + }, -- end of [18] + [5] = + { + ["dx"] = -35.511640445024, + ["dy"] = 16.23725082296, + ["name"] = "Patriot cp", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [5] + [10] = + { + ["dx"] = 287.4638047662, + ["dy"] = 8.9459295797569, + ["name"] = "Patriot ln", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [10] + [20] = + { + ["dx"] = -26.639011004663, + ["dy"] = 25.619801495515, + ["name"] = "M 818", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [20] + [11] = + { + ["dx"] = 101.78340133674, + ["dy"] = 47.897296695373, + ["name"] = "Patriot ln", + ["skill"] = "High", + ["heading"] = 0.3490658503988, + }, -- end of [11] + [3] = + { + ["dx"] = -35.248201985043, + ["dy"] = -0.8707412587828, + ["name"] = "Patriot ECS", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [3] + [6] = + { + ["dx"] = 136.71587389408, + ["dy"] = -115.36026572896, + ["name"] = "Patriot ln", + ["skill"] = "High", + ["heading"] = 5.9341194567807, + }, -- end of [6] + [12] = + { + ["dx"] = 187.95200156058, + ["dy"] = 104.06103102239, + ["name"] = "Patriot ln", + ["skill"] = "High", + ["heading"] = 0.3490658503988, + }, -- end of [12] + [13] = + { + ["dx"] = -31.67915746152, + ["dy"] = 171.21775733319, + ["name"] = "M1097 Avenger", + ["skill"] = "High", + ["heading"] = 5.9341194567807, + }, -- end of [13] + [7] = + { + ["dx"] = 233.22284679177, + ["dy"] = -169.50440608741, + ["name"] = "Patriot ln", + ["skill"] = "High", + ["heading"] = 5.9341194567807, + }, -- end of [7] + [14] = + { + ["dx"] = 46.357670822879, + ["dy"] = -267.34404672193, + ["name"] = "M1097 Avenger", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [14] + [19] = + { + ["dx"] = 139.89969071567, + ["dy"] = -62.41809110227, + ["name"] = "M 818", + ["skill"] = "High", + ["heading"] = 5.9341194567807, + }, -- end of [19] + [15] = + { + ["dx"] = -68.129344288536, + ["dy"] = -146.06991632772, + ["name"] = "Hummer", + ["skill"] = "High", + ["heading"] = 5.9341194567807, + }, -- end of [15] + }, -- end of ["units"] + }, -- end of ["Patriot site"] + ["Rapier SAM Battery Oman"] = + { + ["units"] = + { + [7] = + { + ["dx"] = 36.182838894005, + ["dy"] = 58.774643101002, + ["name"] = "Land_Rover_109_S3", + ["skill"] = "High", + ["heading"] = 4.1364303272266, + }, -- end of [7] + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "rapier_fsa_blindfire_radar", + ["skill"] = "High", + ["heading"] = 0.013157135472537, + }, -- end of [1] + [2] = + { + ["dx"] = -14.178539628003, + ["dy"] = 10.201632172, + ["name"] = "rapier_fsa_optical_tracker_unit", + ["skill"] = "High", + ["heading"] = 3.1590459461097, + }, -- end of [2] + [4] = + { + ["dx"] = -50.662342819996, + ["dy"] = 58.961975773003, + ["name"] = "rapier_fsa_launcher", + ["skill"] = "High", + ["heading"] = 5.7595865315813, + }, -- end of [4] + [8] = + { + ["dx"] = 32.038867964002, + ["dy"] = 61.828095365003, + ["name"] = "Land_Rover_109_S3", + ["skill"] = "High", + ["heading"] = 4.1364303272266, + }, -- end of [8] + [9] = + { + ["dx"] = 22.442303705, + ["dy"] = 69.897933492997, + ["name"] = "Land_Rover_109_S3", + ["skill"] = "High", + ["heading"] = 4.1364303272266, + }, -- end of [9] + [5] = + { + ["dx"] = -54.812159296009, + ["dy"] = -56.368340474997, + ["name"] = "rapier_fsa_launcher", + ["skill"] = "High", + ["heading"] = 0.80285145591739, + }, -- end of [5] + [10] = + { + ["dx"] = 52.758722615996, + ["dy"] = 42.634966846002, + ["name"] = "Land_Rover_109_S3", + ["skill"] = "High", + ["heading"] = 4.1364303272266, + }, -- end of [10] + [3] = + { + ["dx"] = -66.224154607, + ["dy"] = 1.2103631389982, + ["name"] = "rapier_fsa_launcher", + ["skill"] = "High", + ["heading"] = 0.017453292519943, + }, -- end of [3] + [6] = + { + ["dx"] = 49.050959151995, + ["dy"] = 45.906522844001, + ["name"] = "Land_Rover_101_FC", + ["skill"] = "High", + ["heading"] = 4.1364303272266, + }, -- end of [6] + [11] = + { + ["dx"] = 39.890602357991, + ["dy"] = 55.066879637001, + ["name"] = "Land_Rover_101_FC", + ["skill"] = "High", + ["heading"] = 4.1364303272266, + }, -- end of [11] + }, -- end of ["units"] + ["type"] = "vehicle", + ["name"] = "Rapier SAM Battery Oman", + ["country"] = 73, + }, -- end of ["Rapier SAM Battery Oman"] + ["Insurgents mortar crew with car"] = + { + ["country"] = 17, + ["type"] = "vehicle", + ["name"] = "insurgents mortar crew with car", + ["units"] = + { + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "2B11 mortar", + ["skill"] = "Average", + ["heading"] = 2.3091703583438, + }, -- end of [1] + [2] = + { + ["dx"] = -2.0000000010041, + ["dy"] = -3.1428571399883, + ["name"] = "Soldier AK", + ["skill"] = "Average", + ["heading"] = 2.3091703583438, + }, -- end of [2] + [4] = + { + ["dx"] = 4.2857142849971, + ["dy"] = -3.7142857200233, + ["name"] = "VAZ Car", + ["skill"] = "Average", + ["heading"] = 2.3091703583438, + }, -- end of [4] + [3] = + { + ["dx"] = 2.2857142851426, + ["dy"] = 1.7142857114086, + ["name"] = "Soldier AK", + ["skill"] = "Average", + ["heading"] = 2.3091703583438, + }, -- end of [3] + }, -- end of ["units"] + }, -- end of ["insurgents mortar crew with car"] + ["SA-6 SAM Battery"] = + { + ["country"] = 0, + ["type"] = "vehicle", + ["name"] = "SA-6 SAM Battery", + ["units"] = + { + [7] = + { + ["dx"] = 120.44134814, + ["dy"] = -112.000602515, + ["name"] = "ATZ-10", + ["skill"] = "High", + ["heading"] = 2.4958208303519, + }, -- end of [7] + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "Kub 1S91 str", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [1] + [2] = + { + ["dx"] = 2.6563550499995, + ["dy"] = 100.877549925, + ["name"] = "Kub 2P25 ln", + ["skill"] = "High", + ["heading"] = 4.7123889803847, + }, -- end of [2] + [4] = + { + ["dx"] = -105.82160159, + ["dy"] = 4.8958284879991, + ["name"] = "Kub 2P25 ln", + ["skill"] = "High", + ["heading"] = 0.034906585039887, + }, -- end of [4] + [8] = + { + ["dx"] = 25.605996860002, + ["dy"] = 20.019633917, + ["name"] = "ZiL-131 APA-80", + ["skill"] = "High", + ["heading"] = 1.5882496193148, + }, -- end of [8] + [9] = + { + ["dx"] = 42.172491459991, + ["dy"] = -20.017069267, + ["name"] = "Ural-4320-31", + ["skill"] = "High", + ["heading"] = 0.05235987755983, + }, -- end of [9] + [5] = + { + ["dx"] = 99.169831179999, + ["dy"] = -3.3463691979996, + ["name"] = "Kub 2P25 ln", + ["skill"] = "High", + ["heading"] = 3.1415926535898, + }, -- end of [5] + [10] = + { + ["dx"] = 42.172491459991, + ["dy"] = -28.818736966998, + ["name"] = "Ural-4320-31", + ["skill"] = "High", + ["heading"] = 0.034906585039887, + }, -- end of [10] + [3] = + { + ["dx"] = -3.9905785699957, + ["dy"] = -102.252741427, + ["name"] = "Kub 2P25 ln", + ["skill"] = "High", + ["heading"] = 1.553343034275, + }, -- end of [3] + [6] = + { + ["dx"] = 129.64229952999, + ["dy"] = -104.569064854, + ["name"] = "ATZ-10", + ["skill"] = "High", + ["heading"] = 2.3212879051525, + }, -- end of [6] + [11] = + { + ["dx"] = 22.038305519993, + ["dy"] = 20.113878987999, + ["name"] = "Ural-375 PBU", + ["skill"] = "High", + ["heading"] = 1.5882496193148, + }, -- end of [11] + }, -- end of ["units"] + }, -- end of ["SA-6 SAM Battery"] + ["FLAK18 BATTERY"] = + { + ["type"] = "vehicle", + ["name"] = "FLAK18 BATTERY", + ["country"] = 66, + ["units"] = + { + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "flak18", + ["skill"] = "Average", + ["heading"] = 6.261241987952, + }, -- end of [1] + [2] = + { + ["dx"] = -3.8613997810025, + ["dy"] = 54.05821418362, + ["name"] = "flak18", + ["skill"] = "Average", + ["heading"] = 6.261241987952, + }, -- end of [2] + [3] = + { + ["dx"] = -50.700600202996, + ["dy"] = -8.27913509211, + ["name"] = "flak18", + ["skill"] = "Average", + ["heading"] = 6.261241987952, + }, -- end of [3] + [4] = + { + ["dx"] = -42.560838181002, + ["dy"] = 64.09794160531, + ["name"] = "flak18", + ["skill"] = "Average", + ["heading"] = 6.261241987952, + }, -- end of [4] + }, -- end of ["units"] + }, -- end of ["FLAK18 BATTERY"] + ["Rapier SAM Battery UAE"] = + { + ["units"] = + { + [7] = + { + ["dx"] = 36.182838894005, + ["dy"] = 58.774643101002, + ["name"] = "Land_Rover_109_S3", + ["skill"] = "High", + ["heading"] = 4.1364303272266, + }, -- end of [7] + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "rapier_fsa_blindfire_radar", + ["skill"] = "High", + ["heading"] = 0.013157135472537, + }, -- end of [1] + [2] = + { + ["dx"] = -14.178539628003, + ["dy"] = 10.201632172, + ["name"] = "rapier_fsa_optical_tracker_unit", + ["skill"] = "High", + ["heading"] = 3.1590459461097, + }, -- end of [2] + [4] = + { + ["dx"] = -50.662342819996, + ["dy"] = 58.961975773003, + ["name"] = "rapier_fsa_launcher", + ["skill"] = "High", + ["heading"] = 5.7595865315813, + }, -- end of [4] + [8] = + { + ["dx"] = 32.038867964002, + ["dy"] = 61.828095365003, + ["name"] = "Land_Rover_101_FC", + ["skill"] = "High", + ["heading"] = 4.1364303272266, + }, -- end of [8] + [9] = + { + ["dx"] = 22.442303705, + ["dy"] = 69.897933492997, + ["name"] = "Land_Rover_101_FC", + ["skill"] = "High", + ["heading"] = 4.1364303272266, + }, -- end of [9] + [5] = + { + ["dx"] = -54.812159296009, + ["dy"] = -56.368340474997, + ["name"] = "rapier_fsa_launcher", + ["skill"] = "High", + ["heading"] = 0.80285145591739, + }, -- end of [5] + [10] = + { + ["dx"] = 52.758722615996, + ["dy"] = 42.634966846002, + ["name"] = "Land_Rover_109_S3", + ["skill"] = "High", + ["heading"] = 4.1364303272266, + }, -- end of [10] + [3] = + { + ["dx"] = -66.224154607, + ["dy"] = 1.2103631389982, + ["name"] = "rapier_fsa_launcher", + ["skill"] = "High", + ["heading"] = 0.017453292519943, + }, -- end of [3] + [6] = + { + ["dx"] = 49.050959151995, + ["dy"] = 45.906522844001, + ["name"] = "Land_Rover_101_FC", + ["skill"] = "High", + ["heading"] = 4.1364303272266, + }, -- end of [6] + [11] = + { + ["dx"] = 39.890602357991, + ["dy"] = 55.066879637001, + ["name"] = "Land_Rover_109_S3", + ["skill"] = "High", + ["heading"] = 4.1364303272266, + }, -- end of [11] + }, -- end of ["units"] + ["type"] = "vehicle", + ["name"] = "Rapier SAM Battery UAE", + ["country"] = 74, + }, -- end of ["Rapier SAM Battery UAE"] + ["SA-2 SAM Battery"] = + { + ["country"] = 0, + ["type"] = "vehicle", + ["name"] = "SA-2 SAM Battery", + ["units"] = + { + [13] = + { + ["dx"] = -137.35942972999, + ["dy"] = -151.259040031, + ["name"] = "ATMZ-5", + ["skill"] = "High", + ["heading"] = 1.0297442586767, + }, -- end of [13] + [7] = + { + ["dx"] = 80.690318210007, + ["dy"] = 54.289070001003, + ["name"] = "S_75M_Volhov", + ["skill"] = "High", + ["heading"] = 0.92502450355699, + }, -- end of [7] + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "SNR_75V", + ["skill"] = "High", + ["heading"] = 0.0038885041518015, + }, -- end of [1] + [2] = + { + ["dx"] = 79.099061770001, + ["dy"] = -47.096697396999, + ["name"] = "S_75M_Volhov", + ["skill"] = "High", + ["heading"] = 5.4803338512622, + }, -- end of [2] + [4] = + { + ["dx"] = -1.8276942699886, + ["dy"] = -98.244225791997, + ["name"] = "S_75M_Volhov", + ["skill"] = "High", + ["heading"] = 4.6774823953448, + }, -- end of [4] + [8] = + { + ["dx"] = 29.956672100001, + ["dy"] = 44.636165102005, + ["name"] = "ZIL-131 KUNG", + ["skill"] = "High", + ["heading"] = 4.1713369122664, + }, -- end of [8] + [11] = + { + ["dx"] = -49.941045745189, + ["dy"] = 164.38476072691, + ["name"] = "Ural-4320 APA-5D", + ["skill"] = "High", + ["heading"] = 0.68067840827779, + }, -- end of [11] + [9] = + { + ["dx"] = 25.126949860001, + ["dy"] = 47.889142120999, + ["name"] = "ZIL-131 KUNG", + ["skill"] = "High", + ["heading"] = 4.1713369122664, + }, -- end of [9] + [5] = + { + ["dx"] = -85.254996139993, + ["dy"] = -46.869375048002, + ["name"] = "S_75M_Volhov", + ["skill"] = "High", + ["heading"] = 3.8048177693476, + }, -- end of [5] + [10] = + { + ["dx"] = -61.142498229994, + ["dy"] = 165.65584994, + ["name"] = "p-19 s-125 sr", + ["skill"] = "High", + ["heading"] = 2.2165681500328, + }, -- end of [10] + [14] = + { + ["dx"] = -168.04336334999, + ["dy"] = -84.915399762001, + ["name"] = "Ural-4320T", + ["skill"] = "High", + ["heading"] = 5.4279739737024, + }, -- end of [14] + [3] = + { + ["dx"] = 0.21820687000582, + ["dy"] = 106.800532487, + ["name"] = "S_75M_Volhov", + ["skill"] = "High", + ["heading"] = 1.535889741755, + }, -- end of [3] + [6] = + { + ["dx"] = -87.755541969993, + ["dy"] = 57.926227576005, + ["name"] = "S_75M_Volhov", + ["skill"] = "High", + ["heading"] = 2.3561944901923, + }, -- end of [6] + [12] = + { + ["dx"] = -118.28563314999, + ["dy"] = -171.162132111, + ["name"] = "ATMZ-5", + ["skill"] = "High", + ["heading"] = 0.87266462599716, + }, -- end of [12] + [15] = + { + ["dx"] = -151.45745328999, + ["dy"] = -70.817376204999, + ["name"] = "Ural-4320T", + ["skill"] = "High", + ["heading"] = 5.3407075111026, + }, -- end of [15] + }, -- end of ["units"] + }, -- end of ["SA-2 SAM Battery"] + ["SA-3 SAM Battery"] = + { + ["country"] = 0, + ["type"] = "vehicle", + ["name"] = "SA-3 SAM Battery", + ["units"] = + { + [7] = + { + ["dx"] = -0.19719014999282, + ["dy"] = 16.417675958997, + ["name"] = "ZIL-131 KUNG", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [7] + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "snr s-125 tr", + ["skill"] = "High", + ["heading"] = 6.2641478001644, + }, -- end of [1] + [2] = + { + ["dx"] = -54.395544479994, + ["dy"] = 20.411364487998, + ["name"] = "5p73 s-125 ln", + ["skill"] = "High", + ["heading"] = 3.1590459461097, + }, -- end of [2] + [4] = + { + ["dx"] = -26.404573919994, + ["dy"] = 38.533723629997, + ["name"] = "5p73 s-125 ln", + ["skill"] = "High", + ["heading"] = 3.1590459461097, + }, -- end of [4] + [8] = + { + ["dx"] = 6.6801895600074, + ["dy"] = 13.694317328001, + ["name"] = "ZiL-131 APA-80", + ["skill"] = "High", + ["heading"] = 3.1241393610699, + }, -- end of [8] + [9] = + { + ["dx"] = 73.148097120007, + ["dy"] = 24.177887045, + ["name"] = "GAZ-66", + ["skill"] = "High", + ["heading"] = 1.6057029118348, + }, -- end of [9] + [5] = + { + ["dx"] = -28.378296209994, + ["dy"] = -36.108864519003, + ["name"] = "5p73 s-125 ln", + ["skill"] = "High", + ["heading"] = 3.1590459461097, + }, -- end of [5] + [10] = + { + ["dx"] = 67.422903450002, + ["dy"] = 24.220744209997, + ["name"] = "GAZ-66", + ["skill"] = "High", + ["heading"] = 1.6406094968747, + }, -- end of [10] + [3] = + { + ["dx"] = -55.65154957, + ["dy"] = -15.115636602, + ["name"] = "5p73 s-125 ln", + ["skill"] = "High", + ["heading"] = 3.1590459461097, + }, -- end of [3] + [6] = + { + ["dx"] = 33.753619990006, + ["dy"] = -73.286112753005, + ["name"] = "p-19 s-125 sr", + ["skill"] = "High", + ["heading"] = 6.2641478001644, + }, -- end of [6] + [12] = + { + ["dx"] = 39.803062310006, + ["dy"] = -66.502451588, + ["name"] = "ZiL-131 APA-80", + ["skill"] = "High", + ["heading"] = 1.6406094968747, + }, -- end of [12] + [11] = + { + ["dx"] = 62.727714700013, + ["dy"] = 24.526952171, + ["name"] = "GAZ-66", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [11] + }, -- end of ["units"] + }, -- end of ["SA-3 SAM Battery"] + ["Hawk SAM Battery"] = + { + ["country"] = 2, + ["type"] = "vehicle", + ["name"] = "Hawk SAM Battery", + ["units"] = + { + [7] = + { + ["dx"] = -143.06468370894, + ["dy"] = -28.566666166706, + ["name"] = "Hawk ln", + ["skill"] = "High", + ["heading"] = 2.6179938779915, + }, -- end of [7] + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "Hawk pcp", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [1] + [2] = + { + ["dx"] = 32.279602998366, + ["dy"] = -40.996889924631, + ["name"] = "Hawk sr", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [2] + [4] = + { + ["dx"] = -73.507952767894, + ["dy"] = -58.130136438762, + ["name"] = "Hawk tr", + ["skill"] = "High", + ["heading"] = 3.8397243543875, + }, -- end of [4] + [8] = + { + ["dx"] = 71.695053443613, + ["dy"] = 58.889218891971, + ["name"] = "Hawk tr", + ["skill"] = "High", + ["heading"] = 0.69813170079773, + }, -- end of [8] + [9] = + { + ["dx"] = 142.58862828931, + ["dy"] = 26.52486901707, + ["name"] = "Hawk ln", + ["skill"] = "High", + ["heading"] = 5.7595865315813, + }, -- end of [9] + [5] = + { + ["dx"] = -53.646780668367, + ["dy"] = -135.33353399258, + ["name"] = "Hawk ln", + ["skill"] = "High", + ["heading"] = 4.7123889803847, + }, -- end of [5] + [10] = + { + ["dx"] = 139.59213643564, + ["dy"] = 111.20097058237, + ["name"] = "Hawk ln", + ["skill"] = "High", + ["heading"] = 0.69813170079773, + }, -- end of [10] + [3] = + { + ["dx"] = -34.076534003809, + ["dy"] = 41.931256096927, + ["name"] = "Hawk cwar", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [3] + [6] = + { + ["dx"] = -137.08263885655, + ["dy"] = -113.8479052746, + ["name"] = "Hawk ln", + ["skill"] = "High", + ["heading"] = 3.8397243543875, + }, -- end of [6] + [11] = + { + ["dx"] = 51.990893861743, + ["dy"] = 137.17585691391, + ["name"] = "Hawk ln", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [11] + }, -- end of ["units"] + }, -- end of ["Hawk SAM Battery"] + ["SA-10 SAM Battery"] = + { + ["type"] = "vehicle", + ["name"] = "SA-10 SAM Battery", + ["country"] = 0, + ["units"] = + { + [1] = + { + ["dx"] = 0, + ["dy"] = 0, + ["name"] = "S-300PS 40B6M tr", + ["skill"] = "High", + ["heading"] = 4.7123889803847, + }, -- end of [1] + [2] = + { + ["dx"] = 0.69314285699511, + ["dy"] = 127.97571428004, + ["name"] = "S-300PS 40B6MD sr", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [2] + [3] = + { + ["dx"] = 23.579234991223, + ["dy"] = 246.55467524601, + ["name"] = "S-300PS 54K6 cp", + ["skill"] = "High", + ["heading"] = 3.1415926535898, + }, -- end of [3] + [4] = + { + ["dx"] = -22.516027817794, + ["dy"] = 246.55467524601, + ["name"] = "S-300PS 64H6E sr", + ["skill"] = "High", + ["heading"] = 3.1415926535898, + }, -- end of [4] + [5] = + { + ["dx"] = 83.349983285123, + ["dy"] = -1.3806866992963, + ["name"] = "S-300PS 5P85C ln", + ["skill"] = "High", + ["heading"] = 3.1415926535898, + }, -- end of [5] + [6] = + { + ["dx"] = 82.498640577192, + ["dy"] = 16.104647497996, + ["name"] = "S-300PS 5P85D ln", + ["skill"] = "High", + ["heading"] = 3.3161255787892, + }, -- end of [6] + [7] = + { + ["dx"] = 82.547616217693, + ["dy"] = -18.227276489837, + ["name"] = "S-300PS 5P85D ln", + ["skill"] = "High", + ["heading"] = 2.9670597283904, + }, -- end of [7] + [8] = + { + ["dx"] = -82.640406328603, + ["dy"] = -0.41562629467808, + ["name"] = "S-300PS 5P85C ln", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [8] + [9] = + { + ["dx"] = -81.939684967569, + ["dy"] = 17.115632734494, + ["name"] = "S-300PS 5P85D ln", + ["skill"] = "High", + ["heading"] = 6.1086523819802, + }, -- end of [9] + [10] = + { + ["dx"] = -81.939684967569, + ["dy"] = -17.99454369233, + ["name"] = "S-300PS 5P85D ln", + ["skill"] = "High", + ["heading"] = 0.17453292519943, + }, -- end of [10] + [11] = + { + ["dx"] = -9.0858776818495, + ["dy"] = 187.67713509151, + ["name"] = "generator_5i57", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [11] + [12] = + { + ["dx"] = 0.83760223048739, + ["dy"] = 187.51811292395, + ["name"] = "generator_5i57", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [12] + [13] = + { + ["dx"] = -59.823818980018, + ["dy"] = 168.63468487991, + ["name"] = "ATZ-5", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [13] + [14] = + { + ["dx"] = -59.823818980018, + ["dy"] = 179.2654343833, + ["name"] = "ATZ-5", + ["skill"] = "High", + ["heading"] = 0, + }, -- end of [14] + [15] = + { + ["dx"] = 20.947679329896, + ["dy"] = -62.811427216162, + ["name"] = "GAZ-66", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [15] + [16] = + { + ["dx"] = 66.751355714747, + ["dy"] = 151.35592090525, + ["name"] = "ATZ-60_Maz", + ["skill"] = "High", + ["heading"] = 3.9269908169872, + }, -- end of [16] + [17] = + { + ["dx"] = 59.63926918729, + ["dy"] = 158.46800743265, + ["name"] = "ATZ-60_Maz", + ["skill"] = "High", + ["heading"] = 3.9269908169872, + }, -- end of [17] + [18] = + { + ["dx"] = -16.327227612433, + ["dy"] = -62.472874663305, + ["name"] = "KAMAZ Truck", + ["skill"] = "High", + ["heading"] = 1.5707963267949, + }, -- end of [18] + }, -- end of ["units"] + }, -- end of ["SA-10 SAM Battery"] +} -- end of templates diff --git a/src/core/src/scriptloader.cpp b/src/core/src/scriptloader.cpp index 850baba6..0509463e 100644 --- a/src/core/src/scriptloader.cpp +++ b/src/core/src/scriptloader.cpp @@ -50,4 +50,5 @@ void registerLuaFunctions(lua_State* L) executeLuaScript(L, modLocation + "\\Scripts\\mist.lua"); executeLuaScript(L, modLocation + "\\Scripts\\OlympusCommand.lua"); executeLuaScript(L, modLocation + "\\Scripts\\unitPayloads.lua"); + executeLuaScript(L, modLocation + "\\Scripts\\templates.lua"); }