hansangb Posted January 6, 2016 Posted January 6, 2016 I posted this in the sticky "how to make switches work" thread" but perhaps this thread is more appropriate. Considering that all of you have dealt with this during the pit building. I'm trying to get my switches working. I read through the entire thread -sticky switch thread -and it works if I assign my switch (connected to GP-WIZ40). For example, if I change the Master Arm and Train in the game's Setup, Controls, Armament Hud Control Panel, click on the Master switch ARM in the GPWIZ column and toggle the actual switch (same for TRAIN,) I get the following DIFF lua file in the saved games directory (..dcs\config\input\a-10C\joystick\ local diff = { ["keyDiffs"] = { ["d1374pnilunilcdnilvdnilvpnilvunil"] = { ["added"] = { [1] = { ["key"] = "JOY_BTN11", }, }, ["name"] = "Master switch ARM", }, ["d1376pnilunilcdnilvdnilvpnilvunil"] = { ["added"] = { [1] = { ["key"] = "JOY_BTN12", }, }, ["name"] = "Master switch TRAIN", }, }, } return diff Now the above works like a charm. However, it never transitions to SAFE (the middle) position. I'm using SP DT switch. So like others, I tried changing the line "d1374pnilunilcdnilvdnilvpnilvunil" to "d1374pnilu1375cdnilvdnilvpnilvunil" But as soon as I change the file (in UltraEdit), the assignment disappears in the controls. I also tried changing the "vunil" to "vu0" and "vu1" to no avail. I can sacrifice the SAFE position, but I'd like to try and get it to work. And I like the idea of modifying the saved games diff.lua files since I'm thinking future versions of DCS may change the syntax of the DCS WORLD\MODS\AIRCRAFT\A-10C\INPUT\A-10C\joystick files. Thanks hsb HW Spec in Spoiler --- i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1
FSFIan Posted January 6, 2016 Posted January 6, 2016 I don't think you will get it to work without modifying the files in the DCS installation directory. I think that DCS does the following (I don't know for sure, but it would be the straightforward way to do it and be consistent with everything I have read about this): Read the list of possible key bindings from mods\aircraft\a-10c\input\... Read the list of user key bindings from the .diff.lua file For each possible key binding: Build the key it would have in .diff.lua. If there is a .diff.lua entry for it, change the key binding to the one from the .diff.lua file. Note that this means that an entry in .diff.lua will be ignored unless there is a corresponding entry in the file that defines the possible key assignments, which is located in the DCS installation directory. DCS-BIOS | How to export CMSP, RWR, etc. through MonitorSetup.lua
hansangb Posted January 7, 2016 Author Posted January 7, 2016 You mean in the default.lua, file correct? I have to find out what happens when I add my second GP-WIZ40 card. I'll test around this weekend. hsb HW Spec in Spoiler --- i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1
Hansolo Posted January 7, 2016 Posted January 7, 2016 Ian's axplanation sound very reasonable. If you want it to work you can try and load my default.lua file with JSGME. You can find it here; http://forums.eagle.ru/showpost.php?p=2157898&postcount=9 I think I am running an additional 6 joystick controller boards beside the joystick/throttle/pedals Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
Joghurt Posted January 7, 2016 Posted January 7, 2016 I built a switch panel myself with an Arduino, which I programmed so that each switch state will "press a button", even "off", and that works like a charm (like JOY_BTN10 = Master Arm, 11 = Safe, 12 = Train). Maybe you can wire your cables with some logic chips so that a third input port of the GP-WIZ40 gets a negated OR of the two switch signals?
hansangb Posted January 7, 2016 Author Posted January 7, 2016 Thanks everyone. I'll give it a shot and report back. hsb HW Spec in Spoiler --- i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1
hansangb Posted January 8, 2016 Author Posted January 8, 2016 Ian's axplanation sound very reasonable. If you want it to work you can try and load my default.lua file with JSGME. You can find it here; http://forums.eagle.ru/showpost.php?p=2157898&postcount=9 I think I am running an additional 6 joystick controller boards beside the joystick/throttle/pedals Cheers Hans Hans, one question for you. Where can you get the device_id? For example you have: {down = 3009, up = 3009, cockpit_device_id = 58, value_down = 1, value_up = 0, name = "AIM press", category = "Intercom control panel"} I know how I can get the value used in "down=xxxxx" as it is clearly identified in my GP-WIZ40.diff.lua file (1374 in my case). But when I bring it into the default.lua file, what do I use for the device_id? Or am I using that incorrectly? I just checked my joystick-hotas and throttle-hotas lua files and they both reference device_id=49. Someone else suggested create an gp-wiz40.lua file instead of using default.lua but when I add my second gp-wiz40, then what? I wish DCS would document this a little better. hsb HW Spec in Spoiler --- i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1
Hansolo Posted January 8, 2016 Posted January 8, 2016 Hi hansangb, Try and look at this. Should give you an idea of how it's done. That being said the default.lua file of mine contains a lot of them, but of cause not all. http://forums.eagle.ru/showpost.php?p=2017801&postcount=52 Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
hansangb Posted January 8, 2016 Author Posted January 8, 2016 Hi hansangb, Try and look at this. Should give you an idea of how it's done. That being said the default.lua file of mine contains a lot of them, but of cause not all. http://forums.eagle.ru/showpost.php?p=2017801&postcount=52 Cheers Hans Thank you!! Why that didn't come up in my Google search is beyond me. hsb HW Spec in Spoiler --- i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1
hansangb Posted January 9, 2016 Author Posted January 9, 2016 Just one follow up note (which I found humorous) I opened a support ticket asking if there were any documentations to LUA structure. And they told me, "no but someone on the forum can probably help you..." and pointed me to this thread. :) They are right, you guys all helped me greatly. But i was hoping to find some additional resources from ED. hsb HW Spec in Spoiler --- i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1
hansangb Posted January 17, 2016 Author Posted January 17, 2016 Ian's axplanation sound very reasonable. If you want it to work you can try and load my default.lua file with JSGME. You can find it here; http://forums.eagle.ru/showpost.php?p=2157898&postcount=9 I think I am running an additional 6 joystick controller boards beside the joystick/throttle/pedals Cheers Hans Hans, Thanks you very much. I read the above thread and followed it to this link And as a result, I now have double throw switches that will correctly modify three position switches in the sim (Arm, Safe, Train) etc. I don't know why it doesn't work in the diff lua file, but I'll just use JSGME to keep my default.lua file safe during updates. I'll keep playing with the diff.lua file to see if I can get that working as well. Now that I understand the syntax, maybe I can figure it out. Thanks again!! hsb HW Spec in Spoiler --- i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1
Recommended Posts