T_A Posted October 30, 2023 Posted October 30, 2023 I there any solution to having the leds sync with DCS ? (like the threat warning panel buttons and gear lever and wheel status) really annoys me that they make a feature that is absolutely unusable can DCS BIOS or other app interact with DCS and TARGET or something ? 1 IAF.Tomer My Rig: Core i7 6700K + Corsair Hydro H100i GTX Gigabyte Z170X Gaming 7,G.Skill 32GB DDR4 3000Mhz Gigabyte GTX 980 OC Samsung 840EVO 250GB + 3xCrucial 275GB in RAID 0 (1500 MB/s) Asus MG279Q | TM Warthog + Saitek Combat Pedals + TrackIR 5 [sIGPIC][/sIGPIC]
slughead Posted October 30, 2023 Posted October 30, 2023 Not as yet. Slugmouse: a finger-mounted mouse button emulator for hand-tracked VR cockpit clicking. Available now! Slugmouse Demonstration Video
Drakoz Posted October 31, 2023 Posted October 31, 2023 (edited) Yes, it is possible for TARGET and DCS BIOS to talk to each other, but it requires custom programming in TARGET, and maybe using a helper app outside of TARGET to parse the data from DCS BIOS for TARGET. You might be able to do this using data files, or maybe using sockets. But it requires some knowledge about programming. If I remember correctly, DCS BIOS exports data to a file and you parse the file with a custom program to read data from DCS or write data to DCS. TARGET is a C language interpreter and can do most of what C can do including read files on your harddisk, or even send/receive network packets on a network using sockets. The problem is, TARGET lacks any kind of proper string handling functions. TARGET handles numbers fine, but strings (arrays of char) do not work properly in TARGET compared to C mostly because TARGET does not understand the \0 end of string nul (and does not have a full set of string handler functions). If DCS BIOS exports data to a file in a complex way (using words, strings, or more than just numbers), it is more complicated for TARGET to parses the file, but still possible. But it may be better to write an external program to take the DCS BIOS data and convert it (in real time) to a second file for TARGET to use in the form of straight numbers (integers). Another way to communicate with TARGET is to open a socket in TARGET. A socket is a network interface between one program and another, but sockets can be used between programs on the same computer. TARGET supports sockets, but it is not documented. There are a few examples how to do it on this forum or on elsewhere, but will take some searching. Only 3 or 4 people I am aware of have actually used sockets in TARGET in a working example. I have considered it, but never actually tried. DCS BIOS is perfect for using a socket. Meaning, if DCS BIOS doesn't already support sockets, someone has probably created a socket interface for DCS BIOS for a DIY controller. If so, maybe you could use that as a starting point to create a socket interface between DCS BIOS and TARGET. It would be more efficient for an external helper app to parse the DCS BIOS information and send TARGET only the data you want. I have seen some other examples of DCS BIOS wrappers or helper apps that send status information to a joystick in order to turn LEDs on and off. Somewhere on the DCS fourms, I believe there is one created for the Logitech G940 throttle button LEDs. Anyway, for someone that is savvy with programming, it is possible to use DCS BIOS to talk to TARGET and vice versa. Edited October 31, 2023 by Drakoz 1
pepin1234 Posted November 16, 2023 Posted November 16, 2023 Anybody who share his DCS Bios and scripts to make things work? [sIGPIC][/sIGPIC]
Trigati Posted November 16, 2023 Posted November 16, 2023 I was doing this, but I no longer have my TM stuff setup and would have to go through old backups to find the scripts Try these threads as a starting point. Maybe I can help further when I have more time.
slughead Posted November 18, 2023 Posted November 18, 2023 (edited) On 10/30/2023 at 2:33 PM, T_A said: I there any solution to having the leds sync with DCS ? (like the threat warning panel buttons and gear lever and wheel status) really annoys me that they make a feature that is absolutely unusable can DCS BIOS or other app interact with DCS and TARGET or something ? No, not as yet is now... yes. I have written a Thrustmaster target script to handle TCP packets exported from DCS via an export.lua and associated utility scripts that I have written. Take the files in f-16c_50_lamps_export.zip and put them in your Saved Games\DCS\Scripts or Saved Games\DCS.openbeta\Scripts folder or both if you use both stable and open-beta builds. Unzip the ViperTQSLEDSync.zip file and run the ViperTQSLEDSync.tmc file in Target. The target script must be running before you start your mission in DCS. This script does not take control of the ViperTQS so you use it as normal in DCS without needing to reconfigure DCS. Only the LEDs on the ViperTQS are controlled by the script. However, if you use a target script to map the ViperTQS to DCS, well you'll have to try to figure out how to combine this script with yours. Please don't ask me to help with combining scripts, you're going to have to figure that out on your own. I chose to use TCP rather than reading and writing files as it's less demanding on the processor and it will not wear out your SSD/HD prematurely. The export script only sends an update packet if one of the lamp indicators has changed. On the other side, the target script will only handle a packet if it receives one. So in that way, it's efficient. However, on the DCS side, it is polling for changes every 100ms. The CPU effort involved is minimal so it should not affect the performance of DCS. Ideally, I would want to trigger an update when a parameter changes rather than polling the parameters periodically. However, I don't think there is a mechanism by which this can be achieved. So it is what it is. One thing you will notice is that Thrustmaster has not properly emulated the RWR lights. For example, the ALTITUDE LOW and ALT are either both green or red at the same time. You can't illuminate one or the other. So a compromise had to be made in that when LOW is detected, the LED colour is red. When LOW isn't detected the LED is green unless the RWR is powered off. Similarly, the ACT/PWR button is either all green or off. I do not think you can illuminate the A or POWER individually - it's just one LED for the whole button. So that's quite a let down in my opinion. Although I only fly in VR so whilst I've gone to the effort of doing this, it's the 2D flyers that will reap the rewards and be a little miffed at the same time. ViperTQSLEDSync.tmcf-16c_50_lamps_export.zip Edited November 20, 2023 by slughead 1 2 Slugmouse: a finger-mounted mouse button emulator for hand-tracked VR cockpit clicking. Available now! Slugmouse Demonstration Video
T_A Posted November 18, 2023 Author Posted November 18, 2023 (edited) 20 hours ago, slughead said: No, not as yet is now... yes. I have written a Thrustmaster target script to handle TCP packets exported from DCS via an export.lua and associated utility scripts that I have written. Take the files in f-16c_50_lamps_export.zip and put them in your Saved Games\DCS\Scripts or Saved Games\DCS.openbeta\Scripts folder or both if you use both stable and openbeta builds. Unzip the ViperTQSLEDSync.zip file and run the ViperTQSLEDSync.tmc file in Target. The target script must be running before you start your mission in DCS. This script does not take control of the ViperTQS so you use it as normal in DCS without needing to reconfigure DCS. Only the LEDs on the ViperTQS are controlled by the script. However, if you use a target script to map the ViperTQS to DCS, well you'll have to try to figure out how to combine this script with yours. Please don't ask me to help with combining scripts, you're going to have to figure that out on your own. I chose to use TCP rather than reading and writing files as it's less demanding on the processor and it will not wear out your SSD/HD prematurely. The export script only sends an update packet if one of the lamp indicators has changed. On the other side, the target script will only handle a packet if it receives one. So in that way, it's efficient. However, on the DCS side, it is polling for changes every 100ms. The CPU effort involved is minimal so it should not affect the performance of DCS. Ideally, I would want to trigger an update when a parameter changes rather than polling the parameters periodically. However, I don't think there is a mechanism by which this can be achieved. So it is what it is. One thing you will notice is that Thrustmaster has not properly emulated the RWR lights. For example, the ALTITUDE LOW and ALT are either both green or red at the same time. You can't illuminate one or the other. So a compromise had to be made in that when LOW is detected, the LED colour is red. When LOW isn't detected the LED is green unless the RWR is powered off. Similarly, the ACT/PWR button is either all green or off. I do not think you can illuminate the A or POWER individually - it's just one LED for the whole button. So that's quite a let down in my opinion. Although I only fly in VR so whilst I've gone to the effort of doing this, it's the 2D flyers that will reap the rewards and be a little miffed at the same time. ViperTQSLEDSync.zip 1.74 kB · 2 downloads f-16c_50_lamps_export.zip 3.09 kB · 2 downloads Truly impressive , i just finished testing this and i can confirm its working , first time i`ve seen the gear/handle lights on (no way to do via target gui yet...) Really appreciate the time you took to do this. Some notes: 1. Exports file should be appended and not overwritten , for those who are not aware otherwise you`ll break other mods (like srs) 2. I got errors running it at first on lines 72 and 73 where you check for farm stick (my target software doesnt recognize it0 "Runtime Error: Symbol not found: FarmStickRight in main ( line 72 in ViperTQSLEDSync.tmc )" i just // those lines, run fine after i updated to the .1003 version from 13.11.23 that added support for farm stick 3. probably most important issue - only works first time in a mission , if i crash and fly again lights dont change , have to get out of the mission first. (tried to start/stop script while in mission) Small request - can you get the lights below the emer jettion button to blink i.e on for being locked on and blinking while missile warning is on ? anyway - thanks again! Edited November 18, 2023 by T_A 1 IAF.Tomer My Rig: Core i7 6700K + Corsair Hydro H100i GTX Gigabyte Z170X Gaming 7,G.Skill 32GB DDR4 3000Mhz Gigabyte GTX 980 OC Samsung 840EVO 250GB + 3xCrucial 275GB in RAID 0 (1500 MB/s) Asus MG279Q | TM Warthog + Saitek Combat Pedals + TrackIR 5 [sIGPIC][/sIGPIC]
slughead Posted November 18, 2023 Posted November 18, 2023 3 minutes ago, T_A said: 1. Exports file should be appended and not overwritten , for those who are not aware otherwise you`ll break other mods (like srs) Good catch. I don't run any other exports so I haven't run into this problem. 3 minutes ago, T_A said: 2. I got errors running it at first on lines 72 and 73 where you check for farm stick (my target software doesnt recognize it0 "Runtime Error: Symbol not found: FarmStickRight in main ( line 72 in ViperTQSLEDSync.tmc )" i just // those lines, run fine after Yeah, this is something I need to try to work on. Not sure how though at this time. 5 minutes ago, T_A said: 3. probably most important issue - only works first time in a mission , if i crash and fly again lights dont change , have to get out of the mission first. (tried to start/stop script while in mission) I will investigate. When you say fly again do you mean respawn without returning to the mission debrief screen? 5 minutes ago, T_A said: Small request - can you get the lights below the emer jettion button to blink i.e on for being locked on and blinking while missile warning is on ? Possibly. I was wondering what to do with these LEDs. 9 minutes ago, T_A said: anyway - thanks again! You're very welcome and thanks for the feedback. Right now I am working on an export for the "other F-16" simulator to do the same thing. Once I've done that, I'll come back to this although I may break away and fix item 3 in your list. 1 Slugmouse: a finger-mounted mouse button emulator for hand-tracked VR cockpit clicking. Available now! Slugmouse Demonstration Video
T_A Posted November 18, 2023 Author Posted November 18, 2023 12 minutes ago, slughead said: When you say fly again do you mean respawn without returning to the mission debrief screen? yes exactly , it will be useful for me since i fly mostly on mp servers where i *ahem* respawn alot.. 1 IAF.Tomer My Rig: Core i7 6700K + Corsair Hydro H100i GTX Gigabyte Z170X Gaming 7,G.Skill 32GB DDR4 3000Mhz Gigabyte GTX 980 OC Samsung 840EVO 250GB + 3xCrucial 275GB in RAID 0 (1500 MB/s) Asus MG279Q | TM Warthog + Saitek Combat Pedals + TrackIR 5 [sIGPIC][/sIGPIC]
slughead Posted November 18, 2023 Posted November 18, 2023 Have you tried the scripts with multiplayer yet? It may not be compatible at all with multiplayer. Slugmouse: a finger-mounted mouse button emulator for hand-tracked VR cockpit clicking. Available now! Slugmouse Demonstration Video
T_A Posted November 18, 2023 Author Posted November 18, 2023 38 minutes ago, slughead said: Have you tried the scripts with multiplayer yet? It may not be compatible at all with multiplayer. Just tried it , doesnt work, connected to a server with what appears to be all exports enabled 1 IAF.Tomer My Rig: Core i7 6700K + Corsair Hydro H100i GTX Gigabyte Z170X Gaming 7,G.Skill 32GB DDR4 3000Mhz Gigabyte GTX 980 OC Samsung 840EVO 250GB + 3xCrucial 275GB in RAID 0 (1500 MB/s) Asus MG279Q | TM Warthog + Saitek Combat Pedals + TrackIR 5 [sIGPIC][/sIGPIC]
slughead Posted November 18, 2023 Posted November 18, 2023 I suspected that might happen as others who have tried to export data have had this happen too. I don't know what the solution is, sorry. If anyone does, let me know! I wonder how DCS-BIOS does it. 1 1 Slugmouse: a finger-mounted mouse button emulator for hand-tracked VR cockpit clicking. Available now! Slugmouse Demonstration Video
T_A Posted November 19, 2023 Author Posted November 19, 2023 Tried to play around with the lua`s , but my knowledge of dcs export mechanics is next to none. from reading many other threads , its not a matter of export permission or server settings , its about not being inside an aircraft when the mission starts i tried to force it and skip the aircraft.name check (which was nil since i'm not in any aircraft) but it then failed due to GetDevice(0) usage. don`t know how DCS-BIOS does this , but i'm guessing they account for out of aircraft state , maybe have some kind of try-catch until you are actually sitting in one. just my 2 cents. IAF.Tomer My Rig: Core i7 6700K + Corsair Hydro H100i GTX Gigabyte Z170X Gaming 7,G.Skill 32GB DDR4 3000Mhz Gigabyte GTX 980 OC Samsung 840EVO 250GB + 3xCrucial 275GB in RAID 0 (1500 MB/s) Asus MG279Q | TM Warthog + Saitek Combat Pedals + TrackIR 5 [sIGPIC][/sIGPIC]
Trigati Posted November 19, 2023 Posted November 19, 2023 I think it’s a call of checking the device/data exists before sending as export. It gets flaky when sending null data, fails and never recovers I think. And as you suggest you are not in plane at start, therefore that would crash the export. if I have time I’ll take a look and report back.Sent from my iPad using Tapatalk 1
slughead Posted November 20, 2023 Posted November 20, 2023 19 hours ago, T_A said: its about not being inside an aircraft when the mission starts Forgive my ignorance, I have yet to use multiplayer. How can you not be in an aircraft when the mission starts? Slugmouse: a finger-mounted mouse button emulator for hand-tracked VR cockpit clicking. Available now! Slugmouse Demonstration Video
T_A Posted November 20, 2023 Author Posted November 20, 2023 Font 3 hours ago, slughead said: Forgive my ignorance, I have yet to use multiplayer. How can you not be in an aircraft when the mission starts? When you connect to a server that is running a mission , you get a list of open slots with all sorts of airplanes to select from , once you select an open slot you will spawn at the aircraft. In single player you are automatically assigned to a single 'player' designated aircraft. IAF.Tomer My Rig: Core i7 6700K + Corsair Hydro H100i GTX Gigabyte Z170X Gaming 7,G.Skill 32GB DDR4 3000Mhz Gigabyte GTX 980 OC Samsung 840EVO 250GB + 3xCrucial 275GB in RAID 0 (1500 MB/s) Asus MG279Q | TM Warthog + Saitek Combat Pedals + TrackIR 5 [sIGPIC][/sIGPIC]
slughead Posted November 20, 2023 Posted November 20, 2023 Ah ok. I believe I have replicated this using the formation trainer mission from d0ppler. Once the mission starts, you are given a list of aircraft to jump into. None of the lights get activated. So I think I can use that script to debug and enhance the export script. Whether that will fully address multiplayer I can't say at this time. Slugmouse: a finger-mounted mouse button emulator for hand-tracked VR cockpit clicking. Available now! Slugmouse Demonstration Video
slughead Posted November 20, 2023 Posted November 20, 2023 (edited) I believe I have fixed the problem with starting a mission without entering an aircraft. Can you give this script a try? The script should ignore any aircraft other than the F-16C_50. Export.lua Edited November 20, 2023 by slughead 1 Slugmouse: a finger-mounted mouse button emulator for hand-tracked VR cockpit clicking. Available now! Slugmouse Demonstration Video
T_A Posted November 20, 2023 Author Posted November 20, 2023 (edited) 2 hours ago, slughead said: I believe I have fixed the problem with starting a mission without entering an aircraft. Can you give this script a try? The script should ignore any aircraft other than the F-16C_50. Export.lua 3.64 kB · 0 downloads Yes it works, very nice work! tested in single player/ multiplayer , choosing some other module slot on the server then switching to f-16 , ejecting then selecting another plane etc. but if i die/eject/change module - kill all the light , otherwise they stay last state. I actually took the time today to learn some DCS scripting to fix this , was almost there when i saw you posted the fix i looked at how DCS-SRS does this to get a clue and added the if (aircraft ~=nil) part to LuaExportActivityNextEvent and also to LuaExportStart but realized most of LuaExportStart should run either way just without checks like you did (was fiddling with this when i saw a new post), so at least i learned something new today... quick note- other mods don't put actual code in Export.lua but just call external lua file i pasted your 'Export.Lua' content in another file I.E TMTQSExport.lua and in export i appended a call for this pcall(function() local dcsTM=require('lfs');dofile(dcsTM.writedir()..[[Scripts/TMTQSExport.lua]]); end,nil) *can be 'cleaner' by moving the files to the /Mods/*folder* but not really important. anyways , really incredible work on this project, kudos to you! Edited November 20, 2023 by T_A IAF.Tomer My Rig: Core i7 6700K + Corsair Hydro H100i GTX Gigabyte Z170X Gaming 7,G.Skill 32GB DDR4 3000Mhz Gigabyte GTX 980 OC Samsung 840EVO 250GB + 3xCrucial 275GB in RAID 0 (1500 MB/s) Asus MG279Q | TM Warthog + Saitek Combat Pedals + TrackIR 5 [sIGPIC][/sIGPIC]
slughead Posted November 20, 2023 Posted November 20, 2023 6 minutes ago, T_A said: Yes it works, very nice work! tested in single player/ multiplayer , choosing some other module slot on the server then switching to f-16 , ejecting then selecting another plane etc. but if i die/eject/change module - kill all the light , otherwise they stay last state. I actually took the time today to learn some DCS scripting to fix this , was almost there when i saw you posted the fix i looked at how DCS-SRS does this to get a clue and added the if (aircraft ~=nil) part to LuaExportActivityNextEvent and also to LuaExportStart but realized most of LuaExportStart should run either way just without checks like you did (was fiddling with this when i saw a new post), so at least i learned something new today... quick note- other mods don't put actual code in Export.lua but just call external lua file i pasted your 'Export.Lua' content in another file I.E TMTQSExport.lua and in export i appended a call for this pcall(function() local dcsTM=require('lfs');dofile(dcsTM.writedir()..[[Scripts/TMTQSExport.lua]]); end,nil) *can be 'cleaner' by moving the files to the /Mods/*folder* but not really important. anyways , really incredible work on this project, kudos to you! I have only spent two days on this. So it's quick and dirty. There is plenty of refinement to do. I'll take a look at resetting the LED state when the user drops out (eject/die/etc). 1 Slugmouse: a finger-mounted mouse button emulator for hand-tracked VR cockpit clicking. Available now! Slugmouse Demonstration Video
T_A Posted November 20, 2023 Author Posted November 20, 2023 5 minutes ago, slughead said: I have only spent two days on this. So it's quick and dirty. There is plenty of refinement to do. I'll take a look at resetting the LED state when the user drops out (eject/die/etc). Thanks , thats alot of code for 2 days for the reset if it helps this is how DCS-SRS does this: if _data ~= nil and not SR.fc3[_data.Name] then -- check for death / eject -- call below returns a number when ejected - ignore FC3 local _device = GetDevice(0) if type(_device) == 'number' then _data = nil -- wipe out data - aircraft is gone really end end if _data ~= nil then -- procceds to reset stuff... thats where leds will be turned off IAF.Tomer My Rig: Core i7 6700K + Corsair Hydro H100i GTX Gigabyte Z170X Gaming 7,G.Skill 32GB DDR4 3000Mhz Gigabyte GTX 980 OC Samsung 840EVO 250GB + 3xCrucial 275GB in RAID 0 (1500 MB/s) Asus MG279Q | TM Warthog + Saitek Combat Pedals + TrackIR 5 [sIGPIC][/sIGPIC]
slughead Posted November 20, 2023 Posted November 20, 2023 (edited) I believe I have fixed all of the issues raised so far. Please use the following thread to report issues and to get the latest updates. Edited November 20, 2023 by slughead 1 Slugmouse: a finger-mounted mouse button emulator for hand-tracked VR cockpit clicking. Available now! Slugmouse Demonstration Video
DerKlausi Posted August 17, 2024 Posted August 17, 2024 Question to you TQS owners: does your throttle have significant backlash? When I set mine to a medium to high friction resistance, the throttle grip moves like 2..3mm with the whole rod & friction brake assembly inside the base, before the rod itself starts to move in and out of the friction brake. Are you observing the same? Or did I get a faulty unit? Cheers, r.
XBlackstoneX Posted August 24, 2024 Posted August 24, 2024 Be careful. I think these scripts cause bugs. I am experiencing bugs in mission editor loadouts and AI behavior.
slughead Posted August 24, 2024 Posted August 24, 2024 Just now, XBlackstoneX said: Be careful. I think these scripts cause bugs. I am experiencing bugs in mission editor loadouts and AI behavior. These scripts have no effect on the sim. They change no data only read and send to the thrustmaster script. Your problem lies elsewhere. Slugmouse: a finger-mounted mouse button emulator for hand-tracked VR cockpit clicking. Available now! Slugmouse Demonstration Video
Recommended Posts