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


Notices

Reply
 
Thread Tools Display Modes
Old 07-16-2019, 01:51 PM   #591
LeCuvier
Senior Member
 
Join Date: May 2013
Location: South of France
Posts: 1,482
Default

The code presented by ZBot should work. In the name I would probably use "...UP/DOWN" instead of "...ON/OFF", but that's only a detail.

For the speedbrake, the command you created will work with an ON/OFF switch if you give it a distinct name. You gave your command the same name as an existing command and that's a fundamental mistake. Names must always be unique. From a practical point of view, I don't see why you want to create this command as an ON/OFF. The existing code supports use of the speed brake switch of the TM WH throttle and it gives perfect operation, including ability to hold the brake in a partially extended state.
__________________
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

Last edited by LeCuvier; 07-16-2019 at 04:37 PM.
LeCuvier is offline   Reply With Quote
Old 07-16-2019, 11:07 PM   #592
hrnet940
Junior Member
 
Join Date: Jan 2018
Location: Nova Scotia, CANADA
Posts: 23
Default

Thanks to both of you. How would that look and how do I get the line/statement from ZBot into the default.lua and where does it need to be placed? I found what was there and changed it. I am not a programmer, but willing to learn what I need to get going towards my eventual cockpit completed and fully functioning. Thanks Again!
__________________
Wayne Wilson
AKA: hrnet940
Alienware Aurora R3, i7 3.5GHz(4.2GHz setting) processor, Nvidia GeForce GTX 660 1.5GB Graphics, 16GB Ram, 1TB SSD.

Last edited by hrnet940; 07-16-2019 at 11:11 PM. Reason: Left vital information out.
hrnet940 is offline   Reply With Quote
Old 07-16-2019, 11:28 PM   #593
ZBoT
Junior Member
 
Join Date: Jan 2012
Posts: 48
Default

Quote:
Originally Posted by hrnet940 View Post
Thanks to both of you. How would that look and how do I get the line/statement from ZBot into the default.lua and where does it need to be placed? I found what was there and changed it. I am not a programmer, but willing to learn what I need to get going towards my eventual cockpit completed and fully functioning. Thanks Again!
For the A-10 the file is located here on my machine:
C:\Program Files\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\A-10C\Input\A-10C\joystick\default.lua

I do suggest you download and read LeCuvier's how-to pdf. It is excellent. It will answer many of your questions and summarizes the 60 pages of this forum nicely.
ZBoT is offline   Reply With Quote
Old 07-17-2019, 09:49 AM   #594
LeCuvier
Senior Member
 
Join Date: May 2013
Location: South of France
Posts: 1,482
Default

Quote:
Originally Posted by hrnet940 View Post
Thanks to both of you. How would that look and how do I get the line/statement from ZBot into the default.lua and where does it need to be placed? I found what was there and changed it. I am not a programmer, but willing to learn what I need to get going towards my eventual cockpit completed and fully functioning. Thanks Again!
You don't need to be a programmer. Just read the how-to guide. It's only 14 pages. If you don't take the time to read you will probably waste more time figuring out what you did wrong.
And don't forget that any update will overwrite your modified file. Recommendation: install and set up OvGME to back out and restore your modified files.
__________________
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 07-18-2019, 05:06 PM   #595
ZBoT
Junior Member
 
Join Date: Jan 2012
Posts: 48
Default

Quote:
Originally Posted by LeCuvier View Post
Recommendation: install and set up OvGME to back out and restore your modified files.
Thanks @LeCuvier!! I wasn't aware of the OvGME tool. That works out nicely for managing these modified files.
ZBoT is offline   Reply With Quote
Old 07-27-2019, 12:07 PM   #596
royphsle
Junior Member
 
royphsle's Avatar
 
Join Date: Jun 2018
Location: Norway
Posts: 46
Default

Hi all, is it possible to make a 3 possition command for the Bf-109 flaps like up-half-down? It works with the F-14 flaps who also use axis command for the flaps.
And one more thing, is it possible to make the same command for the P-51 and Mig-15 flaps, up-take off-landing possition?
__________________
-royphsle

F-16C
i7-4790 CPU 3.60GHz | 16 GB RAM | MSI GTX-960 Gaming 4GB | TM Warthog HOTAS | MFG Crosswind Pedals | TrackIR 5
royphsle is offline   Reply With Quote
Old 07-27-2019, 01:13 PM   #597
LeCuvier
Senior Member
 
Join Date: May 2013
Location: South of France
Posts: 1,482
Default 3 or 4-Position Command for Bf-109 Flaps

Quote:
Originally Posted by royphsle View Post
Hi all, is it possible to make a 3 possition command for the Bf-109 flaps like up-half-down? It works with the F-14 flaps who also use axis command for the flaps.
And one more thing, is it possible to make the same command for the P-51 and Mig-15 flaps, up-take off-landing possition?
The Bf-109 flaps are an axis and it's generally easy to implement switch commands for an axis. You asked for 3-position and I ive you the option for a 4-positio command with these lines:
Code:
{down = device_commands.Button_94, up = device_commands.Button_94, cockpit_device_id = devices.CONTROLS, value_down = 1.0, value_up = 0.5, name = _('Flaps Flight/25% Out'), category = _('Flight Control')},
{down = device_commands.Button_94, up = device_commands.Button_94, cockpit_device_id = devices.CONTROLS, value_down = -1.0, value_up = -0.0, name = _('Flaps Land/50% Out'), category = _('Flight Control')},
With the 109 I usually take off with flaps fully retracted, except if I carry a bomb. However I tried, and take-off with flaps 50% out even without bomb load works well. The command lines above will extend the flaps to 25 % when you switch from UP to MIDDLE, and to 50% if you switch from DOWN to MIDDLE. If you only want 3 positions, simply change the "value_up" values so they are the same in both lines.
I'm actually glad you asked this question for I now use the 4-position command and that frees up my left throttle axis for the Bf-109.
__________________
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 07-27-2019, 02:16 PM   #598
LeCuvier
Senior Member
 
Join Date: May 2013
Location: South of France
Posts: 1,482
Default 3 or 4-Position Command for P-51D Flaps

Quote:
Originally Posted by royphsle View Post
... And one more thing, is it possible to make the same command for the P-51 and Mig-15 flaps, up-take off-landing possition?
For the P-51 there is a solution using the command ID of the flaps lever in the cockpit:
Code:
{down = device_commands.Button_1, up = device_commands.Button_1, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, value_up = 0.8, name = _('Flaps FLIGHT/10° OUT'), category = _('Flight Control')},
 {down = device_commands.Button_1, up = device_commands.Button_1, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 0.0, value_up = 0.6, name = _('Flaps LAND/20° OUT'), category = _('Flight Control')},
Again, the P-51 normally takes off with flaps in the UP position, but can take off with flaps extended to 15 - 20°. The flaps can be set from UP to 50° in ratcheted steps of 10".
The lines above provide the positions UP, 10° out, 20° out and DOWN (50°).
You can play with the "value_up" values just like for the Bf-109.

As to the Mig-15. I don't have that plane and therefore don't know what's possible. If you provide me with the "default.lua" and "clickabledata.lua" per PM, I can try to figure it out.
__________________
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 07-28-2019, 02:06 PM   #599
royphsle
Junior Member
 
royphsle's Avatar
 
Join Date: Jun 2018
Location: Norway
Posts: 46
Default

Quote:
Originally Posted by LeCuvier View Post
For the P-51 there is a solution using the command ID of the flaps lever in the cockpit...
Thanks, it works perfectly When I pasted the Bf-109 command at the top of the lua file, in the correct block, many commands turned yellow in the game?! But when I changed it to the bottom of the block, the yellow commands disappeared fortunately. I have experienced yellow commands in the game control options before, just a few commands, with some aircraft. Do you know why that happens?

Do you need the whole file or just the flaps commands? The Mig-15 have a up-neutral-20 degrees-55 degrees possitions. Nothing happens when you move the flaps from 55 to 20, then you have to use up possition. So from down to half possition is not possible but thats ok. I need a command for up-20 degrees-55 degrees if its possible
__________________
-royphsle

F-16C
i7-4790 CPU 3.60GHz | 16 GB RAM | MSI GTX-960 Gaming 4GB | TM Warthog HOTAS | MFG Crosswind Pedals | TrackIR 5
royphsle is offline   Reply With Quote
Old 07-28-2019, 02:19 PM   #600
LeCuvier
Senior Member
 
Join Date: May 2013
Location: South of France
Posts: 1,482
Default

Quote:
Originally Posted by royphsle View Post
... When I pasted the Bf-109 command at the top of the lua file, in the correct block, many commands turned yellow in the game?!.
You must have pasted in the wrong place and thereby caused a syntax violation. You must paste within the block for key commands.
For the Kurfürst, that block is delimited by this line at the top:
Code:
keyCommands = {
and this line at the bottom:
Code:
},
at about line 625 (depending on how many lines you have added).
Any additions to axis commands must be inserted into the related block just below that.
__________________
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 12:15 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.