diff --git a/Moose Development/Moose/Core/Radio.lua b/Moose Development/Moose/Core/Radio.lua index ebb267d24..1a8f4e77d 100644 --- a/Moose Development/Moose/Core/Radio.lua +++ b/Moose Development/Moose/Core/Radio.lua @@ -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 diff --git a/Moose Test Missions/RAD - Radio/RAD-000 - Radio Test Mission/RAD-000 - Radio Test Mission.lua b/Moose Test Missions/RAD - Radio/RAD-000 - Radio Test Mission/RAD-000 - Radio Test Mission.lua deleted file mode 100644 index 4a4b243e5..000000000 --- a/Moose Test Missions/RAD - Radio/RAD-000 - Radio Test Mission/RAD-000 - Radio Test Mission.lua +++ /dev/null @@ -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() \ No newline at end of file diff --git a/Moose Test Missions/RAD - Radio/RAD-000 - Radio Test Mission/RAD-000 - Radio Test Mission.miz b/Moose Test Missions/RAD - Radio/RAD-000 - Radio Test Mission/RAD-000 - Radio Test Mission.miz deleted file mode 100644 index dd70fc8e3..000000000 Binary files a/Moose Test Missions/RAD - Radio/RAD-000 - Radio Test Mission/RAD-000 - Radio Test Mission.miz and /dev/null differ diff --git a/Moose Test Missions/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.lua b/Moose Test Missions/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.lua new file mode 100644 index 000000000..296604a1d --- /dev/null +++ b/Moose Test Missions/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.lua @@ -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() \ No newline at end of file diff --git a/Moose Test Missions/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.miz b/Moose Test Missions/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.miz new file mode 100644 index 000000000..76b15f06a Binary files /dev/null and b/Moose Test Missions/RAD - Radio/RAD-000 - Transmission from Static/RAD-000 - Transmission from Static.miz differ diff --git a/Moose Test Missions/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.lua b/Moose Test Missions/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.lua new file mode 100644 index 000000000..53b86eccb --- /dev/null +++ b/Moose Test Missions/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.lua @@ -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() \ No newline at end of file diff --git a/Moose Test Missions/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.miz b/Moose Test Missions/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.miz new file mode 100644 index 000000000..eaca4159a Binary files /dev/null and b/Moose Test Missions/RAD - Radio/RAD-001 - Transmission from UNIT or GROUP/RAD-001 - Transmission from UNIT or GROUP.miz differ diff --git a/Moose Test Missions/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua b/Moose Test Missions/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua new file mode 100644 index 000000000..ee8581b55 --- /dev/null +++ b/Moose Test Missions/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua @@ -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 + ) \ No newline at end of file diff --git a/Moose Test Missions/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.miz b/Moose Test Missions/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.miz new file mode 100644 index 000000000..de1730acd Binary files /dev/null and b/Moose Test Missions/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.miz differ