diff --git a/Moose Development/Moose/Core/Event.lua b/Moose Development/Moose/Core/Event.lua index dd739a0d9..57559d965 100644 --- a/Moose Development/Moose/Core/Event.lua +++ b/Moose Development/Moose/Core/Event.lua @@ -933,6 +933,15 @@ function EVENT:onEvent( Event ) --Event.WeaponTgtDCSUnit = Event.Weapon:getTarget() end + if Event.idx then + Event.MarkID=Event.idx + Event.MarkVec3=Event.pos + Event.MarkCoordinate=COORDINATE:NewFromVec3(Event.pos) + Event.MarkText=Event.text + Event.MarkCoalition=Event.coalition + Event.MarkGroupID = Event.groupID + end + if Event.cargo then Event.Cargo = Event.cargo Event.CargoName = Event.cargo.Name diff --git a/Moose Development/Moose/Functional/Artillery.lua b/Moose Development/Moose/Functional/Artillery.lua index 1242e44cd..ba6300655 100644 --- a/Moose Development/Moose/Functional/Artillery.lua +++ b/Moose Development/Moose/Functional/Artillery.lua @@ -1003,11 +1003,34 @@ function ARTY:onafterStart(Controllable, From, Event, To) -- Add event handler. self:HandleEvent(EVENTS.Shot, self._OnEventShot) self:HandleEvent(EVENTS.Dead, self._OnEventDead) + self:HandleEvent(EVENTS.MarkAdded, self._OnEventMarkAdded) + + -- Add DCS event handler. + world.addEventHandler(self) -- Start checking status. self:__Status(self.StatusInterval) end +--- After "Start" event. Initialized ROE and alarm state. Starts the event handler. +-- @param #ARTY self +-- @param #table Event +function ART:onEvent(Event) + + if Event then + + if Event.id==world.event.S_EVENT_MARK_ADDED then + env.info("FF mark added") + elseif Event.id==world.event.S_EVENT_MARK_CHANGE then + env.info("FF mark changed") + elseif Event.id==world.event.S_EVENT_MARK_REMOVED then + env.info("FF mark removed") + end + + end + +end + --- After "Start" event. Initialized ROE and alarm state. Starts the event handler. -- @param #ARTY self function ARTY:_StatusReport() @@ -1159,6 +1182,18 @@ function ARTY:_NuclearBlast(_coord) end +--- Eventhandler for shot event. +-- @param #ARTY self +-- @param Core.Event#EVENTDATA EventData +function ARTY:_OnMarkAdded(EventData) + self:F(EventData) + if EventData.MarkCoordinate then + local coord=EventData.MarkCoordinate --Core.Point#COORDINATE + + coord:SmokeGreen() + end +end + --- Eventhandler for shot event. -- @param #ARTY self -- @param Core.Event#EVENTDATA EventData @@ -2081,6 +2116,8 @@ function ARTY:_Relocate() if _surface~=land.SurfaceType.WATER and _surface~=land.SurfaceType.SHALLOW_WATER then _gotit=true end + -- Increase counter. + _n=_n+1 until _gotit or _n>_nmax -- Assign relocation.