ctytler Posted April 14, 2020 Posted April 14, 2020 Hi I wanted to share a new StreamDeck plugin I've created for DCS https://github.com/charlestytler/streamdeck-dcs-interface DCS Interface is a plugin that allows you to create buttons and interfaces that update with DCS events. It is currently set up to interact with S-D-A's DCS-ExportScript as the backend communication with DCS. There are three settings for each Streamdeck button you create: DCS Command - Specify which button/switch you want to activate in game (allows setting of any clickable object in a cockpit). Supports push-button, switch, and increment (dials, levers, etc.) input types. Image Change Settings - Specify a function within the DCS simulation to monitor and change the display of the Streamdeck image conditionally. Examples: Lamps for Warnings/Modes, Switch states Title Text Change Settings - Specify a function in the DCS simulation which will be monitored and its text is displayed as the Streamdeck button Title. Examples: UFC text displays, scratchpads, radio displays 8 5
DERacing Posted April 14, 2020 Posted April 14, 2020 WOW!!!! Thank you for this! I have 2 SD's, 1 mini and just opened the box on a new XL yesterday! I have some work to do. Completing a new build system now and this is on the list. Thanks again! Intel i7 9700k, 64GB DDR4 (Corsair), Gigabyte Z390 Master, RTX 2080 Ti AMP 11gb, 500GB Sabrent Rocket (System), 1TB XPG Gammix S11 Pro M.2 (DCS), Windows 11 64-bit Pro, Samsung 49" 4K CRG9 Monitor (5120x1440), Samsung Odyssey Plus, TrackIR 5, Thrustmaster Warthog Hotas, Various streamdecks, button boxes, Logitech Pro Rudder Pedals, Corsair K95 Platinum, Iron Claw mouse. DCS OB, F-14B Tomcat, F-18C Hornet, F-16C Viper, A-10C Warthog, F-5 Tiger II, AV-8B Harrier, P-51D Mustang, FC3, Super Carrier Thrustmaster Warthog Hotas, (3) Cougar MFD's, Logitech Pro Rudder Pedals, (2) Stream Decks, (1) Stream Deck XL, (1) Stream Deck Mini, Misc Button Boxes
flyelmo Posted April 14, 2020 Posted April 14, 2020 Thanks for this brilliant plugin, I were looking for this powerful functionality. AAA+++ thank you Sent from my CLT-L29 using Tapatalk ASUS Maximus XI CODE Z390 | I9 9900K (5GHz) | G-Skill TridentZ 32GB 4000MHz | RTX 3090Ti | Creative AE-9 | Samsung 970 EVO PLUS 2TB | VR Headset HP Reverb G2 rev2
BaD CrC Posted April 14, 2020 Posted April 14, 2020 That's a really great plugin you made here ctytler. Quite powerful. Any technical reason why you didn't go the streamline way of DCS BIOS and use another export script? https://www.blacksharkden.com http://discord.gg/blacksharkden
ctytler Posted April 14, 2020 Author Posted April 14, 2020 That's a really great plugin you made here ctytler. Quite powerful. Any technical reason why you didn't go the streamline way of DCS BIOS and use another export script? Thanks. I did look at DCS-BIOS when trying things out, however it seemed geared towards Serial communication with external hardware, such as Arduino boards. The documented API as well seems focused on providing a library of function calls that, while well-documented and understandable, also appeared more suited for a piece of hardware with buttons that have clearly defined functionality. I'm saying "seemed" and "appeared" because that's as far as I got in consideration before looking at the other options. For good measure, I tried installing the DCS-BIOS hub just now, but got to the point where it wants to connect to a COM port to do anything, and I'm not interested in making a virtual COM bus to communicate with it. Some of this may be misunderstanding some of the capability, but that's my perspective as someone who hasn't used DCS-BIOS before. There is also a DCSFlightpanels/dcs-bios fork I came across that has Lua export scripts, but doesn't seem to do anything any more advanced than the other options. The primary examples I had tried working with DCS externally were Ikarus and Helios which provide recreated gauges and virtual recreation of buttons and switches. These were the main examples of user interface I had in mind while creating the Streamdeck interface. The Helios software had a nice GUI, but the Export scripts were all a bit spread out and individually created. Ikarus used an already partitioned Github project, DCS-ExportScript, as it's DCS communication and it had a good collection of scripts for most aircraft defined, including interpretation of strings for module text displays. It also had a simple, but effective, API where it just publishes and receives everything in a {key:value} format over UDP ports. This seemed ideal to communicate with as another program running on the same machine. Both Ikarus and Helios use the same format for their message payloads actually, so I think I can add an option to be able to support both methods. I've also tried to keep the module specifics or things that can get out of date external to the Streamdeck plugin, so at the core everything is set by ID values and the user can edit them if they wish. The way Streamdeck packages its plugins it's not easy to include a set of database files that can be modified (at least not in a way straight-forward for users to edit). I do have ID Lookup done within the program for modules, but I do this by reading directly from the installed module's clickabledata.lua file so it should hopefully be stable with any changed values in updates. For the indicators and lamps, I just rely on users looking them up in their preferred export lua scripts, as I couldn't find a reliable way to extract them from a DCS World installation. However I found, in my use at least, that for most of the buttons I was creating referencing the clickabledata table was sufficient, with occasionally having to reference the export lua.
BaD CrC Posted April 14, 2020 Posted April 14, 2020 Thanks for this detailed explanation! I installed your plugin and the export script. Modified the port in config file to the Streamdeck plugin default one and added the line in my scripts/export.lua. I started to add some momentary switches in my new SD profile. The interface of your plugin is awesome and I REALLY appreciate that you took some time to make video tutorials!! I watched them all. Current issue I have is that the moment I add the ExportScript.lua line in my export.lua, Helios just stop working. Is that a no go to have Helios running along with ExportScript? Thanks. https://www.blacksharkden.com http://discord.gg/blacksharkden
ctytler Posted April 15, 2020 Author Posted April 15, 2020 I actually ran into the same issue in the past with Helios and Ikarus. I just did some testing with them now and for some reason if DCS-ExportScript is included after the Helios include, the Helios doesn't work, but the other way around worked for me. My Export.lua that works looks like: -- load the DCS ExportScript for DAC and Ikarus dofile(lfs.writedir()..[[scripts\DCS-ExportScript\ExportScript.lua]]) local lfs=require('lfs'); dofile(lfs.writedir()..'Scripts\\Helios\\HeliosExport.lua') I was able to get pretty repeatable results switching the order back and forth. You just need to quit and start a mission after modifying the Export.lua, shouldn't need a full restart of DCS if you want to try it. Does that work for you?
BaD CrC Posted April 15, 2020 Posted April 15, 2020 Yes. That did it. Thanks. This export.lua file is becoming a headache with all hose scripts fighting for the top position. Now back to SD programming! https://www.blacksharkden.com http://discord.gg/blacksharkden
rem27 Posted April 15, 2020 Posted April 15, 2020 Hi Ctytler. I installed your plugin for StreamDeck and I watch all your tutorial. What a amazing job you did, I really enjoy your plugin. Thank you very much for your great effort :thumbup: Now Elgado have to make us the possibility to have a three stage icon :music_whistling: Best regards Rem27 Intel® Core i7-7700K @4,20GHz - 64 Go RAM - GeForce GTX 1070 Ti - Windows Pro 64 bit - Stream Deck - HOTAS Warthog
M2K Posted April 16, 2020 Posted April 16, 2020 (edited) That's a great piece of work! The documentation itself is masterpiece! Many thanks! Edited April 16, 2020 by M2K
Manhorne Posted April 17, 2020 Posted April 17, 2020 Looks really good. Excellent work!!!! Unfortunately, the two modules I play are not supported by the DCS- Exportscripts yet (F-14 and F-16). I am going to download and learn it but looks like I will be waiting awhile before I will actually be able to use it.
PVI YANKEE Posted April 17, 2020 Posted April 17, 2020 DCS Interface conflict with TacView in explore.lua Let me first thank Cytler for the great job Here I am just sharing the following issue and hope this can be helpful for the development and also to other users that might happen the same. It is about the export.lua file. DCS interface instruction seems to be in conflict with the TAcview one. Streamdeck does not connect to DCS. Once I remove the Tacview instruction row, everything works fine with streamdeck... but I cannot generate a valid ACMI file to use in tacview :( No other conflict with any other application/instruction (DCS Bios, SRS Radio) Here may export.lua file (with tacview instruction in the last row): -- load the DCS ExportScript for DAC and Ikarus dofile(lfs.writedir()..[[scripts/DCS-ExportScript/ExportScript.lua]]) --- DCS BIOS BIOS = {}; BIOS.LuaScriptDir = [[C:\Program Files\DCS-BIOS\dcs-lua\]]; BIOS.PluginDir = [[C:\Users\paolo\AppData\Roaming/DCS-BIOS/Plugins\]]; if lfs.attributes(BIOS.LuaScriptDir..[[bIOS.lua]]) ~= nil then dofile(BIOS.LuaScriptDir..[[bIOS.lua]]) end --[[DCS-BIOS Automatic Setup]] --- SRS SIMPLE RADIO pcall(function() local dcsSr=require('lfs');dofile(dcsSr.writedir()..[[Mods\Tech\DCS-SRS\Scripts\DCS-SimpleRadioStandalone.lua]]); end,nil); ---TACVIEW local local Tacviewlfs=require('lfs');dofile(Tacviewlfs.writedir()..'Scripts/TacviewGameExport.lua') Cytler can you help me?
SteezyActual Posted April 17, 2020 Posted April 17, 2020 Hey Tyler this is awesome! Question, how can I create .lua scripts for the F14 and JF17? There isn't a .lua in the exports module folder for either aircraft. Thanks again!
Phoenix FR Posted April 17, 2020 Posted April 17, 2020 I'm waiting the F14 lua script and the answer with the problem with tacview. The video tutorial are great, and i'm going to test with a suported modul.
ctytler Posted April 18, 2020 Author Posted April 18, 2020 Hi for questions on the Export tool and .lua scripts for modules within it, I unfortunately only know as much as the instructions provide as I am only a user of the project, and not a developer of it. I also use Tacview and SRS so have an interest in resolving the conflicts, but would be starting from scratch in debugging there. I'll report anything I find (like the trivial re-ordering of includes I reported earlier in the thread), but don't plan to commit time to learning those code-bases in detail. That being said, I am trying to expand compatibility of the Streamdeck plugin to support different sources of Export scripts, so it can communicate also with Helios export scripts if users prefer those. Also, for those asking about adding F14, F16, and JF-17 lua scripts: Please see the wiki for DCS-ExportScript on creating additional modules here https://github.com/s-d-a/DCS-ExportScripts/wiki I also have put up a github repo the clickabledata extraction script I made for the modules that can be run on its own. So if it's helpful in creating the new module lua scripts you can generate a CSV file which can be opened in any spreadsheet software that contains all clickabledata (not including gauges, lamps) Github - DCS Clickabledata Extract One user on reddit reported success for simple creation of one for the JF-17 on reddit here:
Ranma13 Posted April 19, 2020 Posted April 19, 2020 Thanks. I did look at DCS-BIOS when trying things out, however it seemed geared towards Serial communication with external hardware, such as Arduino boards. Sort of, but not really. There are two components, the lua script and the Arduino library. The lua script opens a multicast UDP server on 239.255.50.10, with port 5010 for receiving data from the server and port 7778 for sending it data. The message that it sends is in a binary format and is documented. Unfortunately, like all binary formats, you need to know what each bit/byte stands for, and you'll either decode the message or get back gibberish, but not much in between. DCS BIOS uses this binary format in order to keep the data size down so that it's faster to send to the Arduino via serial, so that's the "sort of" part, but the "not really" part is that it's just binary data, so if you can create a UDP client and parse the binary data, the consumer of the data can be anything, not just an Arduino. I've written a library to parse the binary data and expose it as JSON: https://github.com/danieltian/dcs-bios-api/ But it's a Node library and it looks like your project is in C++. I tried installing the DCS-BIOS hub just now, but got to the point where it wants to connect to a COM port to do anything, and I'm not interested in making a virtual COM bus to communicate with it. The COM port is only needed to communicate with an Arduino. For other apps, you can use a UDP client. The UDP client is set up in the lua script, so you don't need to do anything in the DCS BIOS UI (aside from downloading the correct plugins for the aircraft) to get it working. There is also a DCSFlightpanels/dcs-bios fork I came across that has Lua export scripts, but doesn't seem to do anything any more advanced than the other options. At one point, DCS BIOS development stopped and all work was done in the DCSFlightpanels branch. That's no longer the case, and the installer at https://github.com/dcs-bios/dcs-bios/releases should be used going forward.
PVI_Eagle Posted April 19, 2020 Posted April 19, 2020 GREAT WORK!!!!! This is my panel for AV-8B I also made a profile lamp dedicated to the mobile phoneDCS AV8B INPUT PANEL.zipDCS AV8B LAMP PANEL.zip [sIGPIC][/sIGPIC]
Bedouin Posted April 19, 2020 Posted April 19, 2020 Perfect and thanks a lot, now i maybe finally can start using my SteamDeck ;) .
KonniRichter Posted April 20, 2020 Posted April 20, 2020 (edited) I own a Stream Deck but never used DCS-Bios - ctytler, your plugin looks very promising. I am not at all familiar with DCS bios and thought I could try your plugin cause you did this tutorial videos how to set up. But now I saw that my module is perhaps not supported (DCS-ExportScripts) I want to try with - The FW190 A-8 Anton. Is there a chance to get support for my module I own? I saw that you can export lua for modules, but it seems to be very complicated for me - I am totally noob. Is there an alternative solution for me? Edited April 20, 2020 by KonniRichter
PVI_Eagle Posted April 20, 2020 Posted April 20, 2020 Can I see a modified and continuous map value, such as from a value of 0.000 to a value of 0.0050 = 400 (for example to convert the engine rpm value)? for bf109 = Engine_RPM {400.0, 3600.0} = {0.0, 1.0} [sIGPIC][/sIGPIC]
Capt Zeen Posted April 21, 2020 Posted April 21, 2020 Hey Ctytler! just saw your posts here. I want to try it as soon as i arrive at home! "Capt Zeen, I was also just testing it with your Helios export scripts yesterday, and with some minor modifications to how I initialize the UDP connections it should be simple to enable compatibility with those as well. (The export scripts would still have to add a second port to be used at the same time as Helios)." If you need info about how i use the exports in Helios, let me know. Thanks for your work. Capt_Zeen_HELIOS PROFILES_WEBSITE Capt_Zeen_Youtube Channel
PVI_Eagle Posted April 21, 2020 Posted April 21, 2020 DCS BF-109 PANEL BF-109 STREAM DECK PANEL with working lamps ...DCS BF109 .zip [sIGPIC][/sIGPIC]
goldleader Posted April 23, 2020 Posted April 23, 2020 Let me first thank Cytler for the great job Here I am just sharing the following issue and hope this can be helpful for the development and also to other users that might happen the same. It is about the export.lua file. DCS interface instruction seems to be in conflict with the TAcview one. Streamdeck does not connect to DCS. Once I remove the Tacview instruction row, everything works fine with streamdeck... but I cannot generate a valid ACMI file to use in tacview :( No other conflict with any other application/instruction (DCS Bios, SRS Radio) Here may export.lua file (with tacview instruction in the last row): -- load the DCS ExportScript for DAC and Ikarus dofile(lfs.writedir()..[[scripts/DCS-ExportScript/ExportScript.lua]]) --- DCS BIOS BIOS = {}; BIOS.LuaScriptDir = [[C:\Program Files\DCS-BIOS\dcs-lua\]]; BIOS.PluginDir = [[C:\Users\paolo\AppData\Roaming/DCS-BIOS/Plugins\]]; if lfs.attributes(BIOS.LuaScriptDir..[[bIOS.lua]]) ~= nil then dofile(BIOS.LuaScriptDir..[[bIOS.lua]]) end --[[DCS-BIOS Automatic Setup]] --- SRS SIMPLE RADIO pcall(function() local dcsSr=require('lfs');dofile(dcsSr.writedir()..[[Mods\Tech\DCS-SRS\Scripts\DCS-SimpleRadioStandalone.lua]]); end,nil); ---TACVIEW local local Tacviewlfs=require('lfs');dofile(Tacviewlfs.writedir()..'Scripts/TacviewGameExport.lua') Hi, I don't know if this will help but this is my Export.lua using TacView, DCSBios (Facepanels Version) SRS and VAICOM, I found that the order in which everything goes in the export.lua makes adifference, I am not sure why mine works in this order, but everything is working like this. local dcsbioslfs = require('lfs'); dofile(dcsbioslfs.writedir()..[[scripts\DCS-BIOS\BIOS.lua]]) --BIOS = {}; BIOS.LuaScriptDir = [[C:\Program Files\DCS-BIOS\dcs-lua\]]; BIOS.PluginDir = [[D:\Users\Matt\AppData\Roaming/DCS-BIOS/Plugins\]]; if lfs.attributes(BIOS.LuaScriptDir..[[bIOS.lua]]) ~= nil then dofile(BIOS.LuaScriptDir..[[bIOS.lua]]) end --[[DCS-BIOS Automatic Setup]] local tacviewlfs=require('lfs');dofile(tacviewlfs.writedir()..'Scripts/TacviewGameExport.lua') local vaicomlfs = require('lfs'); dofile(vaicomlfs.writedir()..[[scripts\VAICOMPRO\VAICOMPRO.export.lua]]) -- load the DCS ExportScript for DAC and Ikarus local dcsexportlfs = require('lfs'); dofile(dcsexportlfs.writedir()..[[scripts\DCS-ExportScript\ExportScript.lua]]) pcall(function() local dcsSr=require('lfs');dofile(dcsSr.writedir()..[[Mods\Tech\DCS-SRS\Scripts\DCS-SimpleRadioStandalone.lua]]); end,nil); Also I did notice you have local twice before the tacview line in your post of your export.lua Hope this is of some help AMD 9800X3D CPU @ 5.1GHz, Win11 Pro 64bit, Gigabyte X870E AORUS MASTER Mobo, G.Skill Trident Z5 Neo RGB 64GB 600Mhz Ram, 1 x Samsung 990EVO 2Tb .m2 (DCS), 1 x ADATA SX8200 Pro 1Tb Drive (OS), 1 x RTX 2080Ti AORUS Waterforce 11Gb, 3 x 27" ACER Predator 2560x1440px, 27" LG 2560x1440px, HP Reverb G2, TrackIR5, HOTAS Warthog Throttle and Stick, Thrustmaster TPR, 3 x HOTAS Cougar MFCDs, Elgato Streamdeck, Streamdeck XL & Streamdeck+
Recommended Posts