mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Add Test missions for RADIO
RAD-000 / RAD-001 / RAD-002
This commit is contained in:
parent
8561bced0a
commit
4c7e839ef8
@ -184,7 +184,7 @@ function RADIO:NewGenericTransmission(...)
|
||||
|
||||
self:SetFileName(arg[1])
|
||||
if arg[2] then self:SetFrequency(arg[2]) end
|
||||
if arg[3] then self:SetModualtion(arg[3]) end
|
||||
if arg[3] then self:SetModulation(arg[3]) end
|
||||
if arg[4] then self:SetPower(arg[4]) end
|
||||
|
||||
return self
|
||||
@ -211,7 +211,7 @@ function RADIO:NewUnitTransmission(...)
|
||||
if arg[2] then self:SetSubtitle(arg[2]) end
|
||||
if arg[3] then self:SetSubtitleDuration(arg[3]) end
|
||||
if arg[4] then self:SetFrequency(arg[4]) end
|
||||
if arg[5] then self:SetModualtion(arg[5]) end
|
||||
if arg[5] then self:SetModulation(arg[5]) end
|
||||
if arg[6] then self:SetLoop(arg[6]) end
|
||||
|
||||
return self
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
BASE:TraceOnOff(true)
|
||||
BASE:TraceClass("RADIO")
|
||||
BASE:TraceLevel(3)
|
||||
|
||||
|
||||
local Player = UNIT:FindByName("Player")
|
||||
Player:MessageToAll("MainScript Started 3", 10, "")
|
||||
|
||||
local Static = STATIC:FindByName("CommandCenter")
|
||||
local Transmiter = UNIT:FindByName("Transmiter")
|
||||
|
||||
local Radio = Transmiter:GetRadio()
|
||||
Radio:SetSubtitle(6, "tes")
|
||||
Radio:SetFileName("Noise.ogg")
|
||||
Radio:SetFrequency(251.3)
|
||||
Radio:Broadcast()
|
||||
Binary file not shown.
@ -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,86 @@
|
||||
-- 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.
|
||||
-- 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 (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"
|
||||
|
||||
|
||||
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.
Loading…
x
Reference in New Issue
Block a user