From 91d492c5797308cc8a2458c0eb0cdff8e8605841 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 31 Oct 2022 15:15:47 +0100 Subject: [PATCH 1/3] #EVENT * Added events from 2.8 --- Moose Development/Moose/Core/Event.lua | 72 ++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Core/Event.lua b/Moose Development/Moose/Core/Event.lua index 0b239f2d4..7e585dcde 100644 --- a/Moose Development/Moose/Core/Event.lua +++ b/Moose Development/Moose/Core/Event.lua @@ -248,6 +248,17 @@ EVENTS = { TriggerZone = world.event.S_EVENT_TRIGGER_ZONE or -1, LandingQualityMark = world.event.S_EVENT_LANDING_QUALITY_MARK or -1, BDA = world.event.S_EVENT_BDA or -1, + AIAbortMission = world.event.S_EVENT_AI_ABORT_MISSION or -1, + DayNight = world.event.S_EVENT_DAYNIGHT or -1, + FlightTime = world.event.S_EVENT_FLIGHT_TIME or -1, + SelfKillPilot = world.event.S_EVENT_PLAYER_SELF_KILL_PILOT or -1, + PlayerCaptureAirfield = world.event.S_EVENT_PLAYER_CAPTURE_AIRFIELD or -1, + EmergencyLanding = world.event.S_EVENT_EMERGENCY_LANDING or -1, + UnitCreateTask = world.event.S_EVENT_UNIT_CREATE_TASK or -1, + UnitDeleteTask = world.event.S_EVENT_UNIT_DELETE_TASK or -1, + SimulationStart = world.event.S_EVENT_SIMULATION_START or -1, + WeaponRearm = world.event.S_EVENT_WEAPON_REARM or -1, + WeaponDrop = world.event.S_EVENT_WEAPON_DROP or -1, } --- The Event structure @@ -553,16 +564,71 @@ local _EVENTMETA = { [EVENTS.LandingQualityMark] = { Order = 1, Event = "OnEventLandingQualityMark", - Text = "S_EVENT_LANDING_QUALITYMARK" + Text = "S_EVENT_BDA" }, [EVENTS.BDA] = { Order = 1, Event = "OnEventBDA", - Text = "S_EVENT_BDA" + Text = "S_EVENT_LANDING_QUALITYMARK" + }, + -- Added with 2.8 + [EVENTS.AIAbortMission] = { + Order = 1, + Event = "OnEventAIAbortMission", + Text = "S_EVENT_AI_ABORT_MISSION" + }, + [EVENTS.DayNight] = { + Order = 1, + Event = "OnEventDayNight", + Text = "S_EVENT_DAYNIGHT" + }, + [EVENTS.FlightTime] = { + Order = 1, + Event = "OnEventFlightTime", + Text = "S_EVENT_FLIGHT_TIME" + }, + [EVENTS.SelfKillPilot] = { + Order = 1, + Event = "OnEventSelfKillPilot", + Text = "S_EVENT_PLAYER_SELF_KILL_PILOT" + }, + [EVENTS.PlayerCaptureAirfield] = { + Order = 1, + Event = "OnEventPlayerCaptureAirfield", + Text = "S_EVENT_PLAYER_CAPTURE_AIRFIELD" + }, + [EVENTS.EmergencyLanding] = { + Order = 1, + Event = "OnEventEmergencyLanding", + Text = "S_EVENT_EMERGENCY_LANDING" + }, + [EVENTS.UnitCreateTask] = { + Order = 1, + Event = "OnEventUnitCreateTask", + Text = "S_EVENT_UNIT_CREATE_TASK" + }, + [EVENTS.UnitDeleteTask] = { + Order = 1, + Event = "OnEventUnitDeleteTask", + Text = "S_EVENT_UNIT_DELETE_TASK" + }, + [EVENTS.SimulationStart] = { + Order = 1, + Event = "OnEventSimulationStart", + Text = "S_EVENT_SIMULATION_START" + }, + [EVENTS.WeaponRearm] = { + Order = 1, + Event = "OnEventWeaponRearm", + Text = "S_EVENT_WEAPON_REARM" + }, + [EVENTS.WeaponDrop] = { + Order = 1, + Event = "OnEventWeaponDrop", + Text = "S_EVENT_WEAPON_DROP" }, } - --- The Events structure -- @type EVENT.Events -- @field #number IniUnit From fd230701e95800da2d29c016629dfe3b4cea64a6 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 31 Oct 2022 15:43:13 +0100 Subject: [PATCH 2/3] #EVENT * Added events from 2.8 --- Moose Development/Moose/Core/Event.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Core/Event.lua b/Moose Development/Moose/Core/Event.lua index 7e585dcde..d59f1c244 100644 --- a/Moose Development/Moose/Core/Event.lua +++ b/Moose Development/Moose/Core/Event.lua @@ -248,6 +248,7 @@ EVENTS = { TriggerZone = world.event.S_EVENT_TRIGGER_ZONE or -1, LandingQualityMark = world.event.S_EVENT_LANDING_QUALITY_MARK or -1, BDA = world.event.S_EVENT_BDA or -1, + -- Added with DCS 2.8.0 AIAbortMission = world.event.S_EVENT_AI_ABORT_MISSION or -1, DayNight = world.event.S_EVENT_DAYNIGHT or -1, FlightTime = world.event.S_EVENT_FLIGHT_TIME or -1, @@ -564,16 +565,17 @@ local _EVENTMETA = { [EVENTS.LandingQualityMark] = { Order = 1, Event = "OnEventLandingQualityMark", - Text = "S_EVENT_BDA" + Text = "S_EVENT_LANDING_QUALITYMARK" }, [EVENTS.BDA] = { Order = 1, Event = "OnEventBDA", - Text = "S_EVENT_LANDING_QUALITYMARK" + Text = "S_EVENT_BDA" }, - -- Added with 2.8 + -- Added with DCS 2.8 [EVENTS.AIAbortMission] = { Order = 1, + Side = "I", Event = "OnEventAIAbortMission", Text = "S_EVENT_AI_ABORT_MISSION" }, @@ -589,6 +591,7 @@ local _EVENTMETA = { }, [EVENTS.SelfKillPilot] = { Order = 1, + Side = "I", Event = "OnEventSelfKillPilot", Text = "S_EVENT_PLAYER_SELF_KILL_PILOT" }, @@ -599,6 +602,7 @@ local _EVENTMETA = { }, [EVENTS.EmergencyLanding] = { Order = 1, + Side = "I", Event = "OnEventEmergencyLanding", Text = "S_EVENT_EMERGENCY_LANDING" }, @@ -619,11 +623,13 @@ local _EVENTMETA = { }, [EVENTS.WeaponRearm] = { Order = 1, + Side = "I", Event = "OnEventWeaponRearm", Text = "S_EVENT_WEAPON_REARM" }, [EVENTS.WeaponDrop] = { Order = 1, + Side = "I", Event = "OnEventWeaponDrop", Text = "S_EVENT_WEAPON_DROP" }, From 7d37acb1cdfba8ecd8cfcece6edfd4312dc8a687 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 31 Oct 2022 16:06:30 +0100 Subject: [PATCH 3/3] #CTLD_HERCULES * Fix for `CTLD_HERCULES:Cargo_Track(cargo, initiator)` when flying very low --- Moose Development/Moose/Ops/CTLD.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index a4a5c945d..c4f12389a 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -4895,7 +4895,7 @@ CTLD_HERCULES = { ClassName = "CTLD_HERCULES", lid = "", Name = "", - Version = "0.0.1", + Version = "0.0.2", } --- Define cargo types. @@ -5306,7 +5306,7 @@ function CTLD_HERCULES:Cargo_Track(cargo, initiator) if self:Check_SurfaceType(cargo.Cargo_Contents) == 2 or self:Check_SurfaceType(cargo.Cargo_Contents) == 3 then cargo.Cargo_over_water = true--pallets gets destroyed in water end - local dcsvec3 = self.ObjectTracker[cargo.Cargo_Contents.id_] -- last known position + local dcsvec3 = self.ObjectTracker[cargo.Cargo_Contents.id_] or initiator:GetVec3() -- last known position self:T("SPAWNPOSITION: ") self:T({dcsvec3}) local Vec2 = { @@ -5409,7 +5409,7 @@ function CTLD_HERCULES:Cargo_Initialize(Initiator, Cargo_Contents, Cargo_Type_na local timer = TIMER:New(self.Cargo_Track,self,self.Cargo[self.j],Initiator) self.Cargo[self.j].scheduleFunctionID = timer - timer:Start(5,2,600) + timer:Start(1,1,600) else -- no paras @@ -5434,7 +5434,7 @@ function CTLD_HERCULES:Cargo_Initialize(Initiator, Cargo_Contents, Cargo_Type_na local timer = TIMER:New(self.Cargo_Track,self,self.Cargo[self.j],Initiator) self.Cargo[self.j].scheduleFunctionID = timer - timer:Start(5,2,600) + timer:Start(1,1,600) end end return self