-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added mission Wrapper/Weapon/010-Track-Bomb
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
-- Author: funkyfranky | ||
-- Created: 05.02.2023 | ||
-- Contributors: kaltokri | ||
-- Modified: 01.03.2024 | ||
-- | ||
-- # Documentation: | ||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Weapon.html | ||
-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Wrapper.Group.html | ||
-- | ||
-- # Description: | ||
-- | ||
-- An F-15E is tasked to drop a Mk-82 bomb at the old airfield near Kobuleti. | ||
-- We monitor the SHOT event and track the bomb until it impacts. | ||
-- | ||
-- # Guide: | ||
-- | ||
-- 1. Run the mission and watch the attack. | ||
-- 2. The impact point is marked with red smoke and a mark on the F10 map | ||
|
||
-- Some message on screen. | ||
local text = "Starting Weapon Test mission" | ||
MESSAGE:New( text, 120 ):ToLog():ToAll() | ||
|
||
-- Create an event handler that monitors the SHOT event. | ||
local handler = EVENTHANDLER:New() | ||
handler:HandleEvent( EVENTS.Shot ) | ||
|
||
--- Function called on shot event. | ||
function handler:OnEventShot( EventData ) | ||
local eventdata = EventData --Core.Event#EVENTDATA | ||
|
||
-- Nil check if we have a weapon in the eventdata table. | ||
if eventdata and eventdata.weapon then | ||
|
||
-- Debug info. | ||
MESSAGE:New( string.format( "Captured SHOT Event from unit=%s", eventdata.IniUnitName ), 60 ):ToAll():ToLog() | ||
|
||
-- Create a new WEAPON object from the DCS weapon object in the event data. | ||
local weapon = WEAPON:New( eventdata.weapon ) | ||
|
||
-- Mark impact point on F10 map. | ||
weapon:SetMarkImpact( true ) | ||
|
||
-- Smoke impact point. | ||
weapon:SetSmokeImpact( true ) | ||
|
||
-- Start tracking the weapon. | ||
weapon:StartTrack() | ||
end | ||
end | ||
|
||
-- Active group. | ||
GROUP:FindByName( "F-15E" ):Activate() |
Binary file not shown.