mirror of
https://github.com/akaAgar/the-universal-mission-for-dcs-world.git
synced 2025-11-25 19:31:01 +00:00
Added "Give weather report" radio command
This commit is contained in:
parent
104fee86e9
commit
3af259f048
@ -88,9 +88,9 @@ Please also note that PvP is not supported at the moment and that the mission wi
|
||||
- Extras
|
||||
- [x] First draft of the PDF manual
|
||||
- New features
|
||||
- [ ] Additional commands in the "navigation" menu
|
||||
- [ ] Vector to nearest airfield
|
||||
- [ ] Weather report
|
||||
- [x] Additional commands in the "navigation" menu
|
||||
- [x] Vector to nearest airfield
|
||||
- [x] Weather report
|
||||
- [ ] Administrative settings
|
||||
- [x] Use of "Client" slot instead of "Player" slot even in single-player missions, allowing the player to respawn on death/ejection instead of having to start the whole mission again
|
||||
- [x] Mission now autostarts (if it wasn't started yet) when all players have taken off
|
||||
|
||||
@ -210,10 +210,10 @@ Library.radioMessages = {
|
||||
"No friendly airbase is available at the moment.",
|
||||
},
|
||||
atcWeatherUpdate = { -- TODO: voiceover
|
||||
"Roger. Weather info coming up now.\n$1",
|
||||
"Copy. Weather report inbound.\n$1",
|
||||
"This is control, checking conditions now.\n$1",
|
||||
"Copy. Weather data on the way.\n$1"
|
||||
"Roger. Weather info coming up now.\n\n$1",
|
||||
"Copy. Weather report inbound.\n\n$1",
|
||||
"This is control, checking conditions now.\n\n$1",
|
||||
"Copy. Weather data on the way.\n\n$1"
|
||||
},
|
||||
atcSafeLanding = { "Be advised: $1 is wheels down at $2 and clear of runway.", "All aircraft, $1 has landed at $2 and vacated active. Runway is open for next inbound.", "Traffic, $1 is on deck at $2 and heading to parking. Runway clear.", "All flights, $1 just rolled out at $2 and cleared the active.", "Heads up, $1 landed at $2 and moving to the ramp. Runway available for next approach." },
|
||||
atcSafeLandingPlayer = { "$1, wheels on deck, welcome back. You may taxi to the parking area.", "$1, good copy on landing. Exit when able, proceed to the parking area.", "$1, touchdown confirmed. Continue to parking.", "$1, welcome home. Clear of runway and taxi to parking area.", "$1, nice landing. Taxi to parking when ready." },
|
||||
@ -333,7 +333,6 @@ Library.radioMessages = {
|
||||
"Command, mission timeline check, are we on schedule?"
|
||||
},
|
||||
|
||||
|
||||
playerCommandRequireObjectives = {
|
||||
"Command, request objective $1 coordinates, over.",
|
||||
"Command, send me grid for objective $1.",
|
||||
|
||||
@ -20,6 +20,13 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
local function getTemperatureCelsiusAndFarenheit(temperature, inKelvins)
|
||||
inKelvins = inKelvins or false
|
||||
if inKelvins then temperature = temperature - 273.15 end
|
||||
|
||||
return tostring(math.floor(temperature)).."°C/"..tostring(math.floor(DCSEx.converter.celsiusToFahrenheit(temperature))).."°F"
|
||||
end
|
||||
|
||||
function TUM.atc.requestNavAssistanceToObjective(index, delayRadioAnswer)
|
||||
local obj = TUM.objectives.getObjective(index)
|
||||
if not obj then return end
|
||||
@ -118,18 +125,23 @@ do
|
||||
end
|
||||
|
||||
function TUM.atc.requestWeatherUpdate(delayRadioAnswer)
|
||||
local weatherInfo = "- It is currenly "..DCSEx.string.getTimeString()
|
||||
local commonWeatherInfo = "- It is currenly "..DCSEx.string.getTimeString()
|
||||
if Library.environment.isItNightTime() then
|
||||
weatherInfo = weatherInfo.." (night, sunrise at "..DCSEx.string.getTimeString(Library.environment.getDayTime(nil, false))..")\n"
|
||||
commonWeatherInfo = commonWeatherInfo.." (night, sunrise at "..DCSEx.string.getTimeString(Library.environment.getDayTime(nil, false))..")\n"
|
||||
else
|
||||
weatherInfo = weatherInfo.." (day, sunset at "..DCSEx.string.getTimeString(Library.environment.getDayTime(nil, true))..")\n"
|
||||
commonWeatherInfo = commonWeatherInfo.." (day, sunset at "..DCSEx.string.getTimeString(Library.environment.getDayTime(nil, true))..")\n"
|
||||
end
|
||||
|
||||
weatherInfo = weatherInfo.."- Average windspeed is "..tostring(DCSEx.floor(Library.environment.getWindAverage())).."m/s\n"
|
||||
|
||||
local players = coalition.getPlayers(TUM.settings.getPlayerCoalition())
|
||||
for _,p in ipairs(players) do
|
||||
TUM.radio.playForUnit(DCSEx.dcs.getObjectIDAsNumber(p), "atcWeatherUpdate", { weatherInfo }, "Control", delayRadioAnswer)
|
||||
local lTemperature, _ = atmosphere.getTemperatureAndPressure(p:getPoint())
|
||||
|
||||
local localWeatherInfo = "- Average windspeed is "..tostring(math.floor(Library.environment.getWindAverage())).."m/s\n"
|
||||
localWeatherInfo = localWeatherInfo.."- Windspeed at your location is "..DCSEx.math.getLength3D(atmosphere.getWind(p:getPoint())).."m/s\n"
|
||||
localWeatherInfo = localWeatherInfo.."- Average ground-level temperature is "..getTemperatureCelsiusAndFarenheit(env.mission.weather.season.temperature).."\n"
|
||||
localWeatherInfo = localWeatherInfo.."- Temperature at your location is "..getTemperatureCelsiusAndFarenheit(lTemperature, true)
|
||||
|
||||
TUM.radio.playForUnit(DCSEx.dcs.getObjectIDAsNumber(p), "atcWeatherUpdate", { commonWeatherInfo..localWeatherInfo }, "Control", delayRadioAnswer)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -30,7 +30,7 @@ do
|
||||
|
||||
local function doCommandWeatherUpdate()
|
||||
TUM.radio.playForCoalition(TUM.settings.getPlayerCoalition(), "playerATCWeatherUpdate", nil, TUM.mission.getPlayerCallsign(), false)
|
||||
TUM.atc.requestWeatherUpdate(false)
|
||||
TUM.atc.requestWeatherUpdate(true)
|
||||
end
|
||||
|
||||
function TUM.missionMenu.create()
|
||||
@ -38,9 +38,9 @@ do
|
||||
missionCommands.addCommand("☱ Mission status", rootMenu, doCommandMissionStatus, nil)
|
||||
|
||||
local objectivesMenuRoot = missionCommands.addSubMenu("❖ Objectives", rootMenu)
|
||||
|
||||
local navigationMenuRoot = missionCommands.addSubMenu("➽ Navigation", rootMenu)
|
||||
missionCommands.addCommand("Nav to nearest airbase", navigationMenuRoot, doCommandNearestAirbase, nil)
|
||||
|
||||
for i=1,TUM.objectives.getCount() do
|
||||
local obj = TUM.objectives.getObjective(i)
|
||||
if obj then
|
||||
@ -51,7 +51,7 @@ do
|
||||
missionCommands.addCommand("Nav to objective "..objNameAndDescription, navigationMenuRoot, doCommandObjectiveLocation, i)
|
||||
end
|
||||
end
|
||||
-- missionCommands.addCommand("Weather update", navigationMenuRoot, doCommandWeatherUpdate, nil)
|
||||
missionCommands.addCommand("Weather update", navigationMenuRoot, doCommandWeatherUpdate, nil)
|
||||
|
||||
TUM.wingmenMenu.create()
|
||||
TUM.supportAWACS.createMenu()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user