Gonzo1606689281 Posted July 24, 2020 Posted July 24, 2020 Hi Guys, I need some help. I tried searching the forum but the threads I found the code doesn't match so i'm confused since i'm not good with programming. I have a Bodnar board and I am hooking up a On-Off switch. I'd like that to be my Master Arm on and off. I hooked it up and it takes one throw to arm and two throws to disarm. I'm trying to get it so on= Armed and off= disarmed. Can you guys help me with the code? local diff = { ["keyDiffs"] = { ["d3014pnilunilcd23vd1vpnilvunil"] = { ["added"] = { [1] = { ["key"] = "JOY_BTN1", }, }, ["name"] = "Master Arm Switch - ARM/SAFE", }, }, } return diff
Gladman Posted July 24, 2020 Posted July 24, 2020 RSMapper makes all of this super easy. i9 9900K @ 5.1Ghz - ASUS Maximus Hero XI - 32GB 4266 DDR4 RAM - ASUS RTX 2080Ti - 1 TB NVME - NZXT Kraken 62 Watercooling System - Thrustmaster Warthog Hotas (Virpil Base) - MFG Crosswind Pedals - Pimax 5K+ VFA-25 Fist Of The Fleet [sigpic]http://forums.eagle.ru/signaturepics/sigpic99190_2.gif[/sigpic] Virtual Carrier Strike Group 1 | Discord
Gonzo1606689281 Posted July 24, 2020 Author Posted July 24, 2020 I'd like to do it through DCS if possible so im not running another program in the background. Thanks for the suggestion though. If i cant get it to work i guess that will be what I have to do.
Gladman Posted July 24, 2020 Posted July 24, 2020 I'd like to do it through DCS if possible so im not running another program in the background. Thanks for the suggestion though. If i cant get it to work i guess that will be what I have to do. I certainly understand what you are trying to do. Keep in mind that with my testing I saw no change, 0 FPS loss using RSMapper. It also auto loads so there is no hassle with it. Best of luck with the programming, it does represent an interesting challenge. i9 9900K @ 5.1Ghz - ASUS Maximus Hero XI - 32GB 4266 DDR4 RAM - ASUS RTX 2080Ti - 1 TB NVME - NZXT Kraken 62 Watercooling System - Thrustmaster Warthog Hotas (Virpil Base) - MFG Crosswind Pedals - Pimax 5K+ VFA-25 Fist Of The Fleet [sigpic]http://forums.eagle.ru/signaturepics/sigpic99190_2.gif[/sigpic] Virtual Carrier Strike Group 1 | Discord
Fusedspine33 Posted July 24, 2020 Posted July 24, 2020 Have a look at this thread, there are a number of custom commands you can cut and paste with directions for where to paste them. The default commands you are using require an on-on switch and two positions on your Bodnar card. https://forums.eagle.ru/showthread.php?t=89226 Sent from my iPad using Tapatalk
Gonzo1606689281 Posted July 24, 2020 Author Posted July 24, 2020 (edited) Fused, thats the thread i saw before but i cant make heads or tails of it it because the coding is differnt looking than mine. Jeez i cant wait until i get to encoders and potentiometers ������������������ Edited July 24, 2020 by ///Gonzo\\\
Fusedspine33 Posted July 24, 2020 Posted July 24, 2020 (edited) Beginner with toggle switch Fused, thats the thread i saw before but i cant make heads or tails of it it becaise tue coding is differnt looking than mine. Jeez i cant wait until i get to encoders and potentiometers í ½í¸�í ½í¸�í ½í¸� Where are the above entries are you coding into? You said in a prior post you want to assign in DCS? The copy and paste additions from the forum post I sent you will add additional options within the DCS control assignments pages. Sent from my iPad using Tapatalk Edited July 24, 2020 by Fusedspine33
Sprool Posted July 24, 2020 Posted July 24, 2020 that post is now 81 pages long! I'm looking to do same with a button box (+ rotary encoders) so I'll post back if I find something more helpful.
Sprool Posted July 24, 2020 Posted July 24, 2020 (edited) Post #708 shows: {down = SMS_commands.MasterArmSw, up = SMS_commands.MasterArmSw, cockpit_device_id = devices.SMS, value_down = 1.0, value_up = 0.0, name = _('Master Arm Switch 2-Pos ARM/SAFE'), category = {_('Instrument Panel'), _('Master Arm Panel')}}, This for the default.lua Joystick for Hornet. I'm going to give it a try. /edit: yep works fine. I now have 2 spst on/off switches on my button box, one controls quick start, the other controls master arm on/safe. Note: This code is all lua inside dcs, nothing to do with bodnar or arduino (which I'm using as the button interface with windows joystick controller) The file to edit (make a backup first) is DCSworld/mods/aircraft/FA-18C/input/joystick/default.lua If you need any help on the rotaries, gimme a shout. Edited July 24, 2020 by Sprool
Gonzo1606689281 Posted July 26, 2020 Author Posted July 26, 2020 Guys I appreciate the help but I don't know where to paste this stuff or what to do with it. My code above looks different than what you guys are posting. and rather than frustrate us both, I’m just going to throw it in the garbage. I just ordered Brun’s UFC too, 400 bucks, right in the dumb garbage. I’ve spent 2 days looking at this and trying to figure it out and I've come to the conclusion that even if I get it working through some miracle, it’s still going to be with a host of caveats like updates wiping my hard work our 3rd party programs that I have to run in order to get all this stuff just to line up. Its funny, I’ve spent 4 months playing this game and the last two days makes me want to not play ever again.
Sprool Posted July 26, 2020 Posted July 26, 2020 No dont do that, I'll guess you are looking to edit the wrong file. the code form your first post, is it from saved games/dcsopenbeta/config/input/FA-18C_hornet/Joystick folder? If so, then thats the wrong file. You want to be editing Eagle Dynamics/DCS World Open Beta/Mods/Aircraft/FA-18C/Input/FA-18C/joystick/default.lua. The line controlling the master arm switch is line 149
Gonzo1606689281 Posted July 26, 2020 Author Posted July 26, 2020 (edited) Sprool, Thanks again I was in Saved Games/DCS/Config/Input/FA-18C_hornet/joystick/, then i right click to open BBI-64 in note ++ Edit* I did find the folder now it was in regular DCS not saved games. Can you guide me on what to change? Maybe if you put it in bold ill understand { down = SMS_commands.MasterArmSw, cockpit_device_id = devices.SMS, value_down = 1.0, name = _('Master Arm Switch - ARM'), category = {_('Instrument Panel'), _('Master Arm Panel')}}, { down = SMS_commands.MasterArmSw, cockpit_device_id = devices.SMS, value_down = 0.0, name = _('Master Arm Switch - SAFE'), category = {_('Instrument Panel'), _('Master Arm Panel')}}, Edited July 26, 2020 by ///Gonzo\\\
Sprool Posted July 26, 2020 Posted July 26, 2020 (edited) --{ down = SMS_commands.MasterArmSw, cockpit_device_id = devices.SMS, value_down = 1.0, name = _('Master Arm Switch - ARM'), category = {_('Instrument Panel'), _('Master Arm Panel')}}, --{ down = SMS_commands.MasterArmSw, cockpit_device_id = devices.SMS, value_down = 0.0, name = _('Master Arm Switch - SAFE'), category = {_('Instrument Panel'), _('Master Arm Panel')}} {down = SMS_commands.MasterArmSw, up = SMS_commands.MasterArmSw, cockpit_device_id = devices.SMS, value_down = 1.0, value_up = 0.0, name = _('Master Arm Switch 2-Pos ARM/SAFE'), category = {_('Instrument Panel'), _('Master Arm Panel')}}, put 2 dashes in front iof the 2 lines you posted to tell the lua code to ignore the command (it treats it as a comment so you can undo later if needed) then add the third line. Then go into settings controls in DCS menu and find the new entry for the F-18 master arm switch - "master arm - 2 pos - arm/safe." Then just designate a keypress or switch to assign to it. Thanks to LeCuvier for his brains on these toggle switch codes! LeCuvier's single line sort of combines the 2 original lines into one command. All its doing is telling the game to look for one keypress to arm, and pressing the key down flags it as 1 = armed, then it looks for a second keypress to toggle the safe state and assigns zero to it. LeCuviers edit combines both in that the if the switch is down = armed (value = 1) and if the switch is up = safe (0) Edited July 26, 2020 by Sprool
Gonzo1606689281 Posted July 27, 2020 Author Posted July 27, 2020 (edited) Sprool, thanks man, I got it working and best of all it looks like it remembers the switch position if I die or boot into the game with the master arm already up. you mind helping me with one more? Maybe after that I can extrapolate out what you and LeCuvier are doing for the rest of the switches. This is a 3 position switch (On-Off-On) for IR Cool. I can get it to read 2 postions but not the off switch. Any thoughts? Below is the code. { down = SMS_commands.IRCoolingSw, cockpit_device_id = devices.SMS, value_down = 0.2, name = _('IR Cooling Switch - ORIDE'), category = {_('Instrument Panel')}}, { down = SMS_commands.IRCoolingSw, cockpit_device_id = devices.SMS, value_down = 0.1, name = _('IR Cooling Switch - NORM'), category = {_('Instrument Panel')}}, { down = SMS_commands.IRCoolingSw, cockpit_device_id = devices.SMS, value_down = 0.0, name = _('IR Cooling Switch - OFF'), category = {_('Instrument Panel')}}, I tried with, but i couldnt get it to work right { down = SMS_commands.IRCoolingSw, up = SMS_commands.IRCoolingSw, cockpit_device_id = devices.SMS, value_down = 0.0, value_up = 0.1, value_up = 0.2, name = _('IR Cooling Switch - 3 Pos Switch'), category = {_('Instrument Panel')}}, Edited July 27, 2020 by ///Gonzo\\\
Sprool Posted July 27, 2020 Posted July 27, 2020 The problem may be that the Lua code only sees buttons/switches as on or off, and you want one switch to be seen as A, off or B. I would post a request in LeCuvier's toggle switch thread and see if he can suggest a workround for you. https://forums.eagle.ru/showthread.php?t=89226&page=81
Gonzo1606689281 Posted July 27, 2020 Author Posted July 27, 2020 Sprool, thanks. I was so close to junking it all at least now i have a little hope its doable.
Gonzo1606689281 Posted July 27, 2020 Author Posted July 27, 2020 Glad to have helped a little. Nah man you helped a ton. because you gave me the baby step of locating the code i was able to solve my second issue on my own. Now on to getting the pot to work with the HMD and ill almost be done with the left and right side
Recommended Posts