epolta Posted September 8, 2018 Share Posted September 8, 2018 @epolta: The original commands are ON/OFF toggles for use with push buttons. Eachtime you push the button the command toggles from ON to OFF or OFF to ON. The following additions to "default.lua" provide 2-position ON/OFF commands for maintained ON/OFF switches: {down = 3007, up = 3007, cockpit_device_id = 49 , value_down = 1.0, value_up = 0.0, name = _('Emergency Flood Light 2-Pos DAY/NIGHT'), category = _('Electrical power control panel')}, {down = 3001, up = 3001, cockpit_device_id = 1 , value_down = 1.0, value_up = 0.0, name = _('APU Gen Power 2-Pos ON/OFF'), category = _('Electrical power control panel')}, {down = 3004, up = 3004, cockpit_device_id = 1 , value_down = 1.0, value_up = 0.0, name = _('AC Gen Left Power 2-Pos ON/OFF'), category = _('Electrical power control panel')}, {down = 3005, up = 3005, cockpit_device_id = 1 , value_down = 1.0, value_up = 0.0, name = _('AC Gen Right Power 2-Pos ON/OFF'), category = _('Electrical power control panel')}, {down = 3006, up = 3006, cockpit_device_id = 1 , value_down = 1.0, value_up = 0.0, name = _('Battery Power 2-Pos ON/OFF'), category = _('Electrical power control panel')},If you want to use a pair of push buttons for each of these commands then you have to split the command lines. Example for emergency flood light: {down = 3007, cockpit_device_id = 49 , value_down = 1.0, name = _('Emergency Flood Light DAY'), category = _('Electrical power control panel')}, {down = 3007, cockpit_device_id = 49 , value_down = 0.0, name = _('Emergency Flood Light NIGHT'), category = _('Electrical power control panel')},In the A-10C we need to use the numerical ID's for device and command. The cockpit_device_id number is found in the file "devices.lua". The command ID is the button number from "clickabledata.lua plus 3000 (as found in "command_defs.lua") Good luck! Thanks a ton! much appreciated!:thumbup: Link to comment Share on other sites More sharing options...
v81 Posted September 19, 2018 Share Posted September 19, 2018 Appreciate the assistance LeCuvier Still struggling with a few, now on the Ka-50 We have a 2 pos toggle for the K-041 Targeting system, we built this command and placed it in the DCS World OpenBeta\Mods\aircraft\Ka-50\Cockpit\Scripts\default.lua file... <code>{down = 3525, up = 3525, cockpit_device_id = 59 , valuedown = 1.0, valueup = 0.0, name = ('K041 Power 2pos'), category = ('Ins Targeting Mode Controls Panel PVR')},</code> We sourced the number 3525 from 'command_defs.lua' "Plane_K041_Power = 525," We sourced the device from 'devices.lua' "devices["K041"] = 59" When bound to the switch noting at all happens... any thoughts? Any pointers on how i could become more self sufficient regarding that, don't want to be hassling you lot all the time, though i think the discussion has been pretty healthy and I've learned a bit ! Bonus question - I see "value_down = 1.0, value_up = 0.0" what are these numbers, and how are they determined? R7 3800X - 32Gig RAM -- All SSD -- GTX1070 -- TM Warthog, MFG Crosswinds & TiR Link to comment Share on other sites More sharing options...
LeCuvier Posted September 19, 2018 Share Posted September 19, 2018 @v81: I don't mind helping; this keeps my knowledge up-to-date. Please check the spelling in your code! "valuedown" and "valueup" are not valid. It needs to be "value_down" and "value_up". value_down defines what happens when the contact closes, and value_up when the contact state changes from CLOSED to OPEN. In order to understand what you are doing, read my tutorial earlier in this thread. If you don't find it let me know. LeCuvier Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5 Link to comment Share on other sites More sharing options...
kakal Ice Posted September 20, 2018 Share Posted September 20, 2018 Hello guys before the new Update, i was able to setting airbrake like a toogle. i've a X52 Pro. With the category "Spécial for Hotas" > Action Retract/Off. Now i'm forced to configure with 2 actions; The first one :Air brake out with Joy_Button 7 The seconds : Air brake in with PINKIE + Button 7. Is it possible to add in the default.lua a toggle command to do that Action Retract/Off. Sorry for my bad English ;) Thank you for the excellent work, and too for your answer. :-):helpsmilie: Link to comment Share on other sites More sharing options...
LeCuvier Posted September 20, 2018 Share Posted September 20, 2018 @kakal Ice: You can create a command EXTEND/RETRACT for use with a maintained 2-position switch. This code does it: {down = hotas_commands.THROTTLE_SPEED_BRAKE, up = hotas_commands.THROTTLE_SPEED_BRAKE, cockpit_device_id = devices.HOTAS,value_down = -1.0, value_up = 1.0, name = _('Speed Brake 2-Pos Switch EXTEND/RETRACT'), category = {_('Throttle Grip'), _('HOTAS')}},However, this will not allow you to set the speedbrake to an intermediate position. In order to allow for intermediate positions you need 2 pushbuttons or a 3-position switch. LeCuvier Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5 Link to comment Share on other sites More sharing options...
kakal Ice Posted September 20, 2018 Share Posted September 20, 2018 Thank you for your fast answer LeCuvier, I try that and i come back to say the result. :pilotfly:;) Link to comment Share on other sites More sharing options...
kakal Ice Posted September 21, 2018 Share Posted September 21, 2018 Hello how are you ? I do that and it's doesn't work, what do you mean by a maintained 2-position switch ? Is there a type of button on X52 Pro ? I put the line like that: default.lua Thank you very much :( Link to comment Share on other sites More sharing options...
kakal Ice Posted September 22, 2018 Share Posted September 22, 2018 Little Up please. Have a good week :pilotfly: Link to comment Share on other sites More sharing options...
LeCuvier Posted September 22, 2018 Share Posted September 22, 2018 Hello how are you ? I do that and it's doesn't work, what do you mean by a maintained 2-position switch ? Is there a type of button on X52 Pro ? I put the line like that: [ATTACH]194335[/ATTACH] Thank you very much :( The default.lua you posted is the one in the folder "keyboard". You need to make your additions to the file in the folder "joystick". The command I created is designed for a switch that stays in the ON or OFF position, like a light switch. I have no idea what kind of switches you have on the X52. But if you want to use buttons that do not stay ON or OFF then you need 2 buttons and use the original commands from ED. LeCuvier Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5 Link to comment Share on other sites More sharing options...
kakal Ice Posted September 22, 2018 Share Posted September 22, 2018 Thank you for you help Have a good week. NB: Danke:pilotfly: Link to comment Share on other sites More sharing options...
kakal Ice Posted September 22, 2018 Share Posted September 22, 2018 I'm sorry but it doesn't work default.lua Have a good week guys :pilotfly: Link to comment Share on other sites More sharing options...
vortexringstate Posted September 22, 2018 Share Posted September 22, 2018 Has anyone else had their axis screwed up my modifying .lua? I tweaked the F18 Master Arm, Speed Brake and Canopy Open/Close .lua and all the available axis were reduced to a bare minimum... eg one thrust, no L/R brakes etc plus about 20 others missing. (see pic). After undoing my changes, all the axis returned. How is this avoided? Occulus Rift i7-7700 3.6Ghz 16GB Ram 1080Ti 11GB SSDx2 Link to comment Share on other sites More sharing options...
vortexringstate Posted September 23, 2018 Share Posted September 23, 2018 Why wont this work for a F18 Speed Brake Toggle?? (hold switch = Brake extend, Release =Retract) { down = hotas_commands.THROTTLE_SPEED_BRAKE, up = hotas_commands.THROTTLE_SPEED_BRAKE, cockpit_device_id = devices.HOTAS, value_down = 1.0, value_up = 0.0, name = _('Speed Brake Switch - TOGGLE'), category = {_('Throttle Grip'), _('HOTAS')}}, Occulus Rift i7-7700 3.6Ghz 16GB Ram 1080Ti 11GB SSDx2 Link to comment Share on other sites More sharing options...
LeCuvier Posted September 23, 2018 Share Posted September 23, 2018 Has anyone else had their axis screwed up my modifying .lua? I tweaked the F18 Master Arm, Speed Brake and Canopy Open/Close .lua and all the available axis were reduced to a bare minimum... eg one thrust, no L/R brakes etc plus about 20 others missing. (see pic). After undoing my changes, all the axis returned. How is this avoided? I haven't seen your modified file so I can only guess: The "default.lua" consists of two blocks of code: First the switches and buttons, then the axes. The two blocks are separated by these lines: }) -- joystick axes join(res.axisCommands,{All additions for switches, pushbuttons etc must be before the "})". Maybe you have violated that rule? LeCuvier Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5 Link to comment Share on other sites More sharing options...
LeCuvier Posted September 23, 2018 Share Posted September 23, 2018 Why wont this work for a F18 Speed Brake Toggle?? (hold switch = Brake extend, Release =Retract) { down = hotas_commands.THROTTLE_SPEED_BRAKE, up = hotas_commands.THROTTLE_SPEED_BRAKE, cockpit_device_id = devices.HOTAS, value_down = 1.0, value_up = 0.0, name = _('Speed Brake Switch - TOGGLE'), category = {_('Throttle Grip'), _('HOTAS')}}, For EXTEND you should use "value_down = -1.0" and for RETRACT "value_up = 1.0". The code you tried to use would only switch between RETRACT and OFF (which holds the current position)- LeCuvier Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5 Link to comment Share on other sites More sharing options...
kakal Ice Posted September 24, 2018 Share Posted September 24, 2018 Hello grounders, in fact i don't know where place the line code,could you tell me or place exactly this line. I know the path :C:\Program Files\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\FA-18C\Input\FA-18C\joystick But exactly where i don't know. If i send you my default .lua (default_original.lua)can you show me where put the line code: { down = hotas_commands.THROTTLE_SPEED_BRAKE, up = hotas_commands.THROTTLE_SPEED_BRAKE, cockpit_device_id = devices.HOTAS, value_down = 1.0, value_up = 0.0, name = _('Speed Brake Switch - TOGGLE'), category = {_('Throttle Grip'), _('HOTAS')}}, or this line code: {down = hotas_commands.THROTTLE_SPEED_BRAKE, up = hotas_commands.THROTTLE_SPEED_BRAKE, cockpit_device_id = devices.HOTAS,value_down = -1.0, value_up = 1.0, name = _('Speed Brake 2-Pos Switch EXTEND/RETRACT'), category = {_('Throttle Grip'), _('HOTAS')}}, Thank you guys :pilotfly: Link to comment Share on other sites More sharing options...
LeCuvier Posted September 24, 2018 Share Posted September 24, 2018 @kakal Ice: The file begins with these lines: local cockpit = folder.."../../../Cockpit/Scripts/" dofile(cockpit.."devices.lua") dofile(cockpit.."command_defs.lua") local res = external_profile("Config/Input/Aircrafts/common_joystick_binding.lua") join(res.keyCommands,{ --------------------------------------------- -- Cheat ------------------------------------ --------------------------------------------- I recommend you insert your additions between these two lines: join(res.keyCommands,{ ---------------------------------------------Your first line of code is almost right, but the values are wrong. It should be "... value_down = -1.0, value_up = 1.0 ..." You can use this command with a push button or a maintained ON/OFF switch. When the contact closes, the speed brake will extend, and when the contact opens the speed brake will retract. You will not be able to extend the speed brake partially, because you have no OFF command. PS: Use Notepad++ for editing .lua files! Good luck! LeCuvier Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5 Link to comment Share on other sites More sharing options...
kakal Ice Posted September 25, 2018 Share Posted September 25, 2018 (edited) Hi thank you for having brought me an additional answer but i do that and he doesn't work. What that is is normal that I cannot select the compartment keyboard it remains tinted? Perhaps it's for that no ? Have a good day :) Edited September 25, 2018 by kakal Ice Forget Link to comment Share on other sites More sharing options...
kakal Ice Posted September 25, 2018 Share Posted September 25, 2018 NB: I used Notepad++ Link to comment Share on other sites More sharing options...
LeCuvier Posted September 25, 2018 Share Posted September 25, 2018 (edited) Hi thank you for having brought me an additional answer but i do that and he doesn't work. What that is is normal that I cannot select the compartment keyboard it remains tinted? Perhaps it's for that no ? Have a good day :) Are you saying that you want to use a keyboard button for the command? In that case you need to add the command to the default.lua in the "keyboard" folder. You kept mentioning your X-52 stick and therefore I told you the command should be added in the file under "joystick". Edited September 25, 2018 by LeCuvier LeCuvier Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5 Link to comment Share on other sites More sharing options...
The LT Posted October 15, 2018 Share Posted October 15, 2018 Is there any particular reason we can't put modified default.lua's in our Saved Games\DCS\Mods folder instead of base game directory? My controls & seat Main controls: , BRD-N v4 Flightstick (Kreml C5 controller), TM Warthog Throttle (Kreml F3 controller), BRD-F2 Restyling Bf-109 Pedals w. damper, TrackIR5, Gametrix KW-908 (integrated into RAV4 seat) Stick grips: Thrustmaster Warthog Thrustmaster Cougar (x2) Thrustmaster F-16 FLCS BRD KG13 Standby controls: BRD-M2 Mi-8 Pedals (Ruddermaster controller) BRD-N v3 Flightstick w. exch. grip upgrade (Kreml C5 controller) Thrustmaster Cougar Throttle Pilot seat Link to comment Share on other sites More sharing options...
jazzymanserg Posted October 25, 2018 Share Posted October 25, 2018 (edited) How I can realize long press button in default.lua of Su-25A ? I need momentary press button and generate long press button (~500ms) in DCS these string let me realize only momentary press of the button... {combos = {{key = '=', reformers = {'RShift'}}}, pressed = iCommandAltimeterPressureIncrease, up = iCommandAltimeterPressureStop, name = _('Altimeter Pressure Increase Su-25T'), category = _('Systems')}, Edited October 25, 2018 by jazzymanserg Link to comment Share on other sites More sharing options...
LeCuvier Posted October 25, 2018 Share Posted October 25, 2018 I suppose you want to generate a long (500 ms) key-press command from a very short physical signal (like from a rotary encoder). Unfortunately the FC3 aircrafts do not have a clickable cockpit and therefore no "clickabledata.lua". Therefore I see no way to do this through .lua edits. With external software like TARGET it could be done. LeCuvier Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5 Link to comment Share on other sites More sharing options...
v81 Posted November 8, 2018 Share Posted November 8, 2018 (edited) In order to understand what you are doing, read my tutorial earlier in this thread. If you don't find it let me know. No luck finding that tutorial. Searched the thread for all posts by you but still couldn't find it. Maybe i missed it, would be great if you could link it. Possibly even add it to your signature? :edit: Looking at setting up the Flaps switch on the Warthog Throttle for the SU-25T and SU-27 Would appear there is a command to toggle flaps up and down, and a command to set flaps to landing. It appears i might be missing separate ability to have flaps in the up and mid positions. Edited November 8, 2018 by v81 R7 3800X - 32Gig RAM -- All SSD -- GTX1070 -- TM Warthog, MFG Crosswinds & TiR Link to comment Share on other sites More sharing options...
LeCuvier Posted November 8, 2018 Share Posted November 8, 2018 No luck finding that tutorial. Searched the thread for all posts by you but still couldn't find it. Maybe i missed it, would be great if you could link it. Possibly even add it to your signature? Post #214 in this thread. For me that's on page 32 LeCuvier Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5 Link to comment Share on other sites More sharing options...
Recommended Posts