Jump to content

How to set up toggle switches (a tutorial)


Recommended Posts

Foreword

Hi all.

I noticed that some people have had some trouble setting up their TM Warthog's toggle switches (myself included) in games apart from A-10C.

Basically, when toggled to the ON state, they act as a button (that's being held down). On toggling them OFF, said button is released.

 

This is all fairly simple, but the result is that you have to flick the switch twice in order to toggle the function again.

 

This annoyed me, so I have gone poking around in the control Lua files and I can happily say I found a solution to these problems. detective.gif

I posted these in another thread, but I feel it warrants a thread of its own to help others in my situation.

 

I will assume you're all familiar with how to bind keys and switches in the simulator itself, and that you are familiar with a text editor of your choice.

These examples focus on the TM Warthog, however, you could also use another input device with toggle switches, in case you're building your own cockpit, etc. The methodology is the same no matter what you're using. (unless the ON and OFF states are two separate buttons in your setup)

The methods are slightly different between P-51D, A-10C and Black Shark 2.

 

So, without further ado, let's get started:

 

P-51D

The situation:

In this case, we want to bind the APU Switch on the TM Warthog Throttle to set the Ignition Switch to
BOTH
when flicked up and to set it to
OFF
when flicked down.

 

-----------------

 

First of all, have the key you want bound to the On state of the thing you want toggleable, in this case "
Ignition Switch BOTH"

 

Second of all, you need to find the lua file in question. I'm on Vista and can find it here:

C:\Users\
[NAME]
\Saved Games\DCS\Config\Input\P-51D\joystick

 

In that folder there will be a file named
"Throttle - Hotas Warthog"
, open that in either
Notepad
or for best results
Notepad++
(I use the latter).

 

 

Marvel at all the gibberish for a second, then find a line that looks like this (Note,
JOY_BTN20
is the APU Switch, it'll look different if you use some other switch):

 

{combos = {{key = "JOY_BTN20"}, }, down = 3002, cockpit_device_id = 13, value_down = 0.3, name = "Ignition switch BOTH", category = "Front Switch Box"}, 

This is the code that basically tells the sim that "When this button is pushed
down
, set the value of button
3002
(The Ignition Switch) on
cockpit_device_id 13
(which is the Front Switch Box) to
value_down = 0.3
(0.3, which corresponds to the
BOTH
setting)"

 

This is where the funsies start. You can edit the line to add "up = 3002," and "value_up = 0," to make it switch to
OFF
when the button is released.

In other words, make the line look like this:

 

{combos = {{key = "JOY_BTN20"}, }, down = 3002, up = 3002, cockpit_device_id = 13, value_down = 0.3, value_up = 0, name = "Ignition switch BOTH", category = "Front Switch Box"}, 

This will tell it that when
JOY_BTN20
is released, set the value of
Button 3002
on
cockpit_device_id 13
to
value_up = 0
, while retaining the original function.

 

The logic behind this can be found on the
"Ignition Switch OFF"
line:

 

{combos = {{key = "JOY_BTN24"}, }, down = 3002, cockpit_device_id = 13, value_down = 0, name = "Ignition switch OFF", category = "Front Switch Box"}, 

Note that I bound it to a key in order to highlight it during editing. This line will most likely look different to you.

 

This tells it to set the value of the
Ignition Switch
to
0
, which logically means that
0
is the
OFF
setting.

 

This obviously applies to every switch in the simulator, where you can find a separate option for each item. Just follow the logic described here and you shall succeed.

Black Shark 2 & A-10C

The Situation:

 

In this case, we want to toggle the
Laser Standby
switch with each flick of the
APU Start
switch on the TM Warthog Throttle.

 

---------------

 

As before, start out by binding the
ON
state of the switch you want to use to the function you want it to perform.

 

After that you can find the Lua file you need to edit there, on Vista.

C:\Users\
[NAME]
\Saved Games\DCS\Config\Input\ka-50\joystick

 

In that folder there will be a file named
"Throttle - Hotas Warthog"
, open that in either
Notepad
or for best results
Notepad++
(I use the latter).

 

{combos = {{key = "JOY_BTN20"}, }, down = iCommandPlaneLaserRangerOnOff, name = "Laser standby On/Off switch", category = "Ins Targeting Mode Controls Panel PVR"}, 

It looks very different from the code for P-51D. Instead of setting the value of various cockpit switches, button
down
sends the command
iCommandPlaneLaserRangerOnOff
which, fairly intuitively, toggles the laser standby switch.

 

HOWEVER!

Here is where BS2 is
vastly
inferior to A-10C and P-51D... there is no individual command for the On / Off state of these buttons (to my knowledge anyway, I deeply wish I am wrong), so the following is the best one can do:

{combos = {{key = "JOY_BTN20"}, }, down = iCommandPlaneLaserRangerOnOff, up = iCommandPlaneLaserRangerOnOff, name = "Laser standby On/Off switch", category = "Ins Targeting Mode Controls Panel PVR"}, 

By adding this bit:
"up = iCommandPlaneLaserRangerOnOff,"
to the command in question, you are basically having it send the command again when you flip the APU switch
OFF
.

Notes on the difference between BS2 and A-10C

If you have a TM Warthog, chances are you won't want to edit the default settings, what with them being both accurate and awesome, but I'm throwing this in here anyway for the sake of completeness.

 

The Lua files you need can be found under:

C:\Users\
[NAME]
\Saved Games\DCS\Config\Input\A-10C\joystick

(there's a pattern here, but clarity is always good) ;)

 

The main difference is that A-10C tends to have different button commands for different states of the switches. Demonstrated below by an excerpt from the Lua file controlling the venerable
APU Switch
.

 

{down = iCommandPlane_APU_Off, name = "APU Off", category = "Engine Control Panel"},
{down = iCommandPlane_APU_Start, name = "APU Start", category = "Engine Control Panel"},
{down = iCommandPlane_APU_Start, up = iCommandPlane_APU_Off, name = "APU Start/Off", category = "Engine Control Panel"},

As you can see, it works by sending commands in A-10C as well, but you have more of them to play with.

 

In the Black Shark example, we sent the
iCommandPlaneLaserRangerOnOff
command twice in order to emulate the actual effect of flicking the switch On and Off. But this has the disadvantage of risking that the switch becomes desynchronized on startup.

I.e the Off position on the physical switch can correspond to the On position in-Sim, and vice versa.

 

If this was in the style A-10C, we'd have the ability to tell it that
"down = iCommandPlaneLaserRangerOn"
and
"up = iCommandPlaneLaserRangerOff"
which avoids this problem and increases precision.

Now, I'm not 100% positive every switch in A-10C is set up in this manner, in which case a Black-Shark like solution is needed.

 

Closing notes

I hope this has been useful to you all, please leave feedback, positive comments and questions.

 

The clarifications regarding the different numerical codes and their meaning in the P-51D is based on logical conclusions I drew when staring at the file. I may very well be wrong, but the stuff mentioned in this file works, and has been tested by yours truly.

 

Finally, the mandatory thanks to ED for these simulators. I may be bashing Black Shark fairly liberally due to some lacking features which has induced hair-pulling and headscratching on some occasions.

 

I remember reading about the Black Shark for the first time in Swedish PC Gamer and I was like "Hmm, study sim... not for me.", but when I read about A-10C I was more like "I must have this!". On finding it on Steam, I bought it and promptly fell in love with it.

 

On finding out they were made by the same people I got Black Shark pretty much right away and found I loved it.

A-10C was my first flight simulator ever, and I tried others after it, but no. I have become spoiled by the sheer quality of these things.

So, thanks ED and everyone involved with making these awesome simulators. :thumbup:

 

Problems setting up switches on the HOTAS Warthog or similar?

Tutorial Here

Link to post
Share on other sites
  • Replies 852
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

For the launch bar maintained 2-position switch, this line works: {down = gear_commands.LaunchBarSw, up = gear_commands.LaunchBarSw, cockpit_device_id = devices.GEAR_INTERFACE, value_down = -1.0,

@Wildwind: Commands like "iCommand..." generally don't use arguments, and if you include any they are simply ignored. I created these new lines for your "default.lua": {down = 3004, cockpit_device_i

The 3 lines you show represent 3 anti-skid commands. The 1st one is for one pushbutton and toggles between ON and OFF each time you push it. The 2nd and 3rd lines are ON resp. OFF commands and re

if I understand your solution correctly, this will work for every device with switches, that binds them to joystick buttons. I have searched for a similar solution for myself, but didn't found any. if this will work, this would be of great benefit for many users - not only warthog owners. Even for me, because I'm currently building my own input panel with switches and X-keys (some kind of a "universal-mini-cockpit" with integrated MFCDs).

 

I have also asked the DCS support, if they know about a solution and they told me, they didn't support this... :music_whistling:


Edited by Nereid

DCS:A-10C / DCS:Ka-50 / DCS:UH-1H / DCS:Mig21bis / DCS:P-51D / DCS:Mi-8MTV2 / DCS:Fw190D9 / DCS:Bf109K4 / DCS:C-101EB / DCS:L-39C / DCS:F-5E / DCS:Spitfire LF Mk. IX / DCS:AJS37

Link to post
Share on other sites

You really made my day...

 

Having both, the DCS P-51 and, fresh from the shelf, the A2A P-51 for FSX I'm in the process of setting up my controllers for both of then as identical as it gets...

 

DCS P-51 was first so I did this profile first...

 

...but then in FSX (with a registered copy of FSUIPC) I found a way set up toggle switches, exactly like you...

...and was grumbling "...if I only could do the same in DCS :cry:"

 

And there comes deus ex machina, ...ehhrrr Spy Guy and has already solved the problem...

 

:flowers: Thanks !!!

Link to post
Share on other sites

Good info!

 

While I use the preset controls for A-10 for the most part, TARGET is my preferred way to program toggle switches in other sims/planes.

 

It's great to see that much of the same can be achieved within DCS itself though for those who'd rather do it that way (or don't own a HOTAS Hog).

[sigpic]http://www.virtualthunderbirds.com/Signatures/sig_LD.jpg[/sigpic]

Virtual Thunderbirds, LLC | Sponsored by Thrustmaster

 

Corsair 750D Case | Corsair RM850i PSU | ASUS ROG MAXIMUS X CODE | 32GB Corsair DDR4 3200 |

Intel i7-8086K | Corsair Hydro H100i v2 Cooler | EVGA GTX 1080 Ti FTW | Oculus Rift |

X-Fi Titanium Fatal1ty | Samsung SSD 970 EVO 1TB NVMe | Samsung SSD 850 EVO 1TB | WD Caviar Black 2 x 1TB |

TM HOTAS Warthog | TM Pendular Rudder | TM MFD Cougar Pack | 40" LG 1080p LED | Win10 |

Link to post
Share on other sites
  • 3 weeks later...

Great post helped me with my panel project and my DPDT toggle on off on switches :)

smallCATPILOT.PNG.04bbece1b27ff1b2c193b174ec410fc0.PNG

Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status

Windows 10 Pro x64, NVIDIA MSI RTX 2080Ti VENTUS GP, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 32GB DDR @3000, ASUS ROG Strix Z490-F Gaming, HP Reverb G2

Link to post
Share on other sites
  • 4 weeks later...

Noticed a slight change with DCS:WORLD 1.2.0

 

Example master arm A-10C with my controller button 19

Original

510 {combos = {{key = "JOY_BTN19"}, }, down = iCommandPlaneAHCPMasterArm, name = "Master switch ARM", category = "Armament HUD Control Panel"},

511 {down = iCommandPlaneAHCPMasterSafe, name = "Master switch SAFE", category = "Armament HUD Control Panel"},

 

 

Modified to release when button up for SAFE

510 {combos = {{key = "JOY_BTN19"}, }, down = iCommandPlaneAHCPMasterArm, [b][i][size="4"]up = iCommandPlaneAHCPMasterSafe,[/size][/i][/b] name = "Master switch ARM", category = "Armament HUD Control Panel"},

511 {down = iCommandPlaneAHCPMasterSafe, name = "Master switch SAFE", category = "Armament HUD Control Panel"},

 

 

-----------------------------------------------

 

 

Now a simple on off switch

 

{combos = {{key = "JOY_BTN1"}, }, down = iCommandPowerGeneratorLeft, up = iCommandPowerGeneratorLeft, name = "AC generator power left", category = "Electrical power control panel"},

 

 

 

I still need to finish my panel settings, but I hope this helps anyone using toggles in there pit's, I am still trying to work out the rest, it seems to have changed a lot more than I thought


Edited by BIGNEWY

smallCATPILOT.PNG.04bbece1b27ff1b2c193b174ec410fc0.PNG

Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status

Windows 10 Pro x64, NVIDIA MSI RTX 2080Ti VENTUS GP, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 32GB DDR @3000, ASUS ROG Strix Z490-F Gaming, HP Reverb G2

Link to post
Share on other sites

I'm sorry, Bignewy... but I can't tell the difference, except for the line numbering...?

 

510 {combos = {{key = "JOY_BTN19"}, }, down = iCommandPlaneAHCPMasterArm, name = "Master switch ARM", category = "Armament HUD Control Panel"}, 

Do you mean this bit:

[...] combos = {{key = "JOY_BTN19"}, } [...]

?

 

If you do, then I was a bit unclear in the section for the A-10C. The combos section denotes (fairly clearly) which button is bound to the action in question, and the lack of that bit only indicates the button is unbound on the device you're looking at.

 

Am I missing something now, or did I miss something when I wrote the tutorial? :P

Problems setting up switches on the HOTAS Warthog or similar?

Tutorial Here

Link to post
Share on other sites

So how can I make press switches behave like toggle ones ?

 

e.g Landing gear has also a toggle functionality Key binding but not EAC for example. Is there any way to create one for EAC etc ?


Edited by sungsam

DCS F16C 52+ w JHMCS ! DCS AH64D Longbow !

Link to post
Share on other sites

It must just be me then lol

 

I noticed a difference and had to redo my controllers lua file when using world.

 

I will take another look at my lua file.

 

It could just me getting confused, when using the "up" function in this case the master arm, instead of using the same command for the up I had to use the command from " iCommandPlaneAHCPMasterSafe" instead of "up = iCommandPlaneAHCPMasterArm,"

 

{combos = {{key = "JOY_BTN19"}, }, down = iCommandPlaneAHCPMasterArm, up = iCommandPlaneAHCPMasterSafe, name = "Master switch ARM", category = "Armament HUD Control Panel"},

 

and your first tutorial was spot on, helped me a lot :)


Edited by BIGNEWY

smallCATPILOT.PNG.04bbece1b27ff1b2c193b174ec410fc0.PNG

Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status

Windows 10 Pro x64, NVIDIA MSI RTX 2080Ti VENTUS GP, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 32GB DDR @3000, ASUS ROG Strix Z490-F Gaming, HP Reverb G2

Link to post
Share on other sites
  • 2 weeks later...

@BIGNEWY

That's the good thing about A-10C, because it's no big deal if the switch is in the wrong position when you start the simulator.

 

Glad you got it working, though :thumbup:

 

So how can I make press switches behave like toggle ones ?

 

e.g Landing gear has also a toggle functionality Key binding but not EAC for example. Is there any way to create one for EAC etc ?

 

I think there's been complaints about the EAC lacking a "cycle" command, because as it stands, it requires two buttons to operate, if you don't have a toggle switch at the ready.

I guess you could use some sort of script for it, where the pushbutton sends out alternating keypresses, but DCS does not appear to support this. I'll get back to you in case I find something, but you should search the forum because I seem to recall someone writing a tutorial on this before.

Problems setting up switches on the HOTAS Warthog or similar?

Tutorial Here

Link to post
Share on other sites
  • 2 months later...

Great info, it has been very helpful, thank you. I'm stuck on my ignition cover switch for the p-51. I'm using an (on) - off - (on) switch with a red flip down cover. When the cover is down it activates the bottom (on). In the sim this opens the cover, but I want it to close. This is the line I'm working with: joy btn5 is the bottom (on) i.e. momentary

{combos = {{key = "JOY_BTN5"}, }, down = 3010, up = 3010, cockpit_device_id = 15, value_down = 1, value_up = 0, name = "Starter Switch Cover", category = "Engine Control Panel"},

I also tried:

{combos = {{key = "JOY_BTN5"}, }, down = 3010, up = 3010, cockpit_device_id = 15, value_down = 0, value_up = 1, name = "Starter Switch Cover", category = "Engine Control Panel"},

 

Changing value_up = 1 or 0 seems to have no affect? I thought it would reverse the in game action of the cover but it does not. Any thoughts, thanks. (using gpwiz40 i/o)

 

Did some more playing around. I noticed that. When I start the sim the cover flips open, then I have to press the "starter" JOY_BTN3 twice, the first time fixes the in game cover, the second time actually activates the starter and then everything works as it should, including the cover. So it looks like the initial on state of the cover is what I need to change, any thoughts?


Edited by SoulHarvestor
Upon further review.
Link to post
Share on other sites

I was looking at this functionality last night. I'm used a momentary push button to activate the "Starter" switch (it's right above "Starter Switch Cover" in the LUA) and the game flipped up the cover for me automatically.

 

You set the down position to "Starter Switch Cover" (so it closes)

and the up position to "Starter" (this will open the cover AND flip the switch in game)

 

That way when you flip the switch down it closes the cover, when you flip the switch up it activates the starter (subsequently opening the starter cover in the game).

i7 2600 - 8G RAM - 570 GTX - SSD - T.Flight HOTAS X - TrackIR 5

Flying: P-51D

Videos

Link to post
Share on other sites
  • 1 month later...
Here is where BS2 is vastly inferior to A-10C and P-51D... there is no individual command for the On / Off state of these buttons (to my knowledge anyway, I deeply wish I am wrong), so the following is the best one can do

 

Have you or anyone else figured out if this is actually the case? I mean it is possible to configure:

 

Ins Weapons Status and Control Panel PUI-800

Burst length - long

Burst length - short

Ins Countermeasures dispensers UV-26

UV-26 Select Both boards

UV-26 Select Left board

UV-26 Select Right board

 

By using the following lines to bind buttons:

{combos = {{key = "JOY_BTN1"}, }, down = 3004, up = 3004, cockpit_device_id = 12, value_down = 0.2, value_up = 0.1, name = "Burst length - long", category = "Ins Weapons Status and Control Panel PUI-800"},
{combos = {{key = "JOY_BTN2"}, }, down = 3004, up = 3004, cockpit_device_id = 12, value_down = 0, value_up = 0.1, name = "Burst length - short", category = "Ins Weapons Status and Control Panel PUI-800"},
{combos = {{key = "JOY_BTN5"}, }, down = 3001, cockpit_device_id = 22, value_down = 0.1, name = "UV-26 Select Both boards", category = "Ins Countermeasures dispensers UV-26"},
{combos = {{key = "JOY_BTN3"}, }, down = 3001, cockpit_device_id = 22, value_down = 0, name = "UV-26 Select Left  board", category = "Ins Countermeasures dispensers UV-26"},
{combos = {{key = "JOY_BTN4"}, }, down = 3002, cockpit_device_id = 22, value_down = 0.2, name = "UV-26 Select Right board", category = "Ins Countermeasures dispensers UV-26"},

 

I guess it is possible to find cockpit_device_id's here:

C:\Program Files\Eagle Dynamics\DCS World\Mods\aircrafts\Ka-50\Cockpit\Scripts\devices.lua

 

And:

C:\Program Files\Eagle Dynamics\DCS World\Mods\aircrafts\Ka-50\Cockpit\Scripts\command_defs.lua

 

Taking a look at line 691-694 of the command_defs.lua, buttons on a panel (device_commands) seems to be numbered from 3001 and up to 3050. But where those numbers are defined I have not found out yet...

 

 

Controlling burst mode is done with device_command 3004 and values 0, 0.1 and 0.2. As you can see on lines 1-2 in the code above you can assign values to joystick buttons, when it is going up and down. In this way you can make the FLAPS-switch on the TM WH Throttle control burst lenght (as it was configured by default back in Black Shark 2 with TM WH connected):

 

Upper position: long burst lenght (value=0.2)

Middle: middle burst lenght (value=0.1)

Down: short burst length (value=0)

Please fix the KA-50 bugs :-)

 

Black Shark: Controller profile & setup, TrackIR profile, pit.

Warthog HOTAS: Lubing the stick and extending the stick.

Posts on howto customize switches in DCS &

.

Must-have mods for DCS World and KA-50 (mostly JSGME).

Casual couch pilot, watching capped.tv...

Link to post
Share on other sites
  • 1 month later...

Ok, I've been searching a bit more on the topic and found the following two posts. The first by Puddlemonkey outlines how to figure out the parameters and the second by MadCat describes a problem with the engine cut-off levers:

 

Hi,

 

The main problem I had was the fact most commands in BS toggle the switch rather than set its state. I realised though that most switches can easily be set to toggle using info from the clickabledata.lua and devices.lua

 

You then edit the appropriate controls lua file (Saved Games...\config\input\KA-50...

 

Here is an example from mine:

 

{combos = {{key = "JOY_BTN22"}, }, down = 3004, up = 3004, cockpit_device_id = 12, value_down = 0.2, value_up = 0.1, name = "Burst length - long", category = "Ins Weapons Status and Control Panel PUI-800"},

{combos = {{key = "JOY_BTN23"}, }, down = 3004, up = 3004, cockpit_device_id = 12, value_down = 0, value_up = 0.1, name = "Burst length - short", category = "Ins Weapons Status and Control Panel PUI-800"},

 

You can create this by looking up the control you want in clickabledata.lua and then cross referencing the devices.lua and command_defs.lua files to get the values.

 

 

This is the appropriate clickabledata line:

 

elements["SR-PTR"] = {class = {class_type.TUMB,class_type.TUMB}, hint = LOCALIZE("Weapon mode switch - Burst Length"), device = devices.WEAP_INTERFACE, action = {device_commands.Button_4,device_commands.Button_4} , stop_action = {}, arg = {400,400}, arg_value = {-direction*0.1,direction*0.1}, arg_lim = {{0.0, 0.2},{0.0, 0.2}}, use_OBB = true, updatable = true}

 

 

and from devices.lua:

 

devices["WEAP_INTERFACE"] = 12

 

 

The final relevant cross referencing is the device)commands.Button_4 being equal to 3004. You don't need to cross ref it every time as it is simply 3000 plus the button number. The relevant info is in command_defs.lua towards the end...

 

start_command = 3000

device_commands =

{

Button_1 = start_command + 1;

Button_2 = start_command + 2;

Button_3 = start_command + 3;

Button_4 = start_command + 4;

..........

 

 

Try as I might though, I cannot find a way of setting the AP route mode, I can only toggle it on/off - it isn't in clickable data. This is really annoying me so if anyone knows how to, please enlighten me :-)

 

I haven't tried but I wonder whether you can map a single 'joybtn' to two outputs - the first the cover and the second the switch.

The HELIOS software is quite good and can solve the issue of flipping the cover when you move the switch. However, I could not get the states of the switches to sync at the start of the mission so I abandonned it.

 

PM

 

Hey everyone,

 

as the search function didn't yield sufficient answers to my problem, I try to ask this way.

 

Inspired by this thread:

http://forums.eagle.ru/showthread.php?p=1428587#post1428587

 

I started creating stateful button commands for BS2 to better suit the Warthog's throttle switches.

So far everything worked out flawlessly and I created stateful commands for the Dust/Ice protection system, the burst lenght and the laser Standby/Off switches.

 

However the Fuel Cut-Off levers are giving me a headache.

This is the code I tried to implement into the keyboard.lua.

 

{down = 3009, cockpit_device_id = 4, value_down = 0.0, name = "Cut-Off Valve Left Engine Close", category = "Ins Engines start-up control panel and levers"},

 

As with all the previous codes I implemented, the new command shows up in the designated options and I can assign a button to it.

 

Now comes the annoying part.

It works and lets me move the Cut-Off lever up, however on the next press, the lever goes down again, so the effect is exactly the same as if I'd assign a button to the normal "left engine cut-off valve" command, hence the purpose of a stateful command is not fulfilled.

 

I rewrote the code now several times, tried several .lua files to implement it into, all with the same result that the newly assigned command still actuates the lever both ways.

Altering the value_down = # also shows no effect, I even tried "0.5" to no avail.

 

In addition to that, here are the parts from the clickabledata.lua and the devices.lua, where I got the values from.

 

elements["EMERGENCY-BRAKE ENGINE-LEFT-PTR"] = { class = {class_type.TUMB, class_type.TUMB}, hint = LOCALIZE("Left engine cut-off valve"), device = devices.ENGINE_INTERFACE, action = {device_commands.Button_9,device_commands.Button_9}, arg = {554,554}, arg_value = {direction*1.0,-direction*1.0}, arg_lim = {{0.0, 1.0},{0.0, 1.0}}, updatable = true, use_OBB = true}

 

devices["ENGINE_INTERFACE"] = 4

 

Maybe one of you guys knows what I'm doing wrong.

I'd be thankful for everyone trying to help.helpsmilie.gif

 

 

Thanks so far, greetings

MadCat

Please fix the KA-50 bugs :-)

 

Black Shark: Controller profile & setup, TrackIR profile, pit.

Warthog HOTAS: Lubing the stick and extending the stick.

Posts on howto customize switches in DCS &

.

Must-have mods for DCS World and KA-50 (mostly JSGME).

Casual couch pilot, watching capped.tv...

Link to post
Share on other sites
  • 5 months later...
Looks very cool Joe.

 

What is the advantage of doing this via the ingame lua files over a TARGET profile? The only thing i can think of is the ease of switching aircraft without switching profiles. But it seems a lot of work considering TARGET can do this for you. Am i missing something?

 

 

The biggest advantage is that this will work for every controller, not just the Warthog.

Another advantage is that you can make a separate setup for each aircraft, which will load as soon as you select that aircraft. You don't need to alt-tab out of the game to change your profile.

 

One drawback I noticed by editing the controller settings directly in the lua scripts is that the DCS controller options screen screws everything up when you view the settings and click OK.

Hence the idea to make a profiler instead of editing the lua files time and again.

It also prevents errors caused by typos :)

Dutch Flanker Display Team | LLTM 2010 Tiger Spirit Award
Link to post
Share on other sites
  • 5 months later...

I have a really dumb question... What do I use to connect my toggles and rotary stuff to USB? I have been using the DTA pulse generators and I was looking for a more reliable way to do this. I love the DTA stuff, but will Helios work with my cards or do I need something else? Some of the cards give a 'button1' pulse when the switch is flipped either way, and some of my cards give a 'button1' pulse when flipped up, and 'button2' pulse when flipped down. I also have Pushbutton boards and a special board for center-off switches that gives a pulse in all three positions '1,2,and3'... Hope I explained that right lol. What I want to do is interface my panels for my pit via USB and Helios...this seems to be a much more reliable way. I think I can just use the Pushbutton boards because there's no pulse. Flip the switch up and the light comes on and stays on, flip it down and it goes out. I hope someone can decode this post and help me lol. Thanks everyone!

[sIGPIC][/sIGPIC]

Link to post
Share on other sites
  • 4 months later...

Sorry to resurrect, but I was using this in 1.2.7 and 1.2.8 broke it.

 

Is there any way to still do this on 1.2.8? I don't like the Target Software and the idea that I have to tell it to enable the script every time I want to fly, just want it native. I use the EAC for landing gear and the Radar Altimeter for master arm.

 

Can't figure out how to remap with the new control lua.

 

Thanks for any help!

My Specs

Asus Maximus Hero IX Z270

i7 7700k @ 4.7GHz

32GB G.SKILL TridentZ 3700MHz DDR4

EVGA RTX 2080Ti

Samsung 960 Evo 1TB M.2 NVME SSD

EVGA SuperNOVA 1200 P2

Acer XB270HU 144Hz @ 1440p (IPS)

Valve Index

 

OOOOhhh, I wish I had the Alpha of a Hornet!

Link to post
Share on other sites
Sorry to resurrect, but I was using this in 1.2.7 and 1.2.8 broke it.

 

Is there any way to still do this on 1.2.8? I don't like the Target Software and the idea that I have to tell it to enable the script every time I want to fly, just want it native. I use the EAC for landing gear and the Radar Altimeter for master arm.

 

Can't figure out how to remap with the new control lua.

 

Thanks for any help!

 

You can still do the same things as before. The only issue is that now you have to do it in the default lua file for that aircraft/controller. The structure of the original lua files has not changed, just the structure of the Saved Profle lua.

 

I recommend making your normal changes but leave out the part that actually assigns the button/switch then map your controls in sim and it will be using your modifications. Once you have modded the game files, just make a JSGME mod for future use (of course changes to the default control luas will require making new mod files but...).

  • Like 1

ASUS ROG Maximus VIII Hero, i7-6700K, Noctua NH-D14 Cooler, Crucial 32GB DDR4 2133, Samsung 950 Pro NVMe 256GB, Samsung EVO 250GB & 500GB SSD, 2TB Caviar Black, Zotac GTX 1080 AMP! Extreme 8GB, Corsair HX1000i, Phillips BDM4065UC 40" 4k monitor, VX2258 TouchScreen, TIR 5 w/ProClip, TM Warthog, VKB Gladiator Pro, Saitek X56, et. al., MFG Crosswind Pedals #1199, VolairSim Pit, Rift CV1 :thumbup:

Link to post
Share on other sites
You can still do the same things as before. The only issue is that now you have to do it in the default lua file for that aircraft/controller. The structure of the original lua files has not changed, just the structure of the Saved Profle lua.

 

I recommend making your normal changes but leave out the part that actually assigns the button/switch then map your controls in sim and it will be using your modifications. Once you have modded the game files, just make a JSGME mod for future use (of course changes to the default control luas will require making new mod files but...).

 

 

That did it, thanks for the help. Although not sure what you mean with the JSGME mod.

My Specs

Asus Maximus Hero IX Z270

i7 7700k @ 4.7GHz

32GB G.SKILL TridentZ 3700MHz DDR4

EVGA RTX 2080Ti

Samsung 960 Evo 1TB M.2 NVME SSD

EVGA SuperNOVA 1200 P2

Acer XB270HU 144Hz @ 1440p (IPS)

Valve Index

 

OOOOhhh, I wish I had the Alpha of a Hornet!

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...