mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
RANGE 2.1.2
fixes
This commit is contained in:
parent
944c76c250
commit
6d79bbfb45
@ -1175,7 +1175,7 @@ function RADIOQUEUE:_CheckRadioQueue()
|
|||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
if time-Tlast>=transmission.interval then
|
if Tlast==nil or time-Tlast>=transmission.interval then
|
||||||
next=transmission
|
next=transmission
|
||||||
else
|
else
|
||||||
|
|
||||||
|
|||||||
@ -76,8 +76,8 @@
|
|||||||
-- fox=FOX:New()
|
-- fox=FOX:New()
|
||||||
--
|
--
|
||||||
-- -- Add training zones.
|
-- -- Add training zones.
|
||||||
-- fox:AddSafeZone(ZONE:New("Training Zone Alpha")
|
-- fox:AddSafeZone(ZONE:New("Training Zone Alpha"))
|
||||||
-- fox:AddSafeZone(ZONE:New("Training Zone Bravo")
|
-- fox:AddSafeZone(ZONE:New("Training Zone Bravo"))
|
||||||
--
|
--
|
||||||
-- -- Start missile trainer.
|
-- -- Start missile trainer.
|
||||||
-- fox:Start()
|
-- fox:Start()
|
||||||
@ -90,8 +90,8 @@
|
|||||||
-- fox=FOX:New()
|
-- fox=FOX:New()
|
||||||
--
|
--
|
||||||
-- -- Add training zones.
|
-- -- Add training zones.
|
||||||
-- fox:AddLaunchZone(ZONE:New("Launch Zone SA-10 Krim")
|
-- fox:AddLaunchZone(ZONE:New("Launch Zone SA-10 Krim"))
|
||||||
-- fox:AddLaunchZone(ZONE:New("Training Zone Bravo")
|
-- fox:AddLaunchZone(ZONE:New("Training Zone Bravo"))
|
||||||
--
|
--
|
||||||
-- -- Start missile trainer.
|
-- -- Start missile trainer.
|
||||||
-- fox:Start()
|
-- fox:Start()
|
||||||
@ -189,7 +189,7 @@ FOX.MenuF10Root=nil
|
|||||||
|
|
||||||
--- FOX class version.
|
--- FOX class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
FOX.version="0.5.0"
|
FOX.version="0.5.1"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- ToDo list
|
-- ToDo list
|
||||||
@ -444,6 +444,17 @@ function FOX:SetExplosionPower(power)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set missile-player distance when missile is destroyed.
|
||||||
|
-- @param #FOX self
|
||||||
|
-- @param #number distance Distance in meters. Default 100 m.
|
||||||
|
-- @return #FOX self
|
||||||
|
function FOX:SetExplosionDistance(distance)
|
||||||
|
|
||||||
|
self.explosiondist=distance or 100
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Disable F10 menu for all players.
|
--- Disable F10 menu for all players.
|
||||||
-- @param #FOX self
|
-- @param #FOX self
|
||||||
@ -1065,13 +1076,13 @@ function FOX:OnEventShot(EventData)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Debug info.
|
-- Debug info.
|
||||||
self:E(FOX.lid.."EVENT SHOT: FOX")
|
self:T2(FOX.lid.."EVENT SHOT: FOX")
|
||||||
self:E(FOX.lid..string.format("EVENT SHOT: Ini unit = %s", tostring(EventData.IniUnitName)))
|
self:T2(FOX.lid..string.format("EVENT SHOT: Ini unit = %s", tostring(EventData.IniUnitName)))
|
||||||
self:E(FOX.lid..string.format("EVENT SHOT: Ini group = %s", tostring(EventData.IniGroupName)))
|
self:T2(FOX.lid..string.format("EVENT SHOT: Ini group = %s", tostring(EventData.IniGroupName)))
|
||||||
self:E(FOX.lid..string.format("EVENT SHOT: Weapon type = %s", tostring(_weapon)))
|
self:T2(FOX.lid..string.format("EVENT SHOT: Weapon type = %s", tostring(_weapon)))
|
||||||
self:E(FOX.lid..string.format("EVENT SHOT: Weapon categ = %s", tostring(weaponcategory)))
|
self:T2(FOX.lid..string.format("EVENT SHOT: Weapon categ = %s", tostring(weaponcategory)))
|
||||||
self:E(FOX.lid..string.format("EVENT SHOT: Missil categ = %s", tostring(missilecategory)))
|
self:T2(FOX.lid..string.format("EVENT SHOT: Missil categ = %s", tostring(missilecategory)))
|
||||||
self:E(FOX.lid..string.format("EVENT SHOT: Missil range = %s", tostring(missilerange)))
|
self:T2(FOX.lid..string.format("EVENT SHOT: Missil range = %s", tostring(missilerange)))
|
||||||
|
|
||||||
|
|
||||||
-- Check if fired in launch zone.
|
-- Check if fired in launch zone.
|
||||||
|
|||||||
@ -78,7 +78,7 @@
|
|||||||
-- @field #boolean trackrockets If true (default), all rocket types are tracked and impact point to closest bombing target is evaluated.
|
-- @field #boolean trackrockets If true (default), all rocket types are tracked and impact point to closest bombing target is evaluated.
|
||||||
-- @field #boolean trackmissiles If true (default), all missile types are tracked and impact point to closest bombing target is evaluated.
|
-- @field #boolean trackmissiles If true (default), all missile types are tracked and impact point to closest bombing target is evaluated.
|
||||||
-- @field #boolean defaultsmokebomb If true, initialize player settings to smoke bomb.
|
-- @field #boolean defaultsmokebomb If true, initialize player settings to smoke bomb.
|
||||||
-- @field #boolean autosafe If true, automatically save results every X seconds.
|
-- @field #boolean autosave If true, automatically save results every X seconds.
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
--- Enables a mission designer to easily set up practice ranges in DCS. A new RANGE object can be created with the @{#RANGE.New}(rangename) contructor.
|
--- Enables a mission designer to easily set up practice ranges in DCS. A new RANGE object can be created with the @{#RANGE.New}(rangename) contructor.
|
||||||
@ -340,7 +340,7 @@ RANGE.MenuF10Root=nil
|
|||||||
|
|
||||||
--- Range script version.
|
--- Range script version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
RANGE.version="2.1.1"
|
RANGE.version="2.1.2"
|
||||||
|
|
||||||
--TODO list:
|
--TODO list:
|
||||||
--TODO: Verbosity level for messages.
|
--TODO: Verbosity level for messages.
|
||||||
@ -617,19 +617,19 @@ function RANGE:SetMessageTimeDuration(time)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Automatically safe player results to disc.
|
--- Automatically save player results to disc.
|
||||||
-- @param #RANGE self
|
-- @param #RANGE self
|
||||||
-- @return #RANGE self
|
-- @return #RANGE self
|
||||||
function RANGE:SetAutosafeOn()
|
function RANGE:SetAutosaveOn()
|
||||||
self.autosafe=true
|
self.autosave=true
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Switch off auto safe player results.
|
--- Switch off auto save player results.
|
||||||
-- @param #RANGE self
|
-- @param #RANGE self
|
||||||
-- @return #RANGE self
|
-- @return #RANGE self
|
||||||
function RANGE:SetAutosafeOff()
|
function RANGE:SetAutosaveOff()
|
||||||
self.autosafe=false
|
self.autosave=false
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -662,7 +662,7 @@ function RANGE:SetRangeRadius(radius)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set player setting whether bomb impact points are smoked or not
|
--- Set player setting whether bomb impact points are smoked or not.
|
||||||
-- @param #RANGE self
|
-- @param #RANGE self
|
||||||
-- @param #boolean switch If true nor nil default is to smoke impact points of bombs.
|
-- @param #boolean switch If true nor nil default is to smoke impact points of bombs.
|
||||||
-- @return #RANGE self
|
-- @return #RANGE self
|
||||||
@ -1650,7 +1650,7 @@ function RANGE:onafterStatus(From, Event, To)
|
|||||||
self:_CheckPlayers()
|
self:_CheckPlayers()
|
||||||
|
|
||||||
-- Save results.
|
-- Save results.
|
||||||
if self.autosafe then
|
if self.autosave then
|
||||||
self:Save()
|
self:Save()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1725,10 +1725,10 @@ function RANGE:onafterSave(From, Event, To)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Path.
|
-- Path.
|
||||||
local path=lfs.writedir()
|
local path=lfs.writedir()..[[Logs\]]
|
||||||
|
|
||||||
-- Set file name.
|
-- Set file name.
|
||||||
local filename=path..string.format("\\RANGE-%s_BombingResults.csv", self.rangename)
|
local filename=path..string.format("RANGE-%s_BombingResults.csv", self.rangename)
|
||||||
|
|
||||||
-- Header line.
|
-- Header line.
|
||||||
local scores="Name,Pass,Target,Distance,Radial,Quality,Weapon,Airframe,Mission Time"
|
local scores="Name,Pass,Target,Distance,Radial,Quality,Weapon,Airframe,Mission Time"
|
||||||
@ -1788,11 +1788,11 @@ function RANGE:onafterLoad(From, Event, To)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Path.
|
-- Path in DCS log file.
|
||||||
local path=lfs.writedir()
|
local path=lfs.writedir()..[[Logs\]]
|
||||||
|
|
||||||
-- Set file name.
|
-- Set file name.
|
||||||
local filename=path..string.format("\\RANGE-%s_BombingResults.csv", self.rangename)
|
local filename=path..string.format("RANGE-%s_BombingResults.csv", self.rangename)
|
||||||
|
|
||||||
-- Info message.
|
-- Info message.
|
||||||
local text=string.format("Loading player bomb results from file %s", filename)
|
local text=string.format("Loading player bomb results from file %s", filename)
|
||||||
@ -2185,15 +2185,16 @@ function RANGE:_DisplayBombTargets(_unitname)
|
|||||||
local _text="Bomb Target Locations:"
|
local _text="Bomb Target Locations:"
|
||||||
|
|
||||||
for _,_bombtarget in pairs(self.bombingTargets) do
|
for _,_bombtarget in pairs(self.bombingTargets) do
|
||||||
local _target=_bombtarget.target --Wrapper.Positionable#POSITIONABLE
|
local bombtarget=_bombtarget --#RANGE.BombTarget
|
||||||
|
|
||||||
-- Coordinate of bombtarget.
|
-- Coordinate of bombtarget.
|
||||||
local coord=self:_GetBombTargetCoordinate(_bombtarget)
|
local coord=self:_GetBombTargetCoordinate(bombtarget)
|
||||||
|
|
||||||
if coord then
|
if coord then
|
||||||
|
|
||||||
local mycoord=coord:ToStringA2G(_unit, _settings)
|
local ca2g=coord:ToStringA2G(_unit, _settings)
|
||||||
_text=_text..string.format("\n- %s: %s",_bombtarget.name or "unknown", mycoord)
|
local lldms=coord:ToStringLLDMS()
|
||||||
|
_text=_text..string.format("\n- %s: %s %s", bombtarget.name or "unknown", ca2g, lldms)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -2708,21 +2709,19 @@ function RANGE:_MarkTargetsOnMap(_unitName)
|
|||||||
self:F(_unitName)
|
self:F(_unitName)
|
||||||
|
|
||||||
-- Get group.
|
-- Get group.
|
||||||
local group=nil
|
local group=nil --Wrapper.Group#GROUP
|
||||||
if _unitName then
|
if _unitName then
|
||||||
group=UNIT:FindByName(_unitName):GetGroup()
|
group=UNIT:FindByName(_unitName):GetGroup()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Mark bomb targets.
|
-- Mark bomb targets.
|
||||||
for _,_bombtarget in pairs(self.bombingTargets) do
|
for _,_bombtarget in pairs(self.bombingTargets) do
|
||||||
local _target=_bombtarget.target --Wrapper.Positionable#POSITIONABLE
|
local bombtarget=_bombtarget --#RANGE.BombTarget
|
||||||
if _target and _target:IsAlive() then
|
local coord=self:_GetBombTargetCoordinate(_bombtarget)
|
||||||
local coord=_target:GetCoordinate() --Core.Point#COORDINATE
|
if group then
|
||||||
if group then
|
coord:MarkToGroup(string.format("Bomb target %s:\n%s\n%s", bombtarget.name, coord:ToStringLLDMS(), coord:ToStringBULLS(group:GetCoalition())), group)
|
||||||
coord:MarkToGroup("Bomb target ".._bombtarget.name, group)
|
else
|
||||||
else
|
coord:MarkToAll(string.format("Bomb target %s", bombtarget.name))
|
||||||
coord:MarkToAll("Bomb target ".._bombtarget.name)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -2733,7 +2732,8 @@ function RANGE:_MarkTargetsOnMap(_unitName)
|
|||||||
if _target and _target:IsAlive() then
|
if _target and _target:IsAlive() then
|
||||||
local coord=_target:GetCoordinate() --Core.Point#COORDINATE
|
local coord=_target:GetCoordinate() --Core.Point#COORDINATE
|
||||||
if group then
|
if group then
|
||||||
coord:MarkToGroup("Strafe target ".._target:GetName(), group)
|
--coord:MarkToGroup("Strafe target ".._target:GetName(), group)
|
||||||
|
coord:MarkToGroup(string.format("Strafe target %s:\n%s\n%s", _target:GetName(), coord:ToStringLLDMS(), coord:ToStringBULLS(group:GetCoalition())), group)
|
||||||
else
|
else
|
||||||
coord:MarkToAll("Strafe target ".._target:GetName())
|
coord:MarkToAll("Strafe target ".._target:GetName())
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user