From c8d2104c39968c7da345d4c756645cfc7e24be99 Mon Sep 17 00:00:00 2001 From: Frank Date: Wed, 29 Apr 2020 16:09:11 +0200 Subject: [PATCH] Ops --- Moose Development/Moose/Ops/AirWing.lua | 12 +++++++----- Moose Development/Moose/Ops/Auftrag.lua | 7 ++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Moose Development/Moose/Ops/AirWing.lua b/Moose Development/Moose/Ops/AirWing.lua index 0a0d87093..efafd3329 100644 --- a/Moose Development/Moose/Ops/AirWing.lua +++ b/Moose Development/Moose/Ops/AirWing.lua @@ -327,12 +327,11 @@ function AIRWING:FetchPayloadFromStock(UnitType, MissionType) return nil end - --[[ + self:I(self.lid..string.format("Looking for payload for unit type=%s and mission type=%s", UnitType, MissionType)) for i,_payload in pairs(self.payloads) do local payload=_payload --#AIRWING.Payload - self:I(self.lid..string.format("%d Payload type=%s navail=%d", i, payload.aircrafttype, payload.navail)) + self:I(self.lid..string.format("[%d] Payload type=%s navail=%d unlimited=%s", i, payload.aircrafttype, payload.navail, tostring(payload.unlimited))) end - ]] --- Sort payload wrt the following criteria: -- 1) Highest performance is the main selection criterion. @@ -346,13 +345,16 @@ function AIRWING:FetchPayloadFromStock(UnitType, MissionType) local performanceB=self:GetPayloadPeformance(b, MissionType) return (performanceA>performanceB) or (performanceA==performanceB and a.unlimited==true) or (performanceA==performanceB and a.unlimited==true and b.unlimited==true and a.navail>b.navail) elseif not a then + env.info("FF ERROR in sortpayloads: a is nil") return false elseif not b then + env.info("FF ERROR in sortpayloads: b is nil") return true else - return true + env.info("FF ERROR in sortpayloads: a and b are nil") + return false end - end + end table.sort(self.payloads, sortpayloads) if self.Debug then diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index 5d791b8c8..ac1d62f34 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -114,7 +114,12 @@ -- # The AUFTRAG Concept -- -- As you probably know, setting tasks in DCS is often tedious. The AUFTRAG class significantly simplifies the necessary workflow by using optimized default parameters. --- Also, a lot of additional useful events are created. +-- +-- You can think of an AUFTRAG as document, which contains the mission briefing, i.e. information about the target location, mission altitude, speed and various other parameters. +-- This document can be handed over directly to a pilot (or multiple pilots) via the +-- FLIGHTGROUP class. The pilots will then execute the mission. The AUFTRAG document can also be given to an AIRWING. The airwing will then determine the best assets +-- (pilots and payloads) available for the job. One more up the food chain, an AUFTRAG can be passed to a WINGCOMMANDER. The wing commander will find the best AIRWING +-- and pass the job over to it. -- -- # Mission Types --