How to set up toggle switches (a tutorial) - Page 62 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 08-24-2019, 06:31 PM   #611
Bloody
Junior Member
 
Join Date: Jan 2019
Location: Poland
Posts: 25
Default

Yes you are totally right, but AFAIK we should be able to make something like 1 is - 1 and - 1 is 1, isn't it?
Bloody is offline   Reply With Quote
Old 08-25-2019, 09:01 AM   #612
LeCuvier
Senior Member
 
Join Date: May 2013
Location: South of France
Posts: 1,500
Default

Quote:
Originally Posted by Bloody View Post
Hello guys!

I'm trying to invert the EAC switch on Warthog for landing gear. Curently when I switch EAC up gear goes down and when EAC down the gear is up. I''d like to have them opposite. Could you help me?

My current code in default.lua:

{ down = iCommandPlaneGear, up = iCommandPlaneGear, cockpit_device_id = devices.GEAR_INTERFACE, value_down = -1.0, value_up = 1.0, name = _('Landing Gear Control Handle - UP/DOWN 2-Pos'), category = {_('Left Vertical Panel')}},
{ down = iCommandPlaneGear, name = _('Landing Gear Control Handle - UP/DOWN'),
You are not telling us which aircraft this is for. So I cannot test what I think.

However, I did a search across all the modules I have and I did not see any case where the "iCommandPlaneGear" uses the value_down and/or value_up expressions. Normally the iCommandPlaneGear command toggles between UP and DOWN.
For the F/A-18C I have created this line of code to do exactly what you want:
Code:
{down = iCommandPlaneGearUp, up = iCommandPlaneGearDown, name = _('Landing Gear Control Handle 2-Pos UP/DOWN'),    category = {_('Left Vertical Panel')}},
That same line would probably work with some other aircraft as well, but the "Category" should be changed of course.
Going forward, please make sure you indicate which aircraft you are looking at!
__________________
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
LeCuvier is offline   Reply With Quote
Old 08-25-2019, 09:43 AM   #613
Bloody
Junior Member
 
Join Date: Jan 2019
Location: Poland
Posts: 25
Default

Hi!

I'm flying F/A 18

Your CODE works! Thx a lot!
Bloody is offline   Reply With Quote
Old 08-26-2019, 05:14 AM   #614
Bloody
Junior Member
 
Join Date: Jan 2019
Location: Poland
Posts: 25
Default

Hello again!

I have another question. Is it possible to bind 3-pos switch in the bottom right corner of Warthog throttle to A/A and A/G mode in such a way that when I switch (up or down) mode is ON and when im switching back to the center position it goes OFF? Currently I need to double switch to turn it OFF.

BR
AG
Bloody is offline   Reply With Quote
Old 08-26-2019, 07:46 AM   #615
LeCuvier
Senior Member
 
Join Date: May 2013
Location: South of France
Posts: 1,500
Default

Quote:
Originally Posted by Bloody View Post
Hello again!
I have another question. Is it possible to bind 3-pos switch in the bottom right corner of Warthog throttle to A/A and A/G mode in such a way that when I switch (up or down) mode is ON and when im switching back to the center position it goes OFF? Currently I need to double switch to turn it OFF.

BR
AG
No, these commands are implemented as 2 mechanically independent spring-loaded pushbuttons with some logic behind them. I actually tried a few tricks but could not fool the software.
I use 2 pushbuttons on my DSD Button Box for these commands.
__________________
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
LeCuvier is offline   Reply With Quote
Old 09-08-2019, 04:17 PM   #616
Nagilem
Member
 
Join Date: Feb 2019
Location: Gilbert, AZ
Posts: 295
Default

I am currently flying the hornet and having some issues with creating toggles. Ive created something for my Master Arm, but these two don't look to have the code in the default lua for the toggle.

I would like to have toggles with warthog switches for

Flashlight
NVG goggles activation
Kneeboard Pop up

I am looking to NOT have to use the toggle twice... Anyone already solved these? I did some searches but nothing is popping up.
__________________
Specs: I9-9900k; ROG Strix RTX 2080ti; Valve Index HMD; 32GB DDR4 3200 Ram; Samsung 970 EVO 1TB SSD; TM Warthog with pedals, 3 TM MFDs
Nagilem is offline   Reply With Quote
Old 09-08-2019, 06:05 PM   #617
Nagilem
Member
 
Join Date: Feb 2019
Location: Gilbert, AZ
Posts: 295
Default

Ok. Got the goggles working...

Having issues with Flashlight, Kb pop, and Hook bypass. I can get the switch to work with up once for on up again for off configuration that is default, but none of them work as a toggle.

Any ideas for the F-18?
__________________
Specs: I9-9900k; ROG Strix RTX 2080ti; Valve Index HMD; 32GB DDR4 3200 Ram; Samsung 970 EVO 1TB SSD; TM Warthog with pedals, 3 TM MFDs
Nagilem is offline   Reply With Quote
Old 09-09-2019, 05:35 PM   #618
LeCuvier
Senior Member
 
Join Date: May 2013
Location: South of France
Posts: 1,500
Default

Here is what I use for the Hook Bypass switch:
Code:
{down = cptlights_commands.HookBypass, up = cptlights_commands.HookBypass,    cockpit_device_id = devices.CPT_LIGTHS,    value_down =  -1.0,    value_up = 1.0,    name = _('Hook Bypass 2-Pos Switch FIELD/CARRIER'), category = {_('Left Vertical Panel')}},
As to the flashlight, I have no idea what it is used for. I suppose you mean the command that is bound to LAlt + L. I found that it triggers the command 3256 and created this command for a 2-Pos ON/OFF switch:
Code:
{down = 3256, up = 3256, cockpit_device_id = 0,    value_down =  -1.0,    value_up =  0.0, name = _('Flashlight 2-Pos ON/OFF'), category = {_('View Cockpit'), _('Right Console')}},
As far as I can see it works.
As to the Kneeboard, I suppose you want to use a maintained 2-Pos ON/OFF switch to toggle between SHOW and HIDE. That is easily achieved by binding the existing command "Kneeboard glance view" to a maintained ON/OFF switch.
If those commands don't do what you are looking for, please provide a more specific description of your requirements.
__________________
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
LeCuvier is offline   Reply With Quote
Old 09-10-2019, 10:59 AM   #619
USA_Recon
Member
 
Join Date: Sep 2013
Posts: 255
Default

Just to confirm, as I want to set this up for some bindings in the F-15, if I make the changes in the 'saved games' input then it won't get overwritten in a patch correct ?
USA_Recon is offline   Reply With Quote
Old 09-10-2019, 12:18 PM   #620
LeCuvier
Senior Member
 
Join Date: May 2013
Location: South of France
Posts: 1,500
Default

Quote:
Originally Posted by USA_Recon View Post
Just to confirm, as I want to set this up for some bindings in the F-15, if I make the changes in the 'saved games' input then it won't get overwritten in a patch correct ?
The relevant "default.lua" has to be in the game folder. A modified "default.lua" copied to "...\Saved Games\DCS.openbeta\Config\Input\Bf-109K-4\joystick" has no effect. I just tested this again to see if it has changed, but unfortunately it hasn't.
__________________
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
LeCuvier is offline   Reply With Quote
Reply

Tags
controls, lua, tm warthog, toggle switches, tutorials

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:09 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.