Jump to content

New StreamDeck Plugin


Recommended Posts

Hello, I have a problem.
An additional window opens under "ID lookup" for the buttons, which also contains the installation path for DCS. For me, DCS is not saved on the standard path and every time after the software for SteamDeck has restarted, I have "C: \ Program Files \ Eagle Dynamics \ DCS World" instead of partition G: \ where DCS is saved.
Does anyone have a solution for me?

 

------------

EDIT: Ok, cancel that. That wasn't the problem


Edited by Deadshot
Link to comment
Share on other sites

On 5/13/2020 at 1:07 AM, ctytler said:

Yep, try ID's 2023 and 2024. Another thing that can be helpful when searching for display values is set them to a recognizable number or letter (i.e. not 0 or 1), then click the "DCS Comms" button in the Streamdeck and "Refresh" while DCS is running for a print out of most recent data values. If you scroll to the bottom you should generally see the IDs for radios/comms/displays based on their value. For example, look for something like "X16" to spot the TACAN display easily.

That's how I usually go about finding them, as in the AV8BNA.lua they're called "lUFC_Chnl1" which isn't intuitive to search for.

 

I've been trying to set up the COMM 1 and COMM 2 displays in the Harrier following this, but they just refuse to work. I have checked the export script, and these lines are in there, so no sure what's going on:

 

ExportScript.Tools.SendData(2023, string.format("%s", lUFC_Chnl1)) -- string with max 2 charachters
    ExportScript.Tools.SendData(2024, string.format("%s", lUFC_Chnl2)) -- string with max 2 charachters
    ExportScript.Tools.SendData(2025, string.format("%s", lUFC_Display)) -- string with max 8 charachters

 

I've set the DCS ID for Title Text Change to 2023, and left "display string unaltered" checked. DCS IDs 2023-2024 are blank in the DCS COMMS window. The values for the ODUs in the DCS COMMS are also blank, even though they are exporting correctly to the streamdeck.

 

As an example, this is how things appear if I bring up the TCN options:

 

7ViCQYz.png

 

However, if I try to display the radios I get this:

 

1y5V2Tv.png

 

As you can see, the ODUs for the TCN show up in DCS COMMS, but the radios don't, so something odd seems to be happening here. Getting the radio channels works fine for me in the F-18. Its just the Harrier that's confusing me. Does anyone have any clever suggestions?


Edited by frostycab
Link to comment
Share on other sites

On 3/1/2021 at 11:05 AM, ijsman said:

No ;o(

I've just checked this and for most exports it does seem to work. I've checked through the whole UFC and CDU so far, and the only thing that didn't work was the SPC button on the CDU, so I'm guessing some of the exports have changed slightly. In this case its not a problem as I just rebound it to trigger the SPC key on the UFC again. Will have to work through the other bindings to see if the rest of the exports match up.

Link to comment
Share on other sites

Hello All,

 

I'm trying to modify the F16 Export Script to allow the export of the chaff & flare amounts to a Streamdeck profile.

So far I have looked at how it is achieved on the A10 (extract below) - seems to involve the creation of a table to display CMSP values, 2014 = Chaff and 2015 = Flare - but I'm not sure how to proceed for the F16.

What is the significance of "if mainPanelDevice:get_argument_value(364) > 0" and are there any other lua files I need to be exploring?

 

I would be very grateful for any advice.

 

Thanks.

 

-- A-10C CMSP
    -------------------------------------------------
    if mainPanelDevice:get_argument_value(364) > 0 then
        local lCMSP = ExportScript.Tools.getListIndicatorValue(7)
        
        local lCMSPTable = {"","","",""}
        
        if lCMSP ~= nil and lCMSP.txt_UP ~= nil then
            lCMSP.txt_UP = lCMSP.txt_UP:gsub("  ", " ")
            lCMSP.txt_UP = lCMSP.txt_UP.." "
            lCMSPTable  = ExportScript.Tools.split(lCMSP.txt_UP, "%s")
        end
        
        --ExportScript.Tools.WriteToLog('lCMSP: '..ExportScript.Tools.dump(lCMSP))
        --ExportScript.Tools.WriteToLog('lCMSPTable: '..ExportScript.Tools.dump(lCMSPTable))
        
        ExportScript.Tools.SendData(2014,  string.format("%s", lCMSPTable[1]))
        ExportScript.Tools.SendData(2015,  string.format("%s", lCMSPTable[2]))
        ExportScript.Tools.SendData(2016,  string.format("%s", lCMSPTable[3]))
        ExportScript.Tools.SendData(2017,  string.format("%s", lCMSPTable[4]))
        ExportScript.Tools.SendData(2018,  string.format("%s", lCMSP.txt_DOWN1))
        ExportScript.Tools.SendData(2019,  string.format("%s", lCMSP.txt_DOWN2))
        ExportScript.Tools.SendData(2020,  string.format("%s", lCMSP.txt_DOWN3))
        ExportScript.Tools.SendData(2021,  string.format("%s", lCMSP.txt_DOWN4))
    else
        ExportScript.Tools.SendData(2014,  " ")
        ExportScript.Tools.SendData(2015,  " ")
        ExportScript.Tools.SendData(2016,  " ")
        ExportScript.Tools.SendData(2017,  " ")
        ExportScript.Tools.SendData(2018,  " ")
        ExportScript.Tools.SendData(2019,  " ")
        ExportScript.Tools.SendData(2020,  " ")
        ExportScript.Tools.SendData(2021,  " ")
    end    

Link to comment
Share on other sites

On 3/4/2021 at 11:47 AM, frostycab said:

I've just checked this and for most exports it does seem to work. I've checked through the whole UFC and CDU so far, and the only thing that didn't work was the SPC button on the CDU, so I'm guessing some of the exports have changed slightly. In this case its not a problem as I just rebound it to trigger the SPC key on the UFC again. Will have to work through the other bindings to see if the rest of the exports match up.

Okidoki. will trey again ;o)

Link to comment
Share on other sites

3 hours ago, Tess said:

What is the significance of "if mainPanelDevice:get_argument_value(364) > 0" and are there any other lua files I need to be exploring?

 

 Going to start this with a disclaimer that I don't understand 99.9% of the stuff in the export scripts and have virtually no knowledge of LUA. 😛

 

From a layman's point of view, it looks to me as though this line is checking to see if the CMSP Mode Selector dial is in any other position than OFF. In the export script for the A-10C I found this:

 

[364] = "%0.1f",   -- PNT-LEV-CMSP-MODE (Master CMS Mode Select)

 

So I'm guessing that if the selector is off the script won't send any data to the streamdeck, but when the CMSP is in Standby or on the exports 2014-2021 will be available.

 

Someone please correct me if I'm wrong. I'm trying to understand all this too.

 

Link to comment
Share on other sites

On 3/6/2021 at 4:03 AM, Tess said:

Thanks for the info!  I’ll get digging....

Hello
I can see the chaff and flares below.
I don't understand lua well, so there may be a problem.

----------------------------------------------------------

local CMDS_Amount = ExportScript.Tools.getListIndicatorValue(16)

if CMDS_Amount ~= nil and CMDS_Amount.CMDS_CH_Amount ~= nil then 
    CH_Amount = CMDS_Amount.CMDS_CH_Amount
else
    if CMDS_Amount == nil then
    CH_Amount = ""
    CMDS_Amount = "CMDS_Amount"
    end
  
  if CMDS_Amount.CMDS_CH_Amount == nil then
        CH_Amount = ""
    else
     CH_Amount = CMDS_Amount.CMDS_CH_Amount
    end
end

if CMDS_Amount ~= nil and CMDS_Amount.CMDS_FL_Amount ~= nil then 
    FL_Amount = CMDS_Amount.CMDS_FL_Amount
else
    if CMDS_Amount == nil then
    Fl_Amount = ""
    CMDS_Amount = "CMDS_Amount"
    end
  
  if CMDS_Amount.CMDS_FL_Amount == nil then
        FL_Amount = ""
    else
     FL_Amount = CMDS_Amount.CMDS_FL_Amount
    end
end

        ExportScript.Tools.SendData(2000, string.format("%-2s",CH_Amount)) --
        ExportScript.Tools.SendData(2001, string.format("%-2s",FL_Amount)) --

----------------------------------------------------------------------------------------

 

 

Link to comment
Share on other sites

1 hour ago, ohma said:

Hello
I can see the chaff and flares below.
I don't understand lua well, so there may be a problem.

----------------------------------------------------------

local CMDS_Amount = ExportScript.Tools.getListIndicatorValue(16)

if CMDS_Amount ~= nil and CMDS_Amount.CMDS_CH_Amount ~= nil then 
    CH_Amount = CMDS_Amount.CMDS_CH_Amount
else
    if CMDS_Amount == nil then
    CH_Amount = ""
    CMDS_Amount = "CMDS_Amount"
    end
  
  if CMDS_Amount.CMDS_CH_Amount == nil then
        CH_Amount = ""
    else
     CH_Amount = CMDS_Amount.CMDS_CH_Amount
    end
end

if CMDS_Amount ~= nil and CMDS_Amount.CMDS_FL_Amount ~= nil then 
    FL_Amount = CMDS_Amount.CMDS_FL_Amount
else
    if CMDS_Amount == nil then
    Fl_Amount = ""
    CMDS_Amount = "CMDS_Amount"
    end
  
  if CMDS_Amount.CMDS_FL_Amount == nil then
        FL_Amount = ""
    else
     FL_Amount = CMDS_Amount.CMDS_FL_Amount
    end
end

        ExportScript.Tools.SendData(2000, string.format("%-2s",CH_Amount)) --
        ExportScript.Tools.SendData(2001, string.format("%-2s",FL_Amount)) --

----------------------------------------------------------------------------------------

 

 

 

If you're just trying to display the remain chaff and flares on the streamdeck, then looking at this all you'd need to do is set the Title Text Change parameter to 2000 and 2001 for the buttons you're trying to use. Is that what you're after?

Link to comment
Share on other sites

On 3/12/2021 at 3:57 PM, ohma said:

Hello
I can see the chaff and flares below.
I don't understand lua well, so there may be a problem.

----------------------------------------------------------

local CMDS_Amount = ExportScript.Tools.getListIndicatorValue(16)

if CMDS_Amount ~= nil and CMDS_Amount.CMDS_CH_Amount ~= nil then 
    CH_Amount = CMDS_Amount.CMDS_CH_Amount
else
    if CMDS_Amount == nil then
    CH_Amount = ""
    CMDS_Amount = "CMDS_Amount"
    end
  
  if CMDS_Amount.CMDS_CH_Amount == nil then
        CH_Amount = ""
    else
     CH_Amount = CMDS_Amount.CMDS_CH_Amount
    end
end

if CMDS_Amount ~= nil and CMDS_Amount.CMDS_FL_Amount ~= nil then 
    FL_Amount = CMDS_Amount.CMDS_FL_Amount
else
    if CMDS_Amount == nil then
    Fl_Amount = ""
    CMDS_Amount = "CMDS_Amount"
    end
  
  if CMDS_Amount.CMDS_FL_Amount == nil then
        FL_Amount = ""
    else
     FL_Amount = CMDS_Amount.CMDS_FL_Amount
    end
end

        ExportScript.Tools.SendData(2000, string.format("%-2s",CH_Amount)) --
        ExportScript.Tools.SendData(2001, string.format("%-2s",FL_Amount)) --

----------------------------------------------------------------------------------------

Hi,

 

Just got round to trying this out and it works a treat.

 

Thank you so much!


Edited by Tess
Link to comment
Share on other sites

  • 2 weeks later...
  • ED Team

Hi all

 

I've done all the steps, but I can't get this to work.

Everything has been checked and double checked.

The one thing that bugged me is this: I don't think the exporter is working at all since there's no log file created.

Refresh
 

DCS module not detected.

Check that DCS mission is running, there is a .lua script for the module within "DCS-ExportScript\ExportsModules\", and the port settings above match those in "DCS-ExportScript\Config.lua"

on the DCS.log:

 

2021-03-26 22:24:53.174 ALERT   EDCORE: Can't execute Lua file C:\Users\thegl\Saved Games\DCS.openbeta\Scripts\Export.lua - [string "C:\Users\thegl\Saved Games\DCS.openbeta\Scripts\Export.lua"]:2: unexpected symbol near ')'
 

Can someone help me?


Edited by 701

dcsvader.png
Esquadra 701 - DCS Portugal - Discord

Link to comment
Share on other sites

  • ED Team
1 hour ago, 701 said:

Hi all

 

I've done all the steps, but I can't get this to work.

Everything has been checked and double checked.

The one thing that bugged me is this: I don't think the exporter is working at all since there's no log file created.

Refresh
 

DCS module not detected.

Check that DCS mission is running, there is a .lua script for the module within "DCS-ExportScript\ExportsModules\", and the port settings above match those in "DCS-ExportScript\Config.lua"

on the DCS.log:

 

2021-03-26 22:24:53.174 ALERT   EDCORE: Can't execute Lua file C:\Users\thegl\Saved Games\DCS.openbeta\Scripts\Export.lua - [string "C:\Users\thegl\Saved Games\DCS.openbeta\Scripts\Export.lua"]:2: unexpected symbol near ')'
 

Can someone help me?

 

I figured it out.

I was using the F-16. There's no F-16.lua in the ExportsModules. So I guess this particular exporter doesn't work with the plane I fly.

I'll just uninstall and try DCS-Bios

dcsvader.png
Esquadra 701 - DCS Portugal - Discord

Link to comment
Share on other sites

I don't think I'm understanding your probllem @701

 

In my ExportsModules I have a file F-16C_50.lua, now I cannot remember if I got that off the forum or it's an ED file (I think it's an ED file though)

 

I haven't attempted what you're trying to achieve but I have a very quick and dirty profile for the Viper using Cytler's tool for the StreamDeck and last I checked it was all working fine

Link to comment
Share on other sites

On 3/27/2021 at 12:12 AM, 701 said:

I figured it out.

I was using the F-16. There's no F-16.lua in the ExportsModules. So I guess this particular exporter doesn't work with the plane I fly.

I'll just uninstall and try DCS-Bios

You can download the F-16 script here

 

Link to comment
Share on other sites

New Streamdeck XL user here -- I seem to be missing something; no matter which profile I load (I've downloaded several), I can get the buttons to register outside of DCS (e.g. F1, F2, etc.) but when I go into DCS, nothing registers.  It's like DCS isn't seeing the output from the Streamdeck at all.  I've tried both windowed and fullscreen DCS and neither one works.  I've also tried setting a default profile in the Streamdeck app, and setting a profile to go along with DCS.exe -- all to no avail.  Am I missing something obvious here?

Link to comment
Share on other sites

I should clarify that the test I'm doing should not depend on DCS-BIOS or DCS-ExportScript or anything like that, as I'm simply trying to get the function keys recognized by DCS.  I start new profile in Streamdeck, set keys to F1-12, and they work in other programs like Notepad++.  But in DCS, they're not being seen.

Link to comment
Share on other sites

On 3/29/2021 at 2:27 AM, GregP said:

New Streamdeck XL user here -- I seem to be missing something; no matter which profile I load (I've downloaded several), I can get the buttons to register outside of DCS (e.g. F1, F2, etc.) but when I go into DCS, nothing registers.  It's like DCS isn't seeing the output from the Streamdeck at all.  I've tried both windowed and fullscreen DCS and neither one works.  I've also tried setting a default profile in the Streamdeck app, and setting a profile to go along with DCS.exe -- all to no avail.  Am I missing something obvious here?

 

Check if you're running the Streamdeck software as an administrator in Windows. I ran into this when I first got mine. If DCS is running in admin mode then the Streamdeck software needs to be run as admin as well, and vice versa if I recall correctly.

Link to comment
Share on other sites

7 hours ago, frostycab said:

 

Check if you're running the Streamdeck software as an administrator in Windows. I ran into this when I first got mine. If DCS is running in admin mode then the Streamdeck software needs to be run as admin as well, and vice versa if I recall correctly.

 

Wow, I hadn't previously bothered to see if there was a mismatch between how I was running DCS and SD -- turned out I had set DCS to run in Admin mode at some point, and apparently this was conflicting with external apps' ability to feed keypresses into DCS.  Turned off Admin mode and viola, SD is now working!  Thank you!

  • Like 1
Link to comment
Share on other sites

  • ED Team

Hey all, just an update. I managed to find a F-16C lua file and it's now working. I ended up making my own programming

 

I did mess around with DCS Bios but It was causing some tremendous frame rate drops. Which is ironic since they claim it doesn't on the documentation.

It does. And it's pretty noticeable, about 10fps on the ground on average...

 

This is, of course, my experience, your mileage may vary.

 

Cheers and thanks for this plugin. It's now working fine.

dcsvader.png
Esquadra 701 - DCS Portugal - Discord

Link to comment
Share on other sites

On 2/23/2021 at 10:50 AM, frostycab said:

 

I've been trying to set up the COMM 1 and COMM 2 displays in the Harrier following this, but they just refuse to work. I have checked the export script, and these lines are in there, so no sure what's going on:

 

ExportScript.Tools.SendData(2023, string.format("%s", lUFC_Chnl1)) -- string with max 2 charachters
    ExportScript.Tools.SendData(2024, string.format("%s", lUFC_Chnl2)) -- string with max 2 charachters
    ExportScript.Tools.SendData(2025, string.format("%s", lUFC_Display)) -- string with max 8 charachters

 

I've set the DCS ID for Title Text Change to 2023, and left "display string unaltered" checked. DCS IDs 2023-2024 are blank in the DCS COMMS window. The values for the ODUs in the DCS COMMS are also blank, even though they are exporting correctly to the streamdeck.

 

As an example, this is how things appear if I bring up the TCN options:

 

7ViCQYz.png

 

However, if I try to display the radios I get this:

 

1y5V2Tv.png

 

As you can see, the ODUs for the TCN show up in DCS COMMS, but the radios don't, so something odd seems to be happening here. Getting the radio channels works fine for me in the F-18. Its just the Harrier that's confusing me. Does anyone have any clever suggestions?

 

 

It appears the text for the channels has a colon character that's messing up the way the data is read over the network. I was able to resolve this by modifying the AVB8NA.lau file and replacing the lines:

 

ExportScript.Tools.SendData(2023, string.format("%s", lUFC_Chnl1)) -- string with max 2 charachters
ExportScript.Tools.SendData(2024, string.format("%s", lUFC_Chnl2)) -- string with max 2 charachters

 

with:

 

ExportScript.Tools.SendData(2023, string.format("%s", lUFC_Chnl1:gsub(':', ''))) -- string with max 2 charachters
ExportScript.Tools.SendData(2024, string.format("%s", lUFC_Chnl2:gsub(':', ''))) -- string with max 2 charachters

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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