Jump to content

How to set up toggle switches (a tutorial)


Recommended Posts

So i have to edit the lua in the A-10C Directory instead of the lua in the "saved Games" folder???

 

Yes.

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 comment
Share on other sites

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

 

Every time you update DCS your changes to the default.lua's will be purged. You can use JSGME to circumvent that.

Windows 10 64bit, Intel i9-9900@5Ghz, 32 Gig RAM, MSI RTX 3080 TI, 2 TB SSD, 43" 2160p@1440p monitor.

Link to comment
Share on other sites

Every time you update DCS your changes to the default.lua's will be purged. You can use JSGME to circumvent that.

 

That's what I meant. If you need more info on creating the mod, look at this http://forums.eagle.ru/showthread.php?t=98607

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 comment
Share on other sites

So - can i move my Old lua from "saved games" to "a-10c\input"? Or has the default lua some new parameters?

 

That should work, in theory.

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 comment
Share on other sites

That's what I meant. If you need more info on creating the mod, look at this http://forums.eagle.ru/showthread.php?t=98607

 

Thanks guys, I will look into that.

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 comment
Share on other sites

I guess I am kind of slow when it comes to editing files. Can someone tell me how to make the cannon switch in f-15c come on when I depress the first stage trigger and off when I release it and still have the fire command on the second stage?

"You should fly a fighter aircraft one inch from out of control at all times in a purposeful way" -Willie Driscoll USN (ret)

 

 

The State Military (CVW-17)

 

[sIGPIC][/sIGPIC]



 

VICTORY 103

F-14B BuNo 161435

VF-103

CAPT J. "Bowser" Mayse

http://www.statelyfe.com

Link to comment
Share on other sites

So - can i move my Old lua from "saved games" to "a-10c\input"? Or has the default lua some new parameters?

 

that's all I do. just drag and drop.

Asus ROG C6H | AMD Ryzen 3600 @ 4.2Ghz | Gigabyte Aorus Waterforce WB 1080ti | 32Gb Crucial DDR4/3600 | 2Tb Intel NVMe drive | Samsung Odyssey+ VR | Thrustmaster Warthog | Saitek pedals | Custom geothermal cooling loop with a homemade 40' copper heat exchanger 35' in the ground

Link to comment
Share on other sites

In order to make editing these lua files easier, I decided to build a DCS profiler.

With this tool it will be possible to assign functions to your controller like described in this topic.

 

Note: this is very much Work in Progress.

 

attachment.php?attachmentid=84427&stc=1&d=1372865026

 

Hey,

 

that looks realy what I am looking for. I hate it when I have to manually change the lua, just to find the combos to make a switch on off and not switch it twice to bring it back in the off position. Do you think of make a public release of that sweet software or is it just for your self? Many thanks in advance.

 

cheers,

 

Demon

  • Like 1

[sIGPIC][/sIGPIC]

Founder of the -=VDS=-

:pilotfly:

Link to comment
Share on other sites

To make a long story short, the diff only stores the difference between the "stock" DCS files and what you want to do. So even if you make a change to the original stock files, it's worthless unless you assign a key to it.

 

The BEST way to do this is to create NEW functions with NEW names instead of editing the existing ones.

 

1. Get JSGME (Generic Mod Enabler).

 

2. Setup the correct directory structure:

 

MODS/DCSW -- Controller Overrides/Config/Input/Aircrafts/

 

3. Copy base_joystick_binding.lua to your mods folder.

 

THEN:

 

A. Open base_joystick_binding.lua with notepad or notepad++.

 

B. Find the commands you want to edit:

 

{down = iCommandPlaneFlaps, name = 'Flaps Up/Down', category = 'Systems'},

{down = iCommandPlaneFlapsOn, name = 'Flaps Landing Position', category = 'Systems'},

{down = iCommandPlaneFlapsOff, name = 'Flaps Up', category = 'Systems'},

 

C. Change them to what you want them to do...AND...change the NAME to something unique:

 

{down = iCommandPlaneFlapsOn, up = iCommandPlaneFlaps, name = 'Flaps Switch Down', category = 'Systems'},

{down = iCommandPlaneFlapsOff, up = iCommandPlaneFlaps, name = 'Flaps Switch Up', category = 'Systems'},

 

4. Add the modded files via the Generic Mod Enabler

 

5. Configure the new commands with your joystick as you would normally.

 

The key point here is that if you rename the commands and store them all at the top of the file, when ED updates in the future, all you should need to do is remove the mod, grab the new file, and copy/paste in all of your changes.

 

This should also save you for having to keep multiple config files for each aircraft and instead let you change the base template to work properly for all aircraft.

 

My current config looks like this:

 

*snip*

 

keyCommands = {

 

{down = iCommandPlaneFlapsOn, up = iCommandPlaneFlaps, name = 'Alternate Flaps Switch Down', category = 'Systems'},

{down = iCommandPlaneFlapsOff, up = iCommandPlaneFlaps, name = 'Alternate Flaps Switch Up', category = 'Systems'},

{down = iCommandActiveJamming, up = iCommandActiveJamming, name = 'Alternate ECM', category = 'Countermeasures'},

{down = iCommandPowerOnOff, up = iCommandPowerOnOff, name = 'Alternate Power Switch', category = 'Systems'},

{down = iCommandPlaneFonar, up = iCommandPlaneFonar,name = 'Alternate Canopy Open/Close', category = 'Systems'},

{down = iCommandPlaneCockpitIllumination, up = iCommandPlaneCockpitIllumination, name = 'Alternate Illumination Cockpit', category = 'Systems'},

{down = iCommandPlaneGearUp, up = iCommandPlaneGearDown, name = 'Alternate Landing Gear Toggle', category = 'Systems'},

 

 

 

-- Gameplay

{down = iCommandMissionRestart, name = 'Restart Mission', category = 'Debug'},

 

*snip*

 

Note that I designated all of my created options with "Alternate" so they are easier to find in the menu.

Link to comment
Share on other sites

How to make custom up switches in DCS 1.28 for a specific aircraft:

(Here it shall be P-51D)

My objective: to make the EAC switch (BTN 24) on the Warthog throttle go to Gun camera sight when pointing forward (which means down/activated in the software) and go to Gun safety switch off when pointed aft (which means up/ deactivated in the software).

 

1. Open DCS World/ Mods/ aircrafts/ P-51D/ Input/ P-51D/ joystick.

2. Copy default.lua to a new folder on your desktop named P51D Custom Controls (or any other name you so choose).

3. Close everything.

4. Open the new copied default.lua with notepad++.

5. Search for:

--Front Switch Box

{down = device_commands.Button_7, cockpit_device_id = devices.FRONT_SWITCH_BOX, value_down = 1.0, name = 'Gun safety switch GUN CAMERA SIGHT', category = 'Front Switch Box'},

{down = device_commands.Button_7, cockpit_device_id = devices.FRONT_SWITCH_BOX, value_down = 0.0, name = 'Gun safety switch OFF', category = 'Front Switch Box'},

{down = device_commands.Button_7, cockpit_device_id = devices.FRONT_SWITCH_BOX, value_down = -1.0, name = 'Gun safety switch CAMERA SIGHT', category = 'Front Switch Box'},

{down = device_commands.Button_16, cockpit_device_id = devices.FRONT_SWITCH_BOX, value_down = 1.0, name = 'Gun safety switch (rotary)', category = 'Front Switch Box'},

 

Here we learn that the value 1.0 in the first line activates the Gun safety switch gun camera sight and value 0.0 activates the switch to the off position.

6. Copy the first command line with the 1.0 value at the top of the default.lua and add the up command.

7. Rename the command with any prefix such as alternate or whichever you so chose.

What you get is:

--Custom Polaris

{down = device_commands.Button_7, up = device_commands.Button_7, cockpit_device_id = devices.FRONT_SWITCH_BOX, value_down = 1.0, value_up = 0.0, name = ' Alternate Gun safety switch GUN CAMERA SIGHT', category = 'Front Switch Box'},

8. Replace the original default.lua of the P-51D as mentioned before either through JSGME or manually.

9. Open the DCS software and go into options>controls>P-51D

Now you have up there a new option named: Alternate Gun safety switch GUN CAMERA SIGHT.

10. Assign the EAC on the Warthog throttle to that option and...you're done.

 

It seems long and complicated but if you follow the above word for word, action for action, you'll see how easy it is and then configure your setup anyway you want.

 

Enjoy :)

 

Polaris


Edited by POLARIS1
  • Like 1

jgVplRQ.png

Link to comment
Share on other sites

Hi all,

 

honestly...that sucks. I do not have the time to reconfigure my whole profile over and over and over again after each patch. Is it so hard to make it at least a bit userfriendly? I mean we have to suffer a lot in DCS and we are more or less eating everything they throw in, but that is really starting to stress me out. I have over 124 buttons and switches to reconfigure and I just do not have the time for that. What about my kindly asked question on that piece of software shown in this thread? That really looks like a good tool. But why do we, the community, have to develop such a tool? I love DCS but that is taking way too much of my energy and time.

 

Just wanted to get rid of that thought. No need to answer nor to comment. Thanks.

 

Cheers,

 

Demon

[sIGPIC][/sIGPIC]

Founder of the -=VDS=-

:pilotfly:

Link to comment
Share on other sites

Couldn't you just move the lua profile you prepared for 1.2.7 from user directory to the game directory in 1.2.8? Name it either default.lua or name-of-your-controller.lua and it should work. If you made 124 buttons I can't believe you haven't made a backup.

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

+1 Though I like the flexibility of the DCS system, but messing up the config again and again really sucks.

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VIRPIL CM 50 Stick & Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

Couldn't you just move the lua profile you prepared for 1.2.7 from user directory to the game directory in 1.2.8? Name it either default.lua or name-of-your-controller.lua and it should work. If you made 124 buttons I can't believe you haven't made a backup.

 

hehe I have a backup of course. But it won't help me coz the structure ist again different from 1.2.7. Out of a reason which I don't know it doesnt work. Ermm, wait, I have 6 Inputdevices and each device has its own name. So how should I transfere those into the 1.2.8 folder? They changed the logic again. Allthough ED tries to get into controll of the all time changing profiles issue but I am really fed up with it and just wait until 1.4 where they solved that problem :joystick::joystick::smilewink:

 

Cheers,

 

Demon

[sIGPIC][/sIGPIC]

Founder of the -=VDS=-

:pilotfly:

Link to comment
Share on other sites

How to make custom up switches in DCS 1.28 for a specific aircraft:

(Here it shall be P-51D)

My objective: to make the EAC switch (BTN 24) on the Warthog throttle go to Gun camera sight when pointing forward (which means down/activated in the software) and go to Gun safety switch off when pointed aft (which means up/ deactivated in the software).

 

1. Open DCS World/ Mods/ aircrafts/ P-51D/ Input/ P-51D/ joystick.

2. Copy default.lua to a new folder on your desktop named P51D Custom Controls (or any other name you so choose).

3. Close everything.

4. Open the new copied default.lua with notepad++.

5. Search for:

--Front Switch Box

{down = device_commands.Button_7, cockpit_device_id = devices.FRONT_SWITCH_BOX, value_down = 1.0, name = 'Gun safety switch GUN CAMERA SIGHT', category = 'Front Switch Box'},

{down = device_commands.Button_7, cockpit_device_id = devices.FRONT_SWITCH_BOX, value_down = 0.0, name = 'Gun safety switch OFF', category = 'Front Switch Box'},

{down = device_commands.Button_7, cockpit_device_id = devices.FRONT_SWITCH_BOX, value_down = -1.0, name = 'Gun safety switch CAMERA SIGHT', category = 'Front Switch Box'},

{down = device_commands.Button_16, cockpit_device_id = devices.FRONT_SWITCH_BOX, value_down = 1.0, name = 'Gun safety switch (rotary)', category = 'Front Switch Box'},

 

Here we learn that the value 1.0 in the first line activates the Gun safety switch gun camera sight and value 0.0 activates the switch to the off position.

6. Copy the first command line with the 1.0 value at the top of the default.lua and add the up command.

7. Rename the command with any prefix such as alternate or whichever you so chose.

What you get is:

--Custom Polaris

{down = device_commands.Button_7, up = device_commands.Button_7, cockpit_device_id = devices.FRONT_SWITCH_BOX, value_down = 1.0, value_up = 0.0, name = ' Alternate Gun safety switch GUN CAMERA SIGHT', category = 'Front Switch Box'},

8. Replace the original default.lua of the P-51D as mentioned before either through JSGME or manually.

9. Open the DCS software and go into options>controls>P-51D

Now you have up there a new option named: Alternate Gun safety switch GUN CAMERA SIGHT.

10. Assign the EAC on the Warthog throttle to that option and...you're done.

 

It seems long and complicated but if you follow the above word for word, action for action, you'll see how easy it is and then configure your setup anyway you want.

 

Enjoy :)

 

Polaris

 

will try that now!thank you very much Polaris!rep inbound +1

 

EDIT: ok reading through your post, it seems, all you achieve with this is, to have a three way switch working as a two way one...and this is easy done with just assigning it directly ingame...what about making the middle position usable?for example, with my former profile, i had the grey "flaps" three way switch assigned to mixture full rich, run and idle...how do i achieve this now?

btw, i still dont see any benefit at all with this new system....excuse me for this rant, but this system sucks compared to what it was before...what is the benefit of having to adjust now the game files directly instead of having this stored handy in the user files?now you have to use jsgme to keep those files...this is crap...maybe i have overlooked something important here, but to me right now, this is only extremely annyoing...


Edited by 9./JG27 DavidRed
Link to comment
Share on other sites

DavidRed hi :)

 

The EAC switch on the Warthog throttle is a 2-way switch.

My example above makes the forward position of the switch activate the gunsight and moving the switch back moves the gunsight back to the safe position.

You can not do that with the regular options within DCS.

As for the flaps switch of the Warthog throttle...

It follows the exact same logic of the two way switch with one difference: instead of regarding it as a 3-way switch one should regard it as TWO 2-way switches with one switch being forward/center and the second one being aft/center.

The center is the same in both (if it's mixture then it should be programmed as mixture run= programmable up position).

 

1. Command for Mixture IDLE CUT OFF (value 0.0) and RUN (value 0.1):

{down = device_commands.Button_11, up = device_commands.Button_11, cockpit_device_id = devices.ENGINE_SYSTEM, value_down = 0.0, value_up = 0.1, name = 'Alternate Mixture IDLE CUT OFF', category = 'Flight Control'},

 

2. Command for Mixture EMERGENCY FULL RICH (value 0.2) and RUN (value 0.1):

{down = device_commands.Button_11, up = device_commands.Button_11, cockpit_device_id = devices.ENGINE_SYSTEM, value_down = 0.2, value_up = 0.1, name = 'Alternate Mixture EMERGENCY FULL RICH', category = 'Flight Control'},

 

Done and tested.

Attached is a JGSME ready mod that enables the 2-way gun sight (active and safe) and the 3-way mixture handle.

 

Polaris

P51D Custom Controls.rar


Edited by POLARIS1

jgVplRQ.png

Link to comment
Share on other sites

Works fine. Thanks for your help.

 

But I have a problem making the UH-1H 3-way switches work. For example the main weapon switch ("off/safe/armed up" and "off/safe/armed down"). I want them on the Warthog Throttle Laste 3-way-switch (PATH=armed, Alt/HDG=safe and ALT=off). Do you have a solution for this problem?


Edited by Lino_Germany

Kind regards,

 

Lino_Germany

Link to comment
Share on other sites

You're welcome Lino !

As for the 3-way switch you requested...in an initial examination of the UH-1H lua I think they have only two options programmed for the aircraft: Up, Down.

I can't seem to find a line or a value for an action such as armed or safe or of.

Besides the up or down options.

I'll try looking into it tomorrow.

jgVplRQ.png

Link to comment
Share on other sites

  • Recently Browsing   0 members

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