mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'refs/remotes/origin/master' into FlightControl
# Conflicts: # Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua # Moose Mission Setup/Moose.lua
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
-- This test mission demonstrates the RADIO class, particularily when the transmiter is anything but a UNIT or a GROUP (a STATIC in this case)
|
||||
-- The Player is in a Su25T parked on Batumi, and a Russian command center named "Russian Command Center" is placed 12km east of Batumi.
|
||||
|
||||
-- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important.
|
||||
-- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here)
|
||||
|
||||
CommandCenter = STATIC:FindByName("Russian Command Center")
|
||||
|
||||
-- Let's get a reference to the Command Center's RADIO
|
||||
CommandCenterRadio = CommandCenter:GetRadio()
|
||||
|
||||
-- Now, we'll set up the next transmission
|
||||
CommandCenterRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound,
|
||||
CommandCenterRadio:SetFrequency(108) -- then a frequency in MHz,
|
||||
CommandCenterRadio:SetModulation(radio.modulation.AM) -- a modulation (we use DCS' enumartion, this way we don't have to type numbers)...
|
||||
CommandCenterRadio:SetPower(100) -- and finally a power in Watts. A "normal" ground TACAN station has a power of 120W.
|
||||
|
||||
-- We have finished tinkering with our transmission, now is the time to broadcast it !
|
||||
CommandCenterRadio:Broadcast()
|
||||
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
-- This test mission demonstrates the RADIO class, particularily when the transmiter is a UNIT or a GROUP
|
||||
-- The Player is in a Su25T parked on Batumi, and a Russian MiG-29 creatively named "Sergey" is placed above Kobuleti and is
|
||||
-- inbound for a landing on Batumi
|
||||
|
||||
-- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important.
|
||||
-- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (108AM here)
|
||||
|
||||
Sergey = UNIT:FindByName("Sergey")
|
||||
|
||||
-- Let's get a reference to Sergey's RADIO
|
||||
SergeyRadio = Sergey:GetRadio()
|
||||
|
||||
-- Now, we'll set up the next transmission
|
||||
SergeyRadio:SetFileName("Noise.ogg") -- We first need the file name of a sound,
|
||||
SergeyRadio:SetFrequency(108) -- then a frequency in MHz,
|
||||
SergeyRadio:SetModulation(radio.modulation.AM) -- and a modulation (we use DCS' enumartion, this way we don't have to type numbers).
|
||||
|
||||
-- Since Sergey is a UNIT, we can add a subtitle (displayed on the top left) to the transmission, and loop the transmission
|
||||
SergeyRadio:SetSubtitle("Hey, hear that noise ?", 5) -- The subtitle "Noise" will be displayed for 5 secs
|
||||
SergeyRadio:SetLoop(false)
|
||||
|
||||
-- Notice that we didn't have to imput a power ? If the broadcater is a UNIT or a GROUP, DCS automatically guesses the power to use depending on the type of UNIT or GROUP
|
||||
|
||||
-- We have finished tinkering with our transmission, now is the time to broadcast it !
|
||||
SergeyRadio:Broadcast()
|
||||
Binary file not shown.
@@ -0,0 +1,91 @@
|
||||
-- This test mission demonstrates the RADIO class in a practical scenario.
|
||||
-- It also focuses on how to create transmissions faster and more efficiently
|
||||
-- Please Read both RAD-000 and RAD-001, as well as SCH-000 code first.
|
||||
|
||||
-- Note that if you are not using an ASM aircraft (a clickable cockpit aircraft), then the frequency and the modulation is not important.
|
||||
-- If you want to test the mission fully, replance the SU25T by an ASM aircraft you own and tune to the right frequency (115AM here)
|
||||
|
||||
-- The Player is in a Su25T parked on Batumi, and a Russian command center named "Batumi Tower" placed near Batumi will act as Batumi's Radio Tower.
|
||||
-- This mission also features the "Viktor" flight, a Russian Su25, who is inbound for landing on Batumi.
|
||||
-- The goal of this script is to manage the dialog between Viktor and Batumi Tower.
|
||||
|
||||
-- The (short) conversation between Viktor and Batumi Tower will happen on 115 AM
|
||||
-- Time 0 : Batumi Tower "Viktor flight, this is Batumi Tower, enter left base runway one two five, report 5 kilometers final. Over."
|
||||
-- Time 10 : Viktor "Report 5 kilometers final, one two five, viktor"
|
||||
-- Time 145 : Viktor "Batumi Tower, Viktor is 5 kilomters final, request landing clearance. Over?"
|
||||
-- Time 154 : Batumi Tower "Viktor flight, you are claer to land, runway one two five. Check gear down."
|
||||
-- Time 160 : Viktor "Clear to land, One two five, Viktor"
|
||||
-- Time 210 : Viktor "Viktor, touchdown"
|
||||
-- Time 215 : Batumi Tower "Viktor, confirmed touchdown, taxi to parking area, Batumi Tower out."
|
||||
|
||||
|
||||
BatumiRadio = STATIC:FindByName("Batumi Tower"):GetRadio()
|
||||
ViktorRadio = UNIT:FindByName("Viktor"):GetRadio()
|
||||
|
||||
-- Let's first explore different shortcuts to setup a transmission before broadcastiong it
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- First, the long way.
|
||||
BatumiRadio:SetFileName("Batumi Tower - Enter left base.ogg")
|
||||
BatumiRadio:SetFrequency(115)
|
||||
BatumiRadio:SetModulation(radio.modulation.AM)
|
||||
BatumiRadio:SetPower(100)
|
||||
|
||||
-- Every RADIO.SetXXX() function returns the radio, so we can rewrite the code above this way :
|
||||
BatumiRadio:SetFileName("Batumi Tower - Enter left base.ogg"):SetFrequency(115):SetModulation(radio.modulation.AM):SetPower(100)
|
||||
|
||||
-- We can also use the shortcut RADIO:NewGenericTransmission() to set multiple parameters in one function call
|
||||
-- If our broadcaster was a UNIT or a GROUP, the more appropriate shortcut to use would have been NewUnitTransmission()
|
||||
-- it works for both UNIT and GROUP, despite its name !
|
||||
BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115, radio.modulation.AM, 100)
|
||||
|
||||
-- If you already set some parameters previously, you don't have to redo it !
|
||||
-- NewGenericTransmission's paramter have to be set in order
|
||||
BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115) -- Modulation is still AM and power is still 100 (set previously)
|
||||
|
||||
--If you want to change only the sound file, the frequency and the power for exemple, you can still use the appropriate Set function
|
||||
BatumiRadio:NewGenericTransmission("Batumi Tower - Enter left base.ogg", 115):SetPower(100)
|
||||
|
||||
-- We have finished tinkering with our transmission, now is the time to broadcast it !
|
||||
BatumiRadio:Broadcast()
|
||||
|
||||
-- Now, if Viktor answered imedately, the two radio broadcasts would overlap. We need to delay Viktor's answer.
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
ViktorRadio:SetFileName("Viktor - Enter left base ack.ogg"):SetFrequency(115):SetModulation(radio.modulation.AM):Broadcast() -- We don't specify a subtitle since we don't want one
|
||||
end, {}, 10 -- 10s delay
|
||||
)
|
||||
|
||||
-- Viktor takes 145s to be 5km final, and need to contact Batumi Tower.
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
ViktorRadio:SetFileName("Viktor - Request landing clearance.ogg"):Broadcast() --We only specify the new file name, since frequency and modulation didn't change
|
||||
end, {}, 145
|
||||
)
|
||||
|
||||
-- Now that you understand everything about the RADIO class, the rest is pretty trivial
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
BatumiRadio:SetFileName("Batumi Tower - Clear to land.ogg"):Broadcast()
|
||||
end, {}, 154
|
||||
)
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
ViktorRadio:SetFileName("Viktor - Clear to land ack.ogg"):Broadcast()
|
||||
end, {}, 160
|
||||
)
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
ViktorRadio:SetFileName("Viktor - Touchdown.ogg"):Broadcast()
|
||||
end, {}, 210
|
||||
)
|
||||
|
||||
SCHEDULER:New( nil,
|
||||
function()
|
||||
BatumiRadio:SetFileName("Batumi Tower - Taxi to parking.ogg"):Broadcast()
|
||||
end, {}, 215
|
||||
)
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user