mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Merge branch 'main' into 343-add-ability-to-select-unit-nation-and-livery
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
local version = "v0.4.1-alpha"
|
||||
local version = "v0.4.2-alpha"
|
||||
|
||||
local debug = false
|
||||
|
||||
@@ -427,6 +427,10 @@ function Olympus.generateAirUnitsTable(units)
|
||||
local loadout = unit.loadout -- loadout: a string, one of the names defined in unitPayloads.lua. Must be compatible with the unitType
|
||||
local payload = unit.payload -- payload: a table, if present the unit will receive this specific payload. Overrides loadout
|
||||
|
||||
if unit.heading == nil then
|
||||
unit.heading = 0
|
||||
end
|
||||
|
||||
if payload == nil then
|
||||
if loadout and loadout ~= "" and Olympus.unitPayloads[unit.unitType][loadout] then
|
||||
payload = Olympus.unitPayloads[unit.unitType][loadout]
|
||||
@@ -445,11 +449,14 @@ function Olympus.generateAirUnitsTable(units)
|
||||
["alt_type"] = "BARO",
|
||||
["skill"] = "Excellent",
|
||||
["payload"] = { ["pylons"] = payload, ["fuel"] = 999999, ["flare"] = 60, ["ammo_type"] = 1, ["chaff"] = 60, ["gun"] = 100, },
|
||||
["heading"] = 0,
|
||||
["heading"] = unit.heading,
|
||||
["callsign"] = { [1] = 1, [2] = 1, [3] = 1, ["name"] = "Olympus" .. Olympus.unitCounter.. "-" .. #unitTable + 1 },
|
||||
["name"] = "Olympus-" .. Olympus.unitCounter .. "-" .. #unitTable + 1,
|
||||
["livery_id"] = unit.liveryID
|
||||
}
|
||||
|
||||
-- Add the payload to the registry, used for unit cloning
|
||||
Olympus.payloadRegistry[unitTable[#unitTable].name] = payload
|
||||
end
|
||||
return unitTable
|
||||
end
|
||||
@@ -533,7 +540,7 @@ function Olympus.generateGroundUnitsTable(units)
|
||||
["type"] = unit.unitType,
|
||||
["x"] = spawnLocation.x,
|
||||
["y"] = spawnLocation.z,
|
||||
["heading"] = 0,
|
||||
["heading"] = unit.heading,
|
||||
["skill"] = "High",
|
||||
["name"] = "Olympus-" .. Olympus.unitCounter .. "-" .. #unitTable + 1,
|
||||
["livery_id"] = unit.liveryID
|
||||
@@ -568,7 +575,7 @@ function Olympus.generateNavyUnitsTable(units)
|
||||
["type"] = unit.unitType,
|
||||
["x"] = spawnLocation.x,
|
||||
["y"] = spawnLocation.z,
|
||||
["heading"] = 0,
|
||||
["heading"] = unit.heading,
|
||||
["skill"] = "High",
|
||||
["name"] = "Olympus-" .. Olympus.unitCounter .. "-" .. #unitTable + 1,
|
||||
["transportable"] = { ["randomTransportable"] = false },
|
||||
@@ -585,6 +592,9 @@ function Olympus.clone(ID, lat, lng, category)
|
||||
Olympus.debug("Olympus.clone " .. ID .. ", " .. category, 2)
|
||||
local unit = Olympus.getUnitByID(ID)
|
||||
if unit then
|
||||
local position = unit:getPosition()
|
||||
local heading = math.atan2( position.x.z, position.x.x )
|
||||
|
||||
-- TODO: understand category in this script
|
||||
local spawnTable = {
|
||||
coalition = Olympus.getCoalitionByCoalitionID(unit:getCoalition()),
|
||||
@@ -594,6 +604,7 @@ function Olympus.clone(ID, lat, lng, category)
|
||||
lat = lat,
|
||||
lng = lng,
|
||||
alt = unit:getPoint().y,
|
||||
heading = heading,
|
||||
unitType = unit:getTypeName(),
|
||||
payload = Olympus.payloadRegistry[unit:getName()]
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local version = 'v0.4.1-alpha'
|
||||
local version = 'v0.4.2-alpha'
|
||||
|
||||
Olympus = {}
|
||||
Olympus.OlympusDLL = nil
|
||||
|
||||
File diff suppressed because one or more lines are too long
25491
scripts/unitPayloads.lua
25491
scripts/unitPayloads.lua
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user