Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted
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

Posted (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 by ///Gonzo\\\
Posted (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 by Fusedspine33
Posted

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.

Posted (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 by Sprool
Posted

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.

Posted

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

Posted (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 by ///Gonzo\\\
Posted (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 by Sprool
Posted (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 by ///Gonzo\\\
Posted
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...