Jump to content

Changing radio presets in the ME


Recommended Posts

Hi BST,

 

I love how you can change the radio presets for the Sabre in the Mission Editor. It would be great if we could do the same with the Mi-8's R-863 and R-828 presets (from what I understand the ones in the ARK-UD are usually left as they are?). Is such a feature considered?

Link to comment
Share on other sites

  • 5 months later...

Oh snap, totally forgot I was supposed to answer you, Lilkiki. Sorry!

 

Anyways, here are some of my older posts regarding setting presets for the two radios:

http://forums.eagle.ru/showpost.php?p=2019797&postcount=4

http://forums.eagle.ru/showpost.php?p=1951035&postcount=39

 

Some of the posters reported that the R-828 is no longer working as of now, but I didn't verify that so I don't know if it's correct.

Link to comment
Share on other sites

It should be easy to do for the Ka-50 as well, though I haven't tried it.

 

First, disclaimer: I take no responsibility for whatever damage this may cause. It worked for me with the current version of the game, it may not work for you or with a different version. Always back up the files you change.

 

Right, so first I added a panelRadio object to the Mi-8MT.lua file, which describes the structure of the form in the radio tab of the editor. The Mi-8MT.lua file lives in the Scripts\Database\helicopters directory inside your DCS World folder. Similar Ka-50.lua file is also there, but files for other aircraft are sometimes in different places, like CoreMods\aircraft\<aircraft name>. I don't know the reason for this.

 

My panelRadio object looks like this:

 

        panelRadio = {
           [1] = {  
               name = _("R-863"),
               range = {min = 100.0, max = 149.0},
               channels = {
                   [1] = { name = _("Channel 1"), default = 120},
                   [2] = { name = _("Channel 2"), default = 121},
                   [3] = { name = _("Channel 3"), default = 122},
                   [4] = { name = _("Channel 4"), default = 123},
                   [5] = { name = _("Channel 5"), default = 124},
                   [6] = { name = _("Channel 6"), default = 125},
                   [7] = { name = _("Channel 7"), default = 126},
                   [8] = { name = _("Channel 8"), default = 127},
                   [9] = { name = _("Channel 9"), default = 128},
                   [10] = { name = _("Channel 10"), default = 129},
                   [11] = { name = _("Channel 11"), default = 130},
                   [12] = { name = _("Channel 12"), default = 131},
                   [13] = { name = _("Channel 13"), default = 132},
                   [14] = { name = _("Channel 14"), default = 133},
                   [15] = { name = _("Channel 15"), default = 134},
                   [16] = { name = _("Channel 16"), default = 135},
                   [17] = { name = _("Channel 17"), default = 136},
                   [18] = { name = _("Channel 18"), default = 137},
                   [19] = { name = _("Channel 19"), default = 138},
                   [20] = { name = _("Channel 20"), default = 139},
               }
           },        
           [2] = {  
               name = _("R-828"),
               range = {min = 20.0, max = 60.0},
               channels = {
                   [1] = { name = _("Channel 1"), default = 20.0, modulation = _("FM")},
                   [2] = { name = _("Channel 2"), default = 21.0, modulation = _("FM")},
                   [3] = { name = _("Channel 3"), default = 22.0, modulation = _("FM")},
                   [4] = { name = _("Channel 4"), default = 23.0, modulation = _("FM")},
                   [5] = { name = _("Channel 5"), default = 24.0, modulation = _("FM")},
                   [6] = { name = _("Channel 6"), default = 25.0, modulation = _("FM")},
                   [7] = { name = _("Channel 7"), default = 26.0, modulation = _("FM")},
                   [8] = { name = _("Channel 8"), default = 27.0, modulation = _("FM")},
                   [9] = { name = _("Channel 9"), default = 28.0, modulation = _("FM")},
                   [10] = { name = _("Channel 10"), default = 29.0, modulation = _("FM")},
               }
           },
       },

I added it to the third argument of the function returned by this script, or more specifically, right after this block of code:

 

       HumanRadio = {
           frequency = 127.5,
           minFrequency = 100,
           maxFrequency = 400,
           modulation = MODULATION_FM
       },    

This should make the radio tab appear for playable Mi-8s in the game... only it won't, because the radio tab can only be enabled for airplanes. Fortunately we can change that easily in another lua file: MissionEditor\modules\me_aircraft.lua.

 

We will be changing function verifyTabs(). Lines 1244 - 1290 should contain this:

           if (__view__ == 'helicopter') then
           
               if (unitTypeDesc.Navpoint_Panel == true) then
                   _tabs:showTab('navPoint')
               else
                   _tabs:hideTab('navPoint')
               end

               if (unitTypeDesc.Fixpoint_Panel == true) then
                   _tabs:showTab('fixPoint')
               else
                   _tabs:hideTab('fixPoint')
               end
               
               _tabs:hideTab('waypoints')
           else
               if ((unitTypeDesc.Waypoint_Panel ~= nil) and (unitTypeDesc.Waypoint_Panel ~= false))    then
                   _tabs:showTab('waypoints')
               else
                   _tabs:hideTab('waypoints')
                   
                   if _tabs:getSelectedTab() == 'waypoints' then
                       _tabs:selectTab('route')
                   end
               end
               _tabs:hideTab('navPoint')
               _tabs:hideTab('fixPoint')
                                                               
               if (unitTypeDesc.panelRadio ~= nil)    then
                   _tabs:showTab('Radio')
                   panel_radio.update()
                   -- ńčíőđîíčçčđóĺě ÷ŕńňîňó
                   local frequency = tonumber(e_frequency:getText())
                   
                   if not frequency then
                       setDefaultRadio(true)
                       frequency = tonumber(e_frequency:getText())
                   end    
                   
                   panel_radio.update()
                   panel_radio.setConnectFrequency(frequency)
               else                    
                   if _tabs:getSelectedTab() == 'Radio' then
                       _tabs:selectTab('route')
                   end     
               end
           [b][color=DarkRed]end[/color][/b]

We want to move the last "end" (the one I marked) in this block to line 1271, right before

if (unitTypeDesc.panelRadio ~= nil)    then

Once we do that, the radio tab and the form in it should be visible in the ME. Now we need to make them work. I have no idea how aircraft like Sabre or Fw-190 read their radio settings from the editor, so I did it the way LNS did it in the MiG-21bis. I'm not sure it's the cleanest way, but it works.

 

Go to Mods\aircraft\Mi-8MTV2\Cockpit\Scripts\Devices_specs\Radio and edit the R-863.lua file:

dofile(LockOn_Options.common_script_path..'Radio.lua')
dofile(LockOn_Options.script_path.."mission_prepare.lua")

local gettext = require("i_18n")
_ = gettext.translate

frequency_dial = {limit = {100E6,399999E3}, dials = {{157,100.0,1E7, shift= 10, limit = {10,40}},{158,10.0,1E6},{159,10.0,1E5},{160,100.0,1E3,limit = {0,100}}}}

innerNoise            = getInnerNoise(2.5E-6, 6)
frequency_accuracy     = 1000.0        --Hz
band_width            = 25E3            --Hz 

power_MW            = 10.0            -- Power in metric range, Watts
power_DMW            = 8.0            -- Power in decimetric range, Watts

agr = {
   input_signal_deviation        = 50.0, --Db
   output_signal_deviation        = 5.0,  --Db
   input_signal_linear_zone     = 10.0,  --Db
   regulation_time                = 0.25, --sec
}

[color=DarkGreen][b]presets = {}
if get_aircraft_mission_data ~= nil then
   local  radio_from_mission = get_aircraft_mission_data("Radio")
   local  radio_1 = radio_from_mission[1]
   if radio_1 then
       for i = 1,20 do
           presets[i] = (radio_1.channels[i] or 131 ) * 1e6
       end
   end
end[/b][/color]

GUI = {
   ranges = {     {min = 100E6, max = 149975E3, step = 25E3}, --Hz
               {min = 220E6, max = 399975E3, step = 25E3} },
   displayName = _('R-863'),
   AM = true,
   FM = true,
   [color=DarkGreen][b]channels = presets,[/b][/color]
}

And R-828.lua:

 

dofile(LockOn_Options.common_script_path..'Radio.lua')
dofile(LockOn_Options.script_path.."mission_prepare.lua")

local gettext = require("i_18n")
_ = gettext.translate

innerNoise            = getInnerNoise(2.5E-6, 6)
frequency_accuracy     = 1000.0        --Hz
band_width            = 25000.0        --Hz (6 dB selectivity)
power                 = 10.0            --Watts

agr = {
   input_signal_deviation        = 50.0, --Db
   output_signal_deviation        = 5.0,  --Db
   input_signal_linear_zone     = 10.0,  --Db
   regulation_time                = 0.25, --sec
}

presets = {}
presets[1] = 21500000.0 -- frequency in Hz
presets[2] = 25675000.0 -- radio Mayak
presets[3] = 27000000.0
presets[4] = 28000000.0
presets[5] = 30000000.0
presets[6] = 32000000.0 
presets[7] = 40000000.0
presets[8] = 50000000.0
presets[9] = 55525000.0
presets[10] = 59975000.0 

[color=DarkGreen][b]if get_aircraft_mission_data ~= nil then
   local  radio_from_mission = get_aircraft_mission_data("Radio")
   local  radio_2 = radio_from_mission[2]
   if radio_2 then
       for i = 1,10 do
           presets[i] = (radio_2.channels[i] or 20 ) * 1e6
       end
   end
end[/b][/color]

ElecConsumerParamsLight = {0.5, true}

GUI = {
   displayName = _('R-828'),
   AM = false,
   FM = true,
}

GUI.channels = presets

--settings 
squelch = true
volume    =    0.5
channel = 0

max_search_time = 5.0


TRANSIVER_FAILURE = 0
ANTENNA_FAILURE = 1
Damage = {    {Failure = TRANSIVER_FAILURE, Element = 4, Integrity_Treshold = 0.3}, 
           {Failure = ANTENNA_FAILURE, Element = 58}}

Adding the bold, green parts. That's all :).


Edited by lmp
  • Like 3
Link to comment
Share on other sites

As ever brilliant job for the research and implementation:thumbup: I originally asked for you to make these files available as download but your instructions seem pretty clear.

 

Just to confirm this does not fix the broken Nav mode on the 828?

i5 8600k@5.2Ghz, Asus Prime A Z370, 32Gb DDR4 3000, GTX1080 SC, Oculus Rift CV1, Modded TM Warthog Modded X52 Collective, Jetseat, W10 Pro 64

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

I figured a description how to do it yourself may remain relevant longer in case there are some minor changes to these files in future versions. Also, this way you can easily apply a similar solution to the R-828 in the Ka-50. I'm glad it worked for you, Cibit :).

Link to comment
Share on other sites

Please allow me to help in a small way. Here is a template mission with 20 presets already programmed into 1 flyable Mi-8

 

R838 Presets

1 Anapa 121.000Mhz

2 Batumi 131.000Mhz

3 Beslan 141.000Mhz

4 Gelendzhik 126.000Mhz

5 Gudata 130.000Mhz

6 Kobuleti 133.000Mhz

7 Krasnodar Centre 122..000Mhz

8 Krasnador Pash 128..000Mhz

9 Krymsk 124.000Mhz

10 Kutasai 134.000Mhz

11 Maykop 125..000Mhz

12 Mineralnye Vody 135.000Mhz

13 Mozdok 137.000Mhz

14 Nalchik 136.000Mhz

15 Novorossiysk 123.000Mhz

16 Senaki 132.000Mhz

17 Sochi Adler 127.000Mhz

18 Sukhumi 129.000Mhz

19 Tblisi Soganlug 139.000Mhz

20 Tblisi Lochini 138.000Mhz

 

No room for Vazani 140.000Mhz

 

Remember you need to switch between dial and memory mode on the centre console

mi8 presets.miz

Screen_150117_140002.thumb.jpg.bb5ef8f192f76528dc21060b401b716a.jpg

Screen_150117_140133.thumb.jpg.6f40559412c599c0a7ef184cb3880e0a.jpg

i5 8600k@5.2Ghz, Asus Prime A Z370, 32Gb DDR4 3000, GTX1080 SC, Oculus Rift CV1, Modded TM Warthog Modded X52 Collective, Jetseat, W10 Pro 64

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

I didn't specify the modulation for the R-863 in the panelRadio object, I think it'll depend on how the FM/AM switch is set. TBH I haven't tested it in FM mode, but that's how it worked when I edited the frequencies manually in the R-863.lua earlier - the radio respected the FM/AM switch whether I was using the dialer or stored channels. The R-828 only works in FM, so I put that modulation in the panelRadio object.

Link to comment
Share on other sites

Cool stuff!

 

Is anyone working on a JSGME compatible mod for this? If not, I'd like to do that. I am thinking of enabling the Ka-50 R-828 to use this, but also the ARK-22. This will probably come in handy when we will be flying over different maps one day.

Similar for the Mi-8 - besides what is already posted here in this thread, are there other radios (comm or nav!) that use preset channels? (I am not really familar with the Mi-8 radios atm)

Link to comment
Share on other sites

There's the ARK-UD which is a type of emergency beacon locator but AFAIK the presets aren't typically (or at all) changed. The set of emergency frequencies programmed is standard - I found the same frequencies we have in the game in a description of the ARK-UD unit from an Antonov transport plane. That's why I didn't mod that in as well.

 

Oh, and I missed one question from Cibit - no, I don't believe this fixes the "nav mode" of the R-828, but I haven't tried it, so maybe by some miracle it does ;).

Link to comment
Share on other sites

Hey Imp.

 

Would you be so kind to share with us your edited files?

 

I have problems editing myself the .lua files.

 

Thanks.

" You must think in russian.."

[sIGPIC][/sIGPIC]

 

Windows 7 Home Premium-Intel 2500K OC 4.6-SSD Samsung EVO 860- MSI GTX 1080 - 16G RAM - 1920x1080 27´

 

Hotas Rhino X-55-MFG Crosswind Rudder Pedals -Track IR 4

Link to comment
Share on other sites

I just put together a JSGME package for the Mi-8 and Ka-50. I didn't do anything with the ARK-22 though.

 

I also set the R-863 with the following defaults (leaving Soganlug as the odd airfield out):

                   [1] = { name = _("Channel 1"), default = 124},        --Krymsk/FC3/AWACS (AM)
                   [2] = { name = _("Channel 2"), default = 121},        --Anapa (AM)
                   [3] = { name = _("Channel 3"), default = 131},        --Batumi (AM)
                   [4] = { name = _("Channel 4"), default = 141},        --Beslan (AM)
                   [5] = { name = _("Channel 5"), default = 126},        --Gelendzhik (AM)
                   [6] = { name = _("Channel 6"), default = 130},        --Gudauta (AM)
                   [7] = { name = _("Channel 7"), default = 133},        --Kobuleti (AM)
                   [8] = { name = _("Channel 8"), default = 122},        --Krasnodar Centre (AM)
                   [9] = { name = _("Channel 9"), default = 128},        --Krasnodar Pash (AM)
                   [10] = { name = _("Channel 10"), default = 134},    --Kutasai (AM)
                   [11] = { name = _("Channel 11"), default = 125},    --Maykop (AM)
                   [12] = { name = _("Channel 12"), default = 135},    --Mineralnye Vody (AM)
                   [13] = { name = _("Channel 13"), default = 137},    --Mozdok (AM)
                   [14] = { name = _("Channel 14"), default = 136},    --Nalchik (AM)
                   [15] = { name = _("Channel 15"), default = 123},    --Novorossiysk (AM)
                   [16] = { name = _("Channel 16"), default = 132},    --Senaki (AM)
                   [17] = { name = _("Channel 17"), default = 127},    --Sochi Adler (AM)
                   [18] = { name = _("Channel 18"), default = 129},    --Sukhumi (AM)
               --  [19] = { name = _("Channel 19"), default = 139},    --Tblisi Soganlug (AM)
                   [19] = { name = _("Channel 19"), default = 138},    --Tblisi Lochini (AM)
                   [20] = { name = _("Channel 20"), default = 140},    --Vazani (AM)

I kept the R-828 defaults as both the Ka-50 and Mi-8 default frequencies respectively, just so that someone who builds a mission with this mod enabled won't force incompatibilities with others if they don't update the frequencies in the R-828.

 

EDIT: file removed; the mod now has its own thread and is available in the DCS User files.


Edited by Home Fries
file removed; mod now available in user files
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...