mirror of
https://github.com/akaAgar/the-universal-mission-for-dcs-world.git
synced 2025-11-25 19:31:01 +00:00
Added "number of wingmen" setting
This commit is contained in:
parent
ef66016f9f
commit
76817db137
@ -22,6 +22,7 @@ TUM.settings.id = {
|
|||||||
TARGET_LOCATION = 9,
|
TARGET_LOCATION = 9,
|
||||||
TASKING = 10,
|
TASKING = 10,
|
||||||
TIME_PERIOD = 11,
|
TIME_PERIOD = 11,
|
||||||
|
WINGMEN = 12,
|
||||||
}
|
}
|
||||||
|
|
||||||
do
|
do
|
||||||
@ -39,6 +40,7 @@ do
|
|||||||
[TUM.settings.id.TARGET_LOCATION] = "Target location",
|
[TUM.settings.id.TARGET_LOCATION] = "Target location",
|
||||||
[TUM.settings.id.TASKING] = "Mission type",
|
[TUM.settings.id.TASKING] = "Mission type",
|
||||||
[TUM.settings.id.TIME_PERIOD] = "Time period",
|
[TUM.settings.id.TIME_PERIOD] = "Time period",
|
||||||
|
[TUM.settings.id.WINGMEN] = "Wingmen",
|
||||||
}
|
}
|
||||||
|
|
||||||
local SETTING_VALUES = {
|
local SETTING_VALUES = {
|
||||||
@ -52,6 +54,7 @@ do
|
|||||||
[TUM.settings.id.TARGET_LOCATION] = { },
|
[TUM.settings.id.TARGET_LOCATION] = { },
|
||||||
[TUM.settings.id.TASKING] = { "Antiship strike", "Ground attack", "Interception", "SEAD", "Strike" }, -- Must match values in the DCSEx.enums.taskFamily enum
|
[TUM.settings.id.TASKING] = { "Antiship strike", "Ground attack", "Interception", "SEAD", "Strike" }, -- Must match values in the DCSEx.enums.taskFamily enum
|
||||||
[TUM.settings.id.TIME_PERIOD] = { "World War 2", "Korea War", "Vietnam War", "Late Cold War", "Modern" }, -- Must match values in the DCSEx.enums.timePeriod enum
|
[TUM.settings.id.TIME_PERIOD] = { "World War 2", "Korea War", "Vietnam War", "Late Cold War", "Modern" }, -- Must match values in the DCSEx.enums.timePeriod enum
|
||||||
|
[TUM.settings.id.WINGMEN] = { "None", "One", "Two", "Three" }
|
||||||
}
|
}
|
||||||
|
|
||||||
local function getFaction(side)
|
local function getFaction(side)
|
||||||
@ -74,7 +77,8 @@ do
|
|||||||
[TUM.settings.id.TARGET_COUNT] = 2,
|
[TUM.settings.id.TARGET_COUNT] = 2,
|
||||||
[TUM.settings.id.TARGET_LOCATION] = 1,
|
[TUM.settings.id.TARGET_LOCATION] = 1,
|
||||||
[TUM.settings.id.TASKING] = DCSEx.enums.taskFamily.GROUND_ATTACK,
|
[TUM.settings.id.TASKING] = DCSEx.enums.taskFamily.GROUND_ATTACK,
|
||||||
[TUM.settings.id.TIME_PERIOD] = DCSEx.enums.timePeriod.MODERN
|
[TUM.settings.id.TIME_PERIOD] = DCSEx.enums.timePeriod.MODERN,
|
||||||
|
[TUM.settings.id.WINGMEN] = 2
|
||||||
}
|
}
|
||||||
|
|
||||||
-- TODO: set default time period according to mission year
|
-- TODO: set default time period according to mission year
|
||||||
@ -155,6 +159,7 @@ do
|
|||||||
TUM.settings.id.ENEMY_AIR_DEFENSE,
|
TUM.settings.id.ENEMY_AIR_DEFENSE,
|
||||||
TUM.settings.id.ENEMY_AIR_FORCE,
|
TUM.settings.id.ENEMY_AIR_FORCE,
|
||||||
-1,
|
-1,
|
||||||
|
TUM.settings.id.WINGMEN,
|
||||||
TUM.settings.id.AI_CAP,
|
TUM.settings.id.AI_CAP,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +180,7 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
if showScoreMultiplier then
|
if showScoreMultiplier then
|
||||||
local settingMultiplier = TUM.playerScore.getScoreMultiplier(v, settings[v])
|
local settingMultiplier = TUM.playerScore.getScoreMultiplierMod(v, settings[v])
|
||||||
|
|
||||||
if settingMultiplier > 0.0 then
|
if settingMultiplier > 0.0 then
|
||||||
summary = summary.." (+"..tostring(math.ceil(settingMultiplier * 100)).."% xp)"
|
summary = summary.." (+"..tostring(math.ceil(settingMultiplier * 100)).."% xp)"
|
||||||
|
|||||||
@ -38,6 +38,8 @@ do
|
|||||||
|
|
||||||
function TUM.wingmen.create()
|
function TUM.wingmen.create()
|
||||||
TUM.wingmen.removeAll() -- Destroy all pre-existing wingmen
|
TUM.wingmen.removeAll() -- Destroy all pre-existing wingmen
|
||||||
|
if TUM.settings.getValue(TUM.settings.id.WINGMEN) <= 1 then return end -- No wingmen
|
||||||
|
|
||||||
TUM.log("Creating wingmen...")
|
TUM.log("Creating wingmen...")
|
||||||
|
|
||||||
local player = world:getPlayer()
|
local player = world:getPlayer()
|
||||||
@ -62,12 +64,16 @@ do
|
|||||||
wingmanCallsign = DCSEx.unitCallsignMaker.getCallsign(playerTypeName)
|
wingmanCallsign = DCSEx.unitCallsignMaker.getCallsign(playerTypeName)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local unitCount = TUM.settings.getValue(TUM.settings.id.WINGMEN) - 1
|
||||||
|
local unitList = {}
|
||||||
|
for _=1,unitCount do table.insert(unitList, playerTypeName) end
|
||||||
|
|
||||||
-- Select proper payload for mission
|
-- Select proper payload for mission
|
||||||
local groupInfo = DCSEx.unitGroupMaker.create(
|
local groupInfo = DCSEx.unitGroupMaker.create(
|
||||||
TUM.settings.getPlayerCoalition(),
|
TUM.settings.getPlayerCoalition(),
|
||||||
playerCategory,
|
playerCategory,
|
||||||
DCSEx.math.randomPointInCircle(DCSEx.math.vec3ToVec2(player:getPoint()), 500, 250),
|
DCSEx.math.randomPointInCircle(DCSEx.math.vec3ToVec2(player:getPoint()), 500, 250),
|
||||||
{ playerTypeName, playerTypeName },
|
unitList,
|
||||||
{
|
{
|
||||||
altitude = math.min(player:getPoint().y + 1524, 3048), -- spawn at player altitude + 5,000ft, up to a max of 10,000ft (to avoid crashes into nearby hills)
|
altitude = math.min(player:getPoint().y + 1524, 3048), -- spawn at player altitude + 5,000ft, up to a max of 10,000ft (to avoid crashes into nearby hills)
|
||||||
callsign = wingmanCallsign,
|
callsign = wingmanCallsign,
|
||||||
|
|||||||
@ -76,6 +76,7 @@ do
|
|||||||
|
|
||||||
function TUM.wingmenMenu.create()
|
function TUM.wingmenMenu.create()
|
||||||
if TUM.settings.getValue(TUM.settings.id.MULTIPLAYER) then return end -- No wingmen in multiplayer
|
if TUM.settings.getValue(TUM.settings.id.MULTIPLAYER) then return end -- No wingmen in multiplayer
|
||||||
|
if TUM.settings.getValue(TUM.settings.id.WINGMEN) <= 1 then return end -- No wingmen
|
||||||
|
|
||||||
local rootPath = missionCommands.addSubMenu("✈ Flight")
|
local rootPath = missionCommands.addSubMenu("✈ Flight")
|
||||||
missionCommands.addCommand("Cover me!", rootPath, radioCommandCoverMe, nil)
|
missionCommands.addCommand("Cover me!", rootPath, radioCommandCoverMe, nil)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user