From 2aa0b5ddfbb3ad227f3d0822b1968dd60837bf62 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:32:47 +0200 Subject: [PATCH 1/2] Update MarkerOps_Base.lua Added data to FSM events --- .../Moose/Core/MarkerOps_Base.lua | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/Moose Development/Moose/Core/MarkerOps_Base.lua b/Moose Development/Moose/Core/MarkerOps_Base.lua index 3bc950416..4571eed25 100644 --- a/Moose Development/Moose/Core/MarkerOps_Base.lua +++ b/Moose Development/Moose/Core/MarkerOps_Base.lua @@ -108,26 +108,30 @@ function MARKEROPS_BASE:New(Tagname,Keywords,Casesensitive) --- On after "MarkAdded" event. Triggered when a Marker is added to the F10 map. -- @function [parent=#MARKEROPS_BASE] OnAfterMarkAdded -- @param #MARKEROPS_BASE self - -- @param #string From The From state - -- @param #string Event The Event called - -- @param #string To The To state - -- @param #string Text The text on the marker - -- @param #table Keywords Table of matching keywords found in the Event text + -- @param #string From The From state. + -- @param #string Event The Event called. + -- @param #string To The To state. + -- @param #string Text The text on the marker. + -- @param #table Keywords Table of matching keywords found in the Event text. -- @param Core.Point#COORDINATE Coord Coordinate of the marker. - -- @param #number MarkerID Id of this marker - -- @param #number CoalitionNumber Coalition of the marker creator + -- @param #number MarkerID Id of this marker. + -- @param #number CoalitionNumber Coalition of the marker creator. + -- @param #string PlayerName Name of the player creating/changing the mark. nil if it cannot be obtained. + -- @param Core.Event#EVENTDATA EventData the event data table. --- On after "MarkChanged" event. Triggered when a Marker is changed on the F10 map. -- @function [parent=#MARKEROPS_BASE] OnAfterMarkChanged -- @param #MARKEROPS_BASE self - -- @param #string From The From state - -- @param #string Event The Event called - -- @param #string To The To state - -- @param #string Text The text on the marker - -- @param #table Keywords Table of matching keywords found in the Event text + -- @param #string From The From state. + -- @param #string Event The Event called. + -- @param #string To The To state. + -- @param #string Text The text on the marker. + -- @param #table Keywords Table of matching keywords found in the Event text. -- @param Core.Point#COORDINATE Coord Coordinate of the marker. - -- @param #number MarkerID Id of this marker - -- @param #number CoalitionNumber Coalition of the marker creator + -- @param #number MarkerID Id of this marker. + -- @param #number CoalitionNumber Coalition of the marker creator. + -- @param #string PlayerName Name of the player creating/changing the mark. nil if it cannot be obtained. + -- @param Core.Event#EVENTDATA EventData the event data table --- On after "MarkDeleted" event. Triggered when a Marker is deleted from the F10 map. -- @function [parent=#MARKEROPS_BASE] OnAfterMarkDeleted @@ -167,7 +171,7 @@ function MARKEROPS_BASE:OnEventMark(Event) if Eventtext~=nil then if self:_MatchTag(Eventtext) then local matchtable = self:_MatchKeywords(Eventtext) - self:MarkAdded(Eventtext,matchtable,coord,Event.idx,coalition) + self:MarkAdded(Eventtext,matchtable,coord,Event.idx,coalition,Event.PlayerName,Event) end end elseif Event.id==world.event.S_EVENT_MARK_CHANGE then @@ -177,7 +181,7 @@ function MARKEROPS_BASE:OnEventMark(Event) if Eventtext~=nil then if self:_MatchTag(Eventtext) then local matchtable = self:_MatchKeywords(Eventtext) - self:MarkChanged(Eventtext,matchtable,coord,Event.idx,coalition) + self:MarkChanged(Eventtext,matchtable,coord,Event.idx,coalition,Event.PlayerName,Event) end end elseif Event.id==world.event.S_EVENT_MARK_REMOVED then From 90096163ee353327168d2216f8acd25fb1ed50c7 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sat, 26 Oct 2024 18:44:57 +0200 Subject: [PATCH 2/2] EPLRS - give group ID only if ground --- Moose Development/Moose/Wrapper/Controllable.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 68d16001a..9ee8844be 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -899,10 +899,14 @@ function CONTROLLABLE:CommandEPLRS( SwitchOnOff, Delay ) id = 'EPLRS', params = { value = SwitchOnOff, - groupId = self:GetID(), + groupId = nil, }, } - + + if self:IsGround() then + CommandEPLRS.params.groupId = self:GetID() + end + if Delay and Delay > 0 then SCHEDULER:New( nil, self.CommandEPLRS, { self, SwitchOnOff }, Delay ) else @@ -1006,10 +1010,13 @@ function CONTROLLABLE:TaskEPLRS( SwitchOnOff, idx ) id = 'EPLRS', params = { value = SwitchOnOff, - groupId = self:GetID(), + groupId = nil, }, } - + if self:IsGround() then + CommandEPLRS.params.groupId = self:GetID() + end + return self:TaskWrappedAction( CommandEPLRS, idx or 1 ) end