mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Update CSAR.lua (#1550)
This commit is contained in:
@@ -80,7 +80,7 @@
|
|||||||
-- self.mashprefix = {"MASH"} -- prefixes of #GROUP objects used as MASHes.
|
-- self.mashprefix = {"MASH"} -- prefixes of #GROUP objects used as MASHes.
|
||||||
-- self.max_units = 6 -- number of pilots that can be carried if #CSAR.AircraftType is undefined.
|
-- self.max_units = 6 -- number of pilots that can be carried if #CSAR.AircraftType is undefined.
|
||||||
-- self.messageTime = 15 -- Time to show messages for in seconds. Doubled for long messages.
|
-- self.messageTime = 15 -- Time to show messages for in seconds. Doubled for long messages.
|
||||||
-- self.radioSound = "beacon.ogg" -- the name of the sound file to use for the pilots' radio beacons.
|
-- self.radioSound = "beacon.ogg" -- the name of the sound file to use for the pilots\' radio beacons.
|
||||||
-- self.smokecolor = 4 -- Color of smokemarker, 0 is green, 1 is red, 2 is white, 3 is orange and 4 is blue.
|
-- self.smokecolor = 4 -- Color of smokemarker, 0 is green, 1 is red, 2 is white, 3 is orange and 4 is blue.
|
||||||
-- self.useprefix = true -- Requires CSAR helicopter #GROUP names to have the prefix(es) defined below.
|
-- self.useprefix = true -- Requires CSAR helicopter #GROUP names to have the prefix(es) defined below.
|
||||||
-- self.csarPrefix = { "helicargo", "MEDEVAC"} -- #GROUP name prefixes used for useprefix=true - DO NOT use # in helicopter names in the Mission Editor!
|
-- self.csarPrefix = { "helicargo", "MEDEVAC"} -- #GROUP name prefixes used for useprefix=true - DO NOT use # in helicopter names in the Mission Editor!
|
||||||
@@ -88,10 +88,10 @@
|
|||||||
--
|
--
|
||||||
-- ## 2.1 Experimental Features
|
-- ## 2.1 Experimental Features
|
||||||
--
|
--
|
||||||
-- WARNING - Here'll be dragons!
|
-- "WARNING - Here\'ll be dragons!
|
||||||
-- DANGER - For this to work you need to de-sanitize your mission environment (all three entries) in <DCS root>\Scripts\MissionScripting.lua
|
-- DANGER - For this to work you need to de-sanitize your mission environment (all three entries) in <DCS root>\Scripts\MissionScripting.lua
|
||||||
-- Needs SRS => 1.9.6 to work (works on the *server* side of SRS)
|
-- Needs SRS => 1.9.6 to work (works on the *server* side of SRS)"
|
||||||
-- self.useSRS = false -- Set true to use FF's SRS integration
|
-- self.useSRS = false -- Set true to use FF\'s SRS integration
|
||||||
-- self.SRSPath = "E:\\Program Files\\DCS-SimpleRadio-Standalone\\" -- adjust your own path in your SRS installation -- server(!)
|
-- self.SRSPath = "E:\\Program Files\\DCS-SimpleRadio-Standalone\\" -- adjust your own path in your SRS installation -- server(!)
|
||||||
-- self.SRSchannel = 300 -- radio channel
|
-- self.SRSchannel = 300 -- radio channel
|
||||||
-- self.SRSModulation = radio.modulation.AM -- modulation
|
-- self.SRSModulation = radio.modulation.AM -- modulation
|
||||||
@@ -222,7 +222,7 @@ CSAR.AircraftType["Mi-24"] = 8
|
|||||||
|
|
||||||
--- CSAR class version.
|
--- CSAR class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
CSAR.version="0.1.2r2"
|
CSAR.version="0.1.3r1"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- ToDo list
|
-- ToDo list
|
||||||
@@ -262,6 +262,7 @@ function CSAR:New(Coalition, Template, Alias)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
self.coalition = Coalition
|
self.coalition = Coalition
|
||||||
|
self.coalitiontxt = string.lower(UTILS.GetCoalitionName(self.coalition))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Set alias.
|
-- Set alias.
|
||||||
@@ -1082,7 +1083,7 @@ function CSAR:_CheckCloseWoundedGroup(_distance, _heliUnit, _heliName, _woundedG
|
|||||||
if (_distance < self.extractDistance) then
|
if (_distance < self.extractDistance) then
|
||||||
local _time = self.landedStatus[_lookupKeyHeli]
|
local _time = self.landedStatus[_lookupKeyHeli]
|
||||||
if _time == nil then
|
if _time == nil then
|
||||||
self.landedStatus[_lookupKeyHeli] = math.floor( (_distance * self.loadtimemax ) / self.extractDistance )
|
self.landedStatus[_lookupKeyHeli] = math.floor( (_distance - self.loadDistance) / 1.94 )
|
||||||
_time = self.landedStatus[_lookupKeyHeli]
|
_time = self.landedStatus[_lookupKeyHeli]
|
||||||
self:_OrderGroupToMoveToPoint(_woundedGroup, _heliUnit:GetCoordinate())
|
self:_OrderGroupToMoveToPoint(_woundedGroup, _heliUnit:GetCoordinate())
|
||||||
self:_DisplayMessageToSAR(_heliUnit, "Wait till " .. _pilotName .. " gets in. \nETA " .. _time .. " more seconds.", self.messageTime, true)
|
self:_DisplayMessageToSAR(_heliUnit, "Wait till " .. _pilotName .. " gets in. \nETA " .. _time .. " more seconds.", self.messageTime, true)
|
||||||
@@ -1427,7 +1428,11 @@ function CSAR:_SignalFlare(_unitName)
|
|||||||
local _coord = _closest.pilot:GetCoordinate()
|
local _coord = _closest.pilot:GetCoordinate()
|
||||||
_coord:FlareRed(_clockDir)
|
_coord:FlareRed(_clockDir)
|
||||||
else
|
else
|
||||||
self:_DisplayMessageToSAR(_heli, "No Pilots within 8km/4.32nm", self.messageTime)
|
local disttext = "4.3nm"
|
||||||
|
if self.coordtype == 4 then
|
||||||
|
disttext = "8km"
|
||||||
|
end
|
||||||
|
self:_DisplayMessageToSAR(_heli, string.format("No Pilots within %s",disttext), self.messageTime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1472,7 +1477,11 @@ function CSAR:_Reqsmoke( _unitName )
|
|||||||
local color = self.smokecolor
|
local color = self.smokecolor
|
||||||
_coord:Smoke(color)
|
_coord:Smoke(color)
|
||||||
else
|
else
|
||||||
self:_DisplayMessageToSAR(_heli, "No Pilots within 8km/4.32nm", self.messageTime)
|
local disttext = "4.3nm"
|
||||||
|
if self.coordtype == 4 then
|
||||||
|
disttext = "8km"
|
||||||
|
end
|
||||||
|
self:_DisplayMessageToSAR(_heli, string.format("No Pilots within %s",disttext), self.messageTime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1715,6 +1724,7 @@ function CSAR:_GetClockDirection(_heli, _group)
|
|||||||
local Aspect = Angle - _heading
|
local Aspect = Angle - _heading
|
||||||
if Aspect == 0 then Aspect = 360 end
|
if Aspect == 0 then Aspect = 360 end
|
||||||
clock = math.floor(Aspect / 30)
|
clock = math.floor(Aspect / 30)
|
||||||
|
if clock == 0 then clock = 12 end
|
||||||
end
|
end
|
||||||
return clock
|
return clock
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user