This commit is contained in:
Applevangelist
2023-07-03 16:45:02 +02:00
parent ffcfc448be
commit 0d6fe49a41
2 changed files with 15 additions and 14 deletions

View File

@@ -115,7 +115,7 @@
AMMOTRUCK = { AMMOTRUCK = {
ClassName = "AMMOTRUCK", ClassName = "AMMOTRUCK",
lid = "", lid = "",
version = "0.0.11", version = "0.0.12",
alias = "", alias = "",
debug = false, debug = false,
trucklist = {}, trucklist = {},
@@ -373,7 +373,7 @@ function AMMOTRUCK:CheckReturningTrucks(dataset)
truck.statusquo = AMMOTRUCK.State.IDLE truck.statusquo = AMMOTRUCK.State.IDLE
truck.timestamp = timer.getAbsTime() truck.timestamp = timer.getAbsTime()
truck.coordinate = coord truck.coordinate = coord
truck.reloads = self.reloads or 5 truck.reloads = self.reloads or 5
self:__TruckHome(1,truck) self:__TruckHome(1,truck)
end end
end end
@@ -545,7 +545,7 @@ function AMMOTRUCK:CheckTrucksAlive()
newtruck.statusquo = AMMOTRUCK.State.IDLE newtruck.statusquo = AMMOTRUCK.State.IDLE
newtruck.timestamp = timer.getAbsTime() newtruck.timestamp = timer.getAbsTime()
newtruck.coordinate = truck:GetCoordinate() newtruck.coordinate = truck:GetCoordinate()
newtruck.reloads = self.reloads or 5 newtruck.reloads = self.reloads or 5
self.trucklist[name] = newtruck self.trucklist[name] = newtruck
end end
end end
@@ -632,10 +632,10 @@ function AMMOTRUCK:onafterMonitor(From, Event, To)
unloadingtrucks[#unloadingtrucks+1] = data unloadingtrucks[#unloadingtrucks+1] = data
elseif data.statusquo == AMMOTRUCK.State.RETURNING then elseif data.statusquo == AMMOTRUCK.State.RETURNING then
returningtrucks[#returningtrucks+1] = data returningtrucks[#returningtrucks+1] = data
if data.reloads > 0 or data.reloads == -1 then if data.reloads > 0 or data.reloads == -1 then
idletrucks[#idletrucks+1] = data idletrucks[#idletrucks+1] = data
found = true found = true
end end
end end
else else
self.truckset[data.name] = nil self.truckset[data.name] = nil

View File

@@ -52,6 +52,7 @@
-- * @{#CONTROLLABLE.TaskEmbarking}: (AIR) Move the controllable to a Vec2 Point, wait for a defined duration and embark a controllable. -- * @{#CONTROLLABLE.TaskEmbarking}: (AIR) Move the controllable to a Vec2 Point, wait for a defined duration and embark a controllable.
-- * @{#CONTROLLABLE.TaskEmbarkToTransport}: (GROUND) Embark to a Transport landed at a location. -- * @{#CONTROLLABLE.TaskEmbarkToTransport}: (GROUND) Embark to a Transport landed at a location.
-- * @{#CONTROLLABLE.TaskEscort}: (AIR) Escort another airborne controllable. -- * @{#CONTROLLABLE.TaskEscort}: (AIR) Escort another airborne controllable.
-- * @{#CONTROLLABLE.TaskGroundEscort}: (AIR/HELO) Escort a ground controllable.
-- * @{#CONTROLLABLE.TaskFAC_AttackGroup}: (AIR + GROUND) The task makes the controllable/unit a FAC and orders the FAC to control the target (enemy ground controllable) destruction. -- * @{#CONTROLLABLE.TaskFAC_AttackGroup}: (AIR + GROUND) The task makes the controllable/unit a FAC and orders the FAC to control the target (enemy ground controllable) destruction.
-- * @{#CONTROLLABLE.TaskFireAtPoint}: (GROUND) Fire some or all ammunition at a VEC2 point. -- * @{#CONTROLLABLE.TaskFireAtPoint}: (GROUND) Fire some or all ammunition at a VEC2 point.
-- * @{#CONTROLLABLE.TaskFollow}: (AIR) Following another airborne controllable. -- * @{#CONTROLLABLE.TaskFollow}: (AIR) Following another airborne controllable.
@@ -1487,7 +1488,7 @@ end
-- @param #CONTROLLABLE FollowControllable The controllable to be escorted. -- @param #CONTROLLABLE FollowControllable The controllable to be escorted.
-- @param #number LastWaypointIndex (optional) Detach waypoint of another controllable. Once reached the unit / controllable Escort task is finished. -- @param #number LastWaypointIndex (optional) Detach waypoint of another controllable. Once reached the unit / controllable Escort task is finished.
-- @param #number OrbitDistance (optional) Maximum distance helo will orbit around the ground unit in meters. Defaults to 2000 meters. -- @param #number OrbitDistance (optional) Maximum distance helo will orbit around the ground unit in meters. Defaults to 2000 meters.
-- @param DCS#AttributeNameArray TargetTypes (optional) Array of AttributeName that is contains threat categories allowed to engage. Default {"Ground vehicles"}. See https://wiki.hoggit.us/view/DCS_enum_attributes -- @param DCS#AttributeNameArray TargetTypes (optional) Array of AttributeName that is contains threat categories allowed to engage. Default {"Ground vehicles"}. See [https://wiki.hoggit.us/view/DCS_enum_attributes](https://wiki.hoggit.us/view/DCS_enum_attributes)
-- @return DCS#Task The DCS task structure. -- @return DCS#Task The DCS task structure.
function CONTROLLABLE:TaskGroundEscort( FollowControllable, LastWaypointIndex, OrbitDistance, TargetTypes ) function CONTROLLABLE:TaskGroundEscort( FollowControllable, LastWaypointIndex, OrbitDistance, TargetTypes )
@@ -1506,12 +1507,12 @@ function CONTROLLABLE:TaskGroundEscort( FollowControllable, LastWaypointIndex, O
local DCSTask = { local DCSTask = {
id = 'GroundEscort', id = 'GroundEscort',
params = { params = {
groupId = FollowControllable and FollowControllable:GetID() or nil groupId = FollowControllable and FollowControllable:GetID() or nil,
engagementDistMax = OrbitDistance or 2000, engagementDistMax = OrbitDistance or 2000,
lastWptIndexFlag = LastWaypointIndex and true or false, lastWptIndexFlag = LastWaypointIndex and true or false,
lastWptIndex = LastWaypointIndex, lastWptIndex = LastWaypointIndex,
targetTypes = TargetTypes or {"Ground vehicles"}, targetTypes = TargetTypes or {"Ground vehicles"},
lastWptIndexFlagChangedManually = true, lastWptIndexFlagChangedManually = true,
}, },
} }