mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Fixes in RADIO Class.
Every method implemented is now functionnal and tested
This commit is contained in:
parent
3754ea6c27
commit
f35269936f
@ -23,7 +23,7 @@ RADIO = {
|
||||
Positionable,
|
||||
FileName = "",
|
||||
Frequency = 0,
|
||||
Modulation = 0,
|
||||
Modulation = radio.modulation.AM,
|
||||
Subtitle = "",
|
||||
SubtitleDuration = 10,
|
||||
Power = 100,
|
||||
@ -74,7 +74,7 @@ function RADIO:NewGenericTransmission(...)
|
||||
self:F2(arg)
|
||||
self.FileName = RADIO:VerifyFileName(arg[1])
|
||||
if arg[2] ~= nil then
|
||||
self.Frequecy = arg[2] * 1000 -- Convert to Hz
|
||||
self.Frequency = arg[2] * 1000 -- Convert to Hz
|
||||
end
|
||||
if arg[3] ~= nil then
|
||||
self.Modulation = arg[3]
|
||||
@ -158,7 +158,7 @@ function RADIO:Broadcast()
|
||||
})
|
||||
else
|
||||
-- If the POSITIONABLE is anything else, we revert to the general function
|
||||
trigger.action.radioTransmission(self.FileName, self.Positionable:PositionVec3(), self.Modulation, 1, self.Frequency, self.Power)
|
||||
trigger.action.radioTransmission(self.FileName, self.Positionable:GetPositionVec3(), self.Modulation, false, self.Frequency, self.Power)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
@ -1,18 +1,10 @@
|
||||
BASE:TraceAll(1)
|
||||
BASE:TraceLevel(3)
|
||||
BASE:TraceLevel(1)
|
||||
local Player = UNIT:FindByName("Player")
|
||||
Player:MessageToAll("MainScript Started 2", 10, "")
|
||||
|
||||
local Transmiter = UNIT:FindByName("Transmiter")
|
||||
local Static = STATIC:FindByName("CommandCenter")
|
||||
|
||||
local TransmiterRadio = Transmiter:GetRadio()
|
||||
TransmiterRadio:NewUnitTransmission("Noise.ogg", "Subtitle", 10, 251000, 0, 0)
|
||||
TransmiterRadio:E({
|
||||
TransmiterRadio.Positionable,
|
||||
TransmiterRadio.FileName,
|
||||
TransmiterRadio.Subtitle,
|
||||
TransmiterRadio.SubtitleDuration,
|
||||
TransmiterRadio.Frequency,
|
||||
TransmiterRadio.Modulation,
|
||||
})
|
||||
TransmiterRadio:Broadcast()
|
||||
local StaticRadio = Static:GetRadio()
|
||||
StaticRadio:NewGenericTransmission("Test Voice.ogg", 251000, radio.modulation.AM, 1000)
|
||||
StaticRadio:Broadcast()
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user