ArturDCS Posted August 29, 2014 Share Posted August 29, 2014 I am doing some initial research on how to communicate with DCS over TCP/UDP sockets. I have found bits and pieces around the forum but nothing comprehensive. The areas then I need documentation for is: Opening/closing socket communication with DCS Sending/receiving parameters What parameters are available? Open & existing code would be really helpful regardless of programming language. If I start this project I will include the radio panel into the existing switch panel software. Any help greatly appreciated! Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
Reksi-Erkki Posted August 29, 2014 Share Posted August 29, 2014 Have you seen this? https://www.digitalcombatsimulator.com/en/dev_journal/lua-export/ Dear Shilka. I hate you so very very much. Love, Rex Link to comment Share on other sites More sharing options...
ArturDCS Posted August 29, 2014 Author Share Posted August 29, 2014 Have you seen this? https://www.digitalcombatsimulator.com/en/dev_journal/lua-export/ Excellent, I will have a looksy at that. Looks good. Thanks! Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
TigersharkBAS Posted August 29, 2014 Share Posted August 29, 2014 Excellent, I will have a looksy at that. Looks good. Thanks! You could also check the wiki in my signature. [sIGPIC][/sIGPIC] Creator of: F-18C VFA-195 "Dambusters" 1998 CAG Livery https://forums.eagle.ru/showthread.php?t=213788 F-18C VFA-195 "Dambusters" July 2001 CAG Livery https://forums.eagle.ru/showthread.php?t=215950 Pilot avatars for DCS Logbook https://forums.eagle.ru/showthread.php?t=221160 How to make a DCS A-10C Panel http://forums.eagle.ru/showthread.php?t=65998 Link to comment Share on other sites More sharing options...
ArturDCS Posted August 30, 2014 Author Share Posted August 30, 2014 You could also check the wiki in my signature. Great, Wiki bookmarked! Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
ArturDCS Posted August 31, 2014 Author Share Posted August 31, 2014 What if a user needs to export data from DCS to multiple softwares? Perhaps the best way is to have a textbox in my application containing the Lua the user needs to copy & paste into their own export.lua for my software to work. Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
ArturDCS Posted September 1, 2014 Author Share Posted September 1, 2014 Any help greatly appreciated! Day off (sick) and trying to test the Export.lua with simple file exporting. Non steam installation, where is the Export.lua supposed to be and where should Config.lua be? I just can't get any (test) exports going? I have seen references to both config.lua and Config.lua. And the comment inside Export.lua : " -- Please, set EnableExportScript = true in the Config/Export/Config.lua file -- to activate this script!" Now which Config.lua would that be? I do not have any Config/Export dir structure in my installation and the Export.lua is supposed to be copied to the user directory structure for DCS!? So that means what in regards of "Config/Export/Config.lua"? I tried : C:\Users\<user>\Saved Games\DCS\Scripts\Export.lua D:\Eagle Dynamics\DCS World\Config\Export\Config.lua (created that dir per info found on forum) DCS 1.2.8 Testing with the UH-1H module Export.lua: --- DO NOT EDIT. --- This file is for reference purposes only --- All user modifications should go to $HOME\Saved Games\DCS\Scripts\Export.lua -- Data export script for Lock On version 1.2. -- Copyright (C) 2006, Eagle Dynamics. -- See http://www.lua.org for Lua script system info -- We recommend to use the LuaSocket addon (http://www.tecgraf.puc-rio.br/luasocket) -- to use standard network protocols in Lua scripts. -- LuaSocket 2.0 files (*.dll and *.lua) are supplied in the Scripts/LuaSocket folder -- and in the installation folder of the Lock On version 1.2. -- Please, set EnableExportScript = true in the Config/Export/Config.lua file -- to activate this script! -- Expand the functionality of following functions for your external application needs. -- Look into ./Temp/Error.log for this script errors, please. -- Uncomment if using Vector class from the Config/Export/Vector.lua file --[[ LUA_PATH = "?;?.lua;./Config/Export/?.lua" require 'Vector' -- See the Config/Export/Vector.lua file for Vector class details, please. --]] local default_output_file = nil function LuaExportStart() -- Works once just before mission start. -- Make initializations of your files or connections here. -- For example: -- 1) File default_output_file = io.open("./Temp/Export.log", "w") -- 2) Socket -- package.path = package.path..";.\\LuaSocket\\?.lua" -- package.cpath = package.cpath..";.\\LuaSocket\\?.dll" -- socket = require("socket") -- host = host or "localhost" -- port = port or 8080 -- c = socket.try(socket.connect(host, port)) -- connect to the listener socket -- c:setoption("tcp-nodelay",true) -- set immediate transmission mode -- local version = LoGetVersionInfo() --request current version info (as it showed by Windows Explorer fo DCS.exe properties) if version and default_output_file then default_output_file:write("ProductName: "..version.ProductName..'\n') default_output_file:write(string.format("FileVersion: %d.%d.%d.%d\n", version.FileVersion[1], version.FileVersion[2], version.FileVersion[3], version.FileVersion[4])) default_output_file:write(string.format("ProductVersion: %d.%d.%d.%d\n", version.ProductVersion[1], version.ProductVersion[2], version.ProductVersion[3], -- head revision (Continuously growth) version.ProductVersion[4])) -- build number (Continuously growth) end end function LuaExportBeforeNextFrame() -- Works just before every simulation frame. -- Call Lo*() functions to set data to Lock On here -- For example: -- LoSetCommand(3, 0.25) -- rudder 0.25 right -- LoSetCommand(64) -- increase thrust end function LuaExportAfterNextFrame() -- Works just after every simulation frame. -- Call Lo*() functions to get data from Lock On here. -- For example: -- local t = LoGetModelTime() -- local name = LoGetPilotName() -- local altBar = LoGetAltitudeAboveSeaLevel() -- local altRad = LoGetAltitudeAboveGroundLevel() -- local pitch, bank, yaw = LoGetADIPitchBankYaw() -- local engine = LoGetEngineInfo() -- local HSI = LoGetControlPanel_HSI() -- Then send data to your file or to your receiving program: -- 1) File -- if default_output_file then -- default_output_file:write(string.format("t = %.2f, name = %s, altBar = %.2f, altRad = %.2f, pitch = %.2f, bank = %.2f, yaw = %.2f\n", t, name, altBar, altRad, 57.3*pitch, 57.3*bank, 57.3*yaw)) -- default_output_file:write(string.format("t = %.2f ,RPM left = %f fuel_internal = %f \n",t,engine.RPM.left,engine.fuel_internal)) -- default_output_file:write(string.format("ADF = %f RMI = %f\n ",57.3*HSI.ADF,57.3*HSI.RMI)) -- end -- 2) Socket -- socket.try(c:send(string.format("t = %.2f, name = %s, altBar = %.2f, alrRad = %.2f, pitch = %.2f, bank = %.2f, yaw = %.2f\n", t, name, altRad, altBar, pitch, bank, yaw))) end function LuaExportStop() -- Works once just after mission stop. -- Close files and/or connections here. -- 1) File if default_output_file then default_output_file:close() default_output_file = nil end -- 2) Socket -- socket.try(c:send("quit")) -- to close the listener socket -- c:close() end .... Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
G00dnight Posted September 1, 2014 Share Posted September 1, 2014 I don't think the enable bit is needed anymore as each aircraft has its own config.lua in your user files. your path for export is correct. AMD A8-5600K @ 4GHz, Radeon 7970 6Gig, 16 Gig Ram, Win 10 , 250 gig SSD, 40" Screen + 22 inch below, Track Ir, TMWH, Saitek combat pedals & a loose nut behind the stick :thumbup: Link to comment Share on other sites More sharing options...
algerad3 Posted September 1, 2014 Share Posted September 1, 2014 ArturDcs. Give me a minute and I will get you set up. [sIGPIC][/sIGPIC] CPIAS FOR Saitek: Saitek Flight instrument panels and X-52 pro mfd scripts for Dcs http://forums.eagle.ru/showthread.php?t=94174 Link to comment Share on other sites More sharing options...
ArturDCS Posted September 2, 2014 Author Share Posted September 2, 2014 Got it. "EnableExportScript = true" to the file: "D:\Eagle Dynamics\DCS World\Mods\aircrafts\Uh-1H\Cockpit\Scripts\config.lua" Export commands in this file: "C:\Users\<user>\Saved Games\DCS\Scripts\Export.lua" The directory above was named Script instead of Scripts. Silly. :music_whistling: Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
ArturDCS Posted October 12, 2014 Author Share Posted October 12, 2014 Status update 12 Oct 2014. I have been able to communicate with DCS via UDP using [FSF Ian]'s DCS BIOS both getting and setting instrument values. I have received 27€ in donations for a radio panel. Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
Oesau Posted November 20, 2014 Share Posted November 20, 2014 How's this going ArturDCS - not enough interest in terms of donations to make it worth while? Link to comment Share on other sites More sharing options...
ArturDCS Posted November 21, 2014 Author Share Posted November 21, 2014 (edited) How's this going ArturDCS - not enough interest in terms of donations to make it worth while? My previous whine & cheese removed. Things are moving forward, slowly but forward. Edited January 7, 2015 by ArturDCS Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
JaBoG32_Prinzartus Posted November 22, 2014 Share Posted November 22, 2014 What a pitty. I donated some bucks because I already enjoy the flight panel Interface and would love to use the Saitek Radio Panel to work with DCS. So guys, come on, donate some bucks to get Arthur's DevKit. I appreciate his initiative! Some more guys with some euros could make this project start. Windows 10, I7 8700k@5,15GHz, 32GB Ram, GTX1080, HOTAS Warthog, Oculus Rift CV1, Obutto R3volution, Buttkicker [sIGPIC][/sIGPIC] ЯБоГ32_Принз Link to comment Share on other sites More sharing options...
ArturDCS Posted November 29, 2014 Author Share Posted November 29, 2014 Donated sum is now 47€. Thanks! Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
Akki Posted December 25, 2014 Share Posted December 25, 2014 Donated sum is now 47€. Thanks! Hi Artur, Merry christmasts!!! How are donations flowing? You're right about Saitek, more documentation can only benefit them and then us, everyone wins here. I'm planning to buy the Pro flight panel soon because of your kind work, I will donate in euros for sure. BTW, in the meantime, would be cool if you can do something about the landing gear lights in that panel using the export.lua events. Could be possible? Thank you in advance! Win 8.1, I7 4770K 4.5ghz watercooled, 240gb SSD in Raid 0, 16GB DDR3-2400, EVGA GTX780 watercooled, LG 29EA73-P (2560x1080) Cobra M5 *modded by BRD*, CH Pro Throttle, Pro Combat Pedals, TrackIR5 Pro + Delanclip, Bose QC 15, TM Cougar MFD's 300/30 mbps Link to comment Share on other sites More sharing options...
ArturDCS Posted December 30, 2014 Author Share Posted December 30, 2014 Hi Artur, Merry christmasts!!! How are donations flowing? You're right about Saitek, more documentation can only benefit them and then us, everyone wins here. I'm planning to buy the Pro flight panel soon because of your kind work, I will donate in euros for sure. BTW, in the meantime, would be cool if you can do something about the landing gear lights in that panel using the export.lua events. Could be possible? Thank you in advance! Thank you, same same. Yes it is possible to have something going there. I will look into it later. Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
531-Ghost Posted December 30, 2014 Share Posted December 30, 2014 Not holding my breath for Saitek... :joystick: Link to comment Share on other sites More sharing options...
ArturDCS Posted January 7, 2015 Author Share Posted January 7, 2015 Looking into DCS BIOS. Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
skunk160 Posted January 15, 2015 Share Posted January 15, 2015 donation sent! Thanks ArturDCS skunk160 | Win10 PRO 64bit | i7-4770K 3.50 GHz | 32GB DDR3/1866MHz | GIGABYTE GeForce GTX 1080 x2 | Oculus Rift S | Virpil MongoosT-50CM2 | Virpil F-14B grip | Virpil 200m Curved Extension | PointCTRL | Delta Sim TM Slew | Sim Bandit AHCP | MFG Crosswind Pedals | //FOX2 Switch Boxes | RECARO SPG Seat | AuraSound AST-2B-4 Pro Bass Transducer x2 //FOXTWO Multi-Role Combat Pit Build http://forums.eagle.ru/showthread.php?t=134745 Link to comment Share on other sites More sharing options...
ArturDCS Posted January 15, 2015 Author Share Posted January 15, 2015 Received. Thanks! Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
skunk160 Posted January 15, 2015 Share Posted January 15, 2015 :thumbup: Just added Saitek Pro Flight Radio Panel to my Amazon basket in eager anticipation because of this thread 1 skunk160 | Win10 PRO 64bit | i7-4770K 3.50 GHz | 32GB DDR3/1866MHz | GIGABYTE GeForce GTX 1080 x2 | Oculus Rift S | Virpil MongoosT-50CM2 | Virpil F-14B grip | Virpil 200m Curved Extension | PointCTRL | Delta Sim TM Slew | Sim Bandit AHCP | MFG Crosswind Pedals | //FOX2 Switch Boxes | RECARO SPG Seat | AuraSound AST-2B-4 Pro Bass Transducer x2 //FOXTWO Multi-Role Combat Pit Build http://forums.eagle.ru/showthread.php?t=134745 Link to comment Share on other sites More sharing options...
JaBoG32_Prinzartus Posted January 15, 2015 Share Posted January 15, 2015 Hi Artur! Will you be supporting two(!) radio panels at once, if someone has two units cconnected to the computer? Windows 10, I7 8700k@5,15GHz, 32GB Ram, GTX1080, HOTAS Warthog, Oculus Rift CV1, Obutto R3volution, Buttkicker [sIGPIC][/sIGPIC] ЯБоГ32_Принз Link to comment Share on other sites More sharing options...
ArturDCS Posted January 16, 2015 Author Share Posted January 16, 2015 Hi Artur! Will you be supporting two(!) radio panels at once, if someone has two units cconnected to the computer? Unfortunately it seems the Radio Panel doesn't have a serial number so I don't know how I would separate them. I will look into it further. Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
ArturDCS Posted January 17, 2015 Author Share Posted January 17, 2015 Do not use this thread anymore. Please post questions and comments in the thread Flightpanels program thread. Saitek Pro Flight Panels & DCS. Warlord's DCSFlightpanels profiles DCSFlightpanels Discord Server Link to comment Share on other sites More sharing options...
Recommended Posts