Jump to content

How to set up toggle switches (a tutorial)


Recommended Posts

I corrected thanks. but still does not work Arrestor Hook.

Система 10 про. Железяки: Мать Z690M, ccd m2 500gb,  i5 12600, 3090 24gb., DDR4 64gb (2667), монитор LG C1 4K 120Hz 55, Opentrack.

Link to comment
Share on other sites

Thank you for your work. Another question is how to flip the switch, release down, upscale?

Система 10 про. Железяки: Мать Z690M, ccd m2 500gb,  i5 12600, 3090 24gb., DDR4 64gb (2667), монитор LG C1 4K 120Hz 55, Opentrack.

Link to comment
Share on other sites

Thank you for your work. Another question is how to flip the switch, release down, upscale?

 

I don't know if I understand you right:

down = key pressed

up = key released

normal:

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

twisted:

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

Link to comment
Share on other sites

You now write commands for the wheels, I need to Arrestor Hook?

Система 10 про. Железяки: Мать Z690M, ccd m2 500gb,  i5 12600, 3090 24gb., DDR4 64gb (2667), монитор LG C1 4K 120Hz 55, Opentrack.

Link to comment
Share on other sites

New Question...

 

Im trying to get the FW190 Landing gear retraction to operate from a single switch. ( the FW190 requires a GEAR RETRACTION SWITCH COVER to be opened before gear can be retracted)

 

How can I bind BOTH the GEAR UP and the RETRACTION COVER OPEN to the same switch?

 

eg, I want to select GEAR UP and it will open the cover AND select gear up.

Occulus Rift i7-7700 3.6Ghz 16GB Ram 1080Ti 11GB SSDx2

Link to comment
Share on other sites

New Question...

 

Im trying to get the FW190 Landing gear retraction to operate from a single switch. ( the FW190 requires a GEAR RETRACTION SWITCH COVER to be opened before gear can be retracted)

How can I bind BOTH the GEAR UP and the RETRACTION COVER OPEN to the same switch?

eg, I want to select GEAR UP and it will open the cover AND select gear up.

You cannot initiate multiple commands with a single switch in DCS - not even by modifying the "default.lua". You will need to use external software (like TARGET if you have Thrustmaster controls) to set that up.

But since you are obviously not looking for total realism, why don't you simply bind the command 'Landing Gear Up/Down' to a pushbutton? With this command you don't have to worry about the switch vover.

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

You cannot initiate multiple commands with a single switch in DCS - not even by modifying the "default.lua". You will need to use external software (like TARGET if you have Thrustmaster controls) to set that up.

But since you are obviously not looking for total realism, why don't you simply bind the command 'Landing Gear Up/Down' to a pushbutton? With this command you don't have to worry about the switch vover.

 

Thanks. I suspected as much.

 

Re Total Realism... My Sim chair/HOTAS/button boxes were designed to be a GENERIC controller for all my VR aircraft. I try to utilise as many common functions/switches as possible. I have only just started mapping the FW190 and have committed to the Undercarriage switch i have- which unfortunately dosnt use a Gear UP/DOWN push button. Thats OK- you cant win them all!.

 

I have your 'how to' .pdf on control bindings but am still getting the occasional hiccup... Can you possibly help with these two?

 

1. My "Master Arm ON/OFF' script for the FW190 wont seem to work in the correct sense ie: Down for OFF and UP for ON. I have tried changing the values for UP and Down to 1, -1, 0, (every possible combination) but it always works in the wrong sense. The script below works correctly in other aircraft iv used it on.

 

{down = device_commands.Button_13, up = device_commands.Button_13, cockpit_device_id = devices.WEAPON_SYSTEM, value_down = 1.0, value_up = -1.0, name = _('Master Arm ON/OFF Innes'), category = _('Weapon System')},

 

 

2. FW190 Radiator Flaps. Im trying to have them operate from my HOTAS push Button (latchable) where they will open while i hold the button down/latch, and close when released. I managed to achieve this on the A10 but the FW190 uses "pressed" scripting which Im not familiar with. see below- my attempt is the last line:

 

{pressed = device_commands.Button_14, cockpit_device_id = devices.CONTROL_SYSTEM, value_pressed = -0.1, name = _('Radiator Flaps Close'), category = _('Engine Control')},

 

{pressed = device_commands.Button_14, cockpit_device_id = devices.CONTROL_SYSTEM, value_pressed = 0.1, name = _('Radiator Flaps Open'), category = _('Engine Control')},

 

{down = device_commands.Button_14, up = device_commands.Button_14,cockpit_device_id = devices.CONTROL_SYSTEM, value_down = -0.1, value_up = 0.0, name = _('Radiator Flaps Toggle'), category = _('Engine Control')},

Occulus Rift i7-7700 3.6Ghz 16GB Ram 1080Ti 11GB SSDx2

Link to comment
Share on other sites

...

1. My "Master Arm ON/OFF' script for the FW190 wont seem to work in the correct sense ie: Down for OFF and UP for ON. I have tried changing the values for UP and Down to 1, -1, 0, (every possible combination) but it always works in the wrong sense. The script below works correctly in other aircraft iv used it on.

 

{down = device_commands.Button_13, up = device_commands.Button_13, cockpit_device_id = devices.WEAPON_SYSTEM, value_down = 1.0, value_up = -1.0, name = _('Master Arm ON/OFF Innes'), category = _('Weapon System')},

The command "device_commands.Button_13" is unfortunately designed for a pushbutton. I could make it work with a maintained ON/OFF switch only in missions that start on the ground, where the master arm switch in the cockpit is OFF at mission start. For missions starting in the air its operation is always inversed.

But the cockpit switch is a maintained ON/OFF switch and you find it in "clickabledata.lua" as "device_commands.Button_3". So this code works better:

{down = device_commands.Button_3, up = device_commands.Button_3, cockpit_device_id  = devices.WEAPON_SYSTEM, value_down = 1.0, value_up = 0.0,   name = _('Master Arm 2-Pos. ON/OFF'), category = _('Weapon System')},

Note: The software does not register the OFF command unless it has registered an ON command before. So for missions starting in the air (where the switch is ON by default), if you want to switch master arms OFF, you have to switch from OFF to ON before you can actually switch master arms OFF.

I may be able to look into your other question Saturday.

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

The command "device_commands.Button_13" is unfortunately designed for a pushbutton. I could make it work with a maintained ON/OFF switch only in missions that start on the ground, where the master arm switch in the cockpit is OFF at mission start. For missions starting in the air its operation is always inversed.

But the cockpit switch is a maintained ON/OFF switch and you find it in "clickabledata.lua" as "device_commands.Button_3". So this code works better:

{down = device_commands.Button_3, up = device_commands.Button_3, cockpit_device_id  = devices.WEAPON_SYSTEM, value_down = 1.0, value_up = 0.0,   name = _('Master Arm 2-Pos. ON/OFF'), category = _('Weapon System')},

Note: The software does not register the OFF command unless it has registered an ON command before. So for missions starting in the air (where the switch is ON by default), if you want to switch master arms OFF, you have to switch from OFF to ON before you can actually switch master arms OFF.

I may be able to look into your other question Saturday.

 

Unfortunately this Button 3 script works inverted also.

Thanks for the reply LeCuvier

Occulus Rift i7-7700 3.6Ghz 16GB Ram 1080Ti 11GB SSDx2

Link to comment
Share on other sites

Unfortunately this Button 3 script works inverted also.

Thanks for the reply LeCuvier

It doesn't here. Strange; will have another look later

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

Unfortunately this Button 3 script works inverted also.

Thanks for the reply LeCuvier

I wonder if we aren't caught in a misunderstanding?

Just to be clear: In the "default.lua", "down" does not mean that the switch's lever is in the down position. It means that the switch is "ON", i.e. its contact is closed. And vice versa for "up".

If that was your understanding I'm a bit puzzled. I cannot see how it would be inversed on your rig. But just for fun, I tried the following code. It works inversed on my rig. Maybe it works right on yours:

{down = device_commands.Button_3, up = device_commands.Button_3, cockpit_device_id  = devices.WEAPON_SYSTEM, value_down = 0.0, value_up = 1.0,   name = _('Master Arm 2-Pos. ON/OFF'), category = _('Weapon System')},

Please, give it a try!

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

I wonder if we aren't caught in a misunderstanding?

Just to be clear: In the "default.lua", "down" does not mean that the switch's lever is in the down position. It means that the switch is "ON", i.e. its contact is closed. And vice versa for "up".

If that was your understanding I'm a bit puzzled. I cannot see how it would be inversed on your rig. But just for fun, I tried the following code. It works inversed on my rig. Maybe it works right on yours:

{down = device_commands.Button_3, up = device_commands.Button_3, cockpit_device_id  = devices.WEAPON_SYSTEM, value_down = 0.0, value_up = 1.0,   name = _('Master Arm 2-Pos. ON/OFF'), category = _('Weapon System')},

Please, give it a try!

 

Hi again

 

No.. The FW190 Armerment switch remains inverse. eg Weapons Armed when I switch down and Disarmed when I switch UP. Changing the values does not changed a thing?!

 

I checked to see if i had my switch upside down - but No. Win Controller Properties shows the Switch closed when Up as expected.

 

Wierd

Occulus Rift i7-7700 3.6Ghz 16GB Ram 1080Ti 11GB SSDx2

Link to comment
Share on other sites

Hi again

 

No.. The FW190 Armerment switch remains inverse. eg Weapons Armed when I switch down and Disarmed when I switch UP. Changing the values does not changed a thing?!

 

I checked to see if i had my switch upside down - but No. Win Controller Properties shows the Switch closed when Up as expected.

 

Wierd

I suppose...

1. this is in version 1.5.7?

2. you have added the control binding for the master arm switch after changing the default.lua?

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

1.5.6 and yes- I reassigned the control binding after the changes.

I cannot belive this! Have you gotten any modification of the default.lua to work?

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

I cannot belive this! Have you gotten any modification of the default.lua to work?

 

yes. I got a this one to work:

 

{down = device_commands.Button_16, up = device_commands.Button_16, cockpit_device_id = devices.ENGINE_SYSTEM, value_down = 1.0, value_up = 0.0, name = _('MW-50 Boost ON/OFF'), category = _('Engine Control')},

Occulus Rift i7-7700 3.6Ghz 16GB Ram 1080Ti 11GB SSDx2

Link to comment
Share on other sites

yes. I got a this one to work:

 

{down = device_commands.Button_16, up = device_commands.Button_16, cockpit_device_id = devices.ENGINE_SYSTEM, value_down = 1.0, value_up = 0.0, name = _('MW-50 Boost ON/OFF'), category = _('Engine Control')},

1. Master Arm: I wonder if your "...diff.lua (under "C:\Users\hans\Saved Games\DCS\Config\Input\FW-190D9\joystick") might be messed up. In your place I would delete that file and re-do all bindings for the .diff.lua of your button box.

2. Radiator Flaps:

The "pressed" command is intended for commands that produce a continuous mouvement as long as you press the bound button, and stop moving when you release the button. The mouvement can end in any position. Example: Altimeter, Compass Course, Radiator Flaps, Instrument Brightness etc.

This is different from a "down" or "up" command which will just switch from one state to another.

The radiator flaps should use the "pressed" command as the flaps can be opened to any position between fully open and closed. The solution you propose will not allow you to open the radiator flaps partially. If you still want to go ahead with it I can try.

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

Radiator Flaps

 

@vortexringstate: I have tried to create a OPEN/CLOSED command. This does not work as the command does not work with "down" and "up" at all. It requires a 3-state switch input ON/OFF/ON with spring return to OFF.

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

  • 3 weeks later...
How would you use target to do what is done with the .lua code editing? I prefer using a gui instead of hundreds of lines of code.

 

Use TARGET TARGETGUI.exe to set up you commands per button per the manual.

 

Create 'new',

use 'basic' otherwise you'll have those 5x 'shifted' states unless you want that,

assign which controllers you want to use,

assign Axis (leave default),

assign commands to buttons by double click the button and then

type 'Event Name'

(f.i. 'gear up AND down' which would involve not just 'Pulse', but rather both a 'Press' and a 'Release)

Add Event and Save Event which then shows up in the right column 3. of events

'SAVE' (bottom left) this script TARGETGUI script so it is actually a file for safekeeping

'RUN CONFIGURATION' to test the script

when OK (save again if you forgot)

do

VIEW SCRIPT this is the TARGETScriptEditor.exe version of the commands file

(you need to learn the TARGETScriptEditor syntax which is much quicker)

 

you now have 3 options

1 - always load though the TargetGUI and "Run Configuration"

2 - or, run the script translation created by 'VIEW SCRIPT' with TARGETScriptEditor

3 - or, you run the script translation created by 'VIEW SCRIPT' a .tmc file that is a definitions batch as a command line with TargetGUI

 

simple what? (yep Thrustmaster did a horrible job)

 

So to set up a KA-50 script, you

- test an define starting with TargetGUI (and save f.i. as <KA-50.fcf>)

- then you create a .tmc file by 'VIEW SCRIPT' that you can run with TARGETScriptEditor (and saved as <KA-50.tmc>

- then when all is tested and running nicely you can run the .tmc <KA-50.tmc> as a command line with TargetGUI in for instance a setup batch file, as in my KA-50_setup.bat that loads my trackIR etc and has the line

 

rundll32 shell32.dll,ShellExec_RunDLL "k:\Program Files (x86)\Thrustmaster\TARGET\x64\TARGETGUI.exe" -r "i:\TEKST\My Games\DCS\TMTARGET_profiles\KA-50.tmc"

 

after you have learned the syntax of the .tmc file, that's a lot quicker.

| VR goggles | Autopilot panel | Headtracker | TM HOTAS | G920 HOTAS | MS FFB 2 | Throttle Quadrants | 8600K | GTX 1080 | 64GB RAM| Win 10 x64 | Voicerecognition | 50" UHD TV monitor | 40" 1080p TV monitor | 2x 24" 1080p side monitors | 24" 1080p touchscreen |

Link to comment
Share on other sites

How would you use target to do what is done with the .lua code editing? I prefer using a gui instead of hundreds of lines of code.

 

Well, that's too bad for you, as it is much easier to fix the code instead of fumbling around with a crappy GUI.

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

Well, that's too bad for you, as it is much easier to fix the code instead of fumbling around with a crappy GUI.

I have used TARGET and I didn't find it crappy. You can do things with TARGET that you cannot do with .lua editing, e.g. generating a sequence of commands with one pushbutton press.

However, when I started using TrackIR and now had two pieces of software that had to work alongside with DCS World, I had rather frequent malfunctions. So my love for TARGET cooled somwhat. Nowadys I use the VIRPIL T-50 joystick and TARGET doesn't work with that. So TARGET isn't even an option any more.

I understand there are other programs that are conceptually similar to TARGET and work with most HOTAS devices; but I have come to the conclusion that any solution requiring multiple pieces of software to inter-operate has a relatively high potential for failure.

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

  • Recently Browsing   0 members

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