Separate gear up/gear down commands? - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 01-17-2018, 02:17 AM   #1
Lixma 06
Member
 
Join Date: Feb 2006
Posts: 910
Default Separate gear up/gear down commands?

Please!



e: and mirror toggle

Last edited by Lixma 06; 01-17-2018 at 02:47 AM.
Lixma 06 is offline   Reply With Quote
Old 01-17-2018, 03:33 AM   #2
kolga
Member
 
kolga's Avatar
 
Join Date: Sep 2014
Location: Depends on where I am.
Posts: 518
Default

Quote:
Originally Posted by Lixma 06 View Post
Please!



e: and mirror toggle

+1!!!
__________________
"Long life It is a waste not to notice that it is not noticed that it is milk in the title." Amazon.co.jp review for milk translated from Japanese
"Amidst the blue skies, A link from past to future. The sheltering wings of the protector..." - ACE COMBAT 4
"Blessed be the LORD my strength, which teacheth my hands to war, and my fingers to fight"-Psalm 144:1 KJV
i5-4430 at 3.00GHz, 8GB RAM, GTX 1060 FE, Windows 7 x64
kolga is offline   Reply With Quote
Old 01-17-2018, 07:53 AM   #3
Captain Orso
Senior Member
 
Captain Orso's Avatar
 
Join Date: Feb 2015
Location: Stuttgart, Germany
Posts: 1,312
Default

Add these two lines to 'c:\Program Files\Eagle Dynamics\DCS World\Mods\aircraft\P-51D\Input\P-51D\joystick\default.lua' and bind them to what ever buttons or key-presses you desire through Options -> Controls -> P-51D Sim.

Code:
{down = device_commands.Button_4, up = device_commands.Button_4, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Down'), category = _('Systems')},
{down = device_commands.Button_4, up = device_commands.Button_4, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 0.0, name = _('Landing Gear Up'), category = _('Systems')},
I would suggest creating this as a mod and using JSGME or OvGME to implement it, as opposed to editing the original file, as the original file will be overwritten at every update or repair.

IIRC it is not possible, or at least I could not mod it, to create a mirror control.
__________________
When you hit the wrong button on take-off


System Specs.
Spoiler:
System board ... MSI X99A GAMING 9 ACK
CPU ............ Intel Core i7-5820K @ 3800MHz per OC Genie
CPU cooling .... Noctua NH-D15
Memory ......... 16GB DDR4-3000 G.Skill Ripjaw
PSU ............ Corsair AX860i PSU
Graphics card .. Zotac Nvidia GeForce GTX 1080 Ti Amp! Extreme
System disk .... SanDisk Extreme PRO 480GB SSD
Monitor ........ ASUS MG279Q, 27"
VR ............. Oculus Rift CV1
Captain Orso is offline   Reply With Quote
Old 01-17-2018, 08:43 AM   #4
Lixma 06
Member
 
Join Date: Feb 2006
Posts: 910
Default

Thanks, Orso!

Why isn't this stuff already in there? The Mustang's over 5 years old.
Lixma 06 is offline   Reply With Quote
Old 01-17-2018, 10:06 AM   #5
Captain Orso
Senior Member
 
Captain Orso's Avatar
 
Join Date: Feb 2015
Location: Stuttgart, Germany
Posts: 1,312
Default

I honestly can't say. Maybe because it kind of works out of the box and there are generally solutions for fixing things the way you want them, if you can figure it out.
__________________
When you hit the wrong button on take-off


System Specs.
Spoiler:
System board ... MSI X99A GAMING 9 ACK
CPU ............ Intel Core i7-5820K @ 3800MHz per OC Genie
CPU cooling .... Noctua NH-D15
Memory ......... 16GB DDR4-3000 G.Skill Ripjaw
PSU ............ Corsair AX860i PSU
Graphics card .. Zotac Nvidia GeForce GTX 1080 Ti Amp! Extreme
System disk .... SanDisk Extreme PRO 480GB SSD
Monitor ........ ASUS MG279Q, 27"
VR ............. Oculus Rift CV1
Captain Orso is offline   Reply With Quote
Old 01-17-2018, 03:17 PM   #6
Elphaba
Member
 
Join Date: Apr 2014
Location: UK - for my sins.
Posts: 105
Default

Quote:
Originally Posted by Captain Orso View Post
Add these two lines to 'c:\Program Files\Eagle Dynamics\DCS World\Mods\aircraft\P-51D\Input\P-51D\joystick\default.lua' and bind them to what ever buttons or key-presses you desire through Options -> Controls -> P-51D Sim.

Code:
{down = device_commands.Button_4, up = device_commands.Button_4, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Down'), category = _('Systems')},
{down = device_commands.Button_4, up = device_commands.Button_4, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 0.0, name = _('Landing Gear Up'), category = _('Systems')},
I would suggest creating this as a mod and using JSGME or OvGME to implement it, as opposed to editing the original file, as the original file will be overwritten at every update or repair.

IIRC it is not possible, or at least I could not mod it, to create a mirror control.
I'm trying to do my own change to map the Warthog APU physical switch to the DCS Huey Prop Governor, however I have no idea where YOU get the full list of possible commands from that YOU used to create the two above examples...

i.e. How do I know what the prop governor switch is called to refer to in the 'device_commands'line, or in the device_id line?
Elphaba is offline   Reply With Quote
Old 01-17-2018, 03:29 PM   #7
grunf
Senior Member
 
grunf's Avatar
 
Join Date: Jul 2015
Posts: 2,252
Default

Quote:
Originally Posted by Lixma 06 View Post
Please!



e: and mirror toggle
+1
grunf is offline   Reply With Quote
Old 01-17-2018, 11:51 PM   #8
Captain Orso
Senior Member
 
Captain Orso's Avatar
 
Join Date: Feb 2015
Location: Stuttgart, Germany
Posts: 1,312
Default

Quote:
Originally Posted by Elphaba View Post
I'm trying to do my own change to map the Warthog APU physical switch to the DCS Huey Prop Governor, however I have no idea where YOU get the full list of possible commands from that YOU used to create the two above examples...

i.e. How do I know what the prop governor switch is called to refer to in the 'device_commands'line, or in the device_id line?
First off you have to understand that the switches on the TM HOTAS Throttle are On-Off or On-Off-On switches. Two-way switchers are all downward (toward behind you while siting at the throttle) is off.

In the default.lua controls file, each control (a switch in the cockpit you can manipulate) has a 'down' and an 'up' setting, or can have them. These refer to a basic keyboard key operation. Down means the key assigned is pressed. Up means the key assigned is released.

Now let's look at the TM HOTAS Throttle. The APU Start/Off switch is switch 20. When it is toggled to 'Start' the switch is electronically on, like a light switch, and sends a signal to DCS. When toggled to 'Off' it is off, and it sends no signal to DCS.

Looking over my mod I see it could actually be done on one line:
Code:
{down = device_commands.Button_4, up = device_commands.Button_4, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, value_up = 0.0, name = _('Landing Gear Up/Down Switch'), category = _('Systems')},
Why? Because when assigned to switch 20 (On-OFF) the switch can only tell DCS when it is on, thus DCS sends 'value_down' '1.0' to the control and puts the landing gear down.

When switch 20 is off, DCS notices that there is no signal coming from switch 20 and 'value_up' '0.0' is sent to the control and the landing gear is raised.

If you want the switch to work the other way around, (switch 20 upwards means gear up, and downwards means gear down) exchange the down and up values.

Why does the first configuration work as well? Because when you assign switch 20 to them both, switch 20 can still only have an on or off state. So when switch 20 is in the asserted state (on = up) the 'value_up' in the first line is sent to DCS. When switch 20 is in the unasserted state (off = down) the 'value_down' in the second line is sent to DCS. By adding both value_up and value_down to the same line, both the on and off states can be regulated on the same line.

So, now on to the meat of your question. How do you know which default.lua control is for which cockpit control. Well generally you know what control you are thinking of and look for it's name in the default.lua. You can generally find it in the 'name =' parameter, but also in many cases in comment lines in the file.

Which values are valid you can see in the original lines, generally 1.0 and 0.0, but there are many exceptions. But for on/off switches it will probably always be 1.0 and 0.0.

For some controls such as dimmer switches for lighting, you can also try 0.1 or 0.2, etc., which often control the speed at which the dimmer is turned. This also works for the K-14 distance and wingspan controls. Some switches can also be negative, eg -1.0. You will have to look at the default settings in the default.lua and guestimate what is possible. You may have to try different settings until you get what you wish.

The line you are looking for in the Huey is probably:
Code:
{down = device_commands.Button_16, cockpit_device_id  = devices.ENGINE_INTERFACE, value_down = 0.0, name = _('Governor Auto/Emer'), category = _('Pedestal')},
Try setting it to:
Code:
{down = device_commands.Button_16, up = device_commands.Button_16, cockpit_device_id  = devices.ENGINE_INTERFACE, value_down = 0.0, value_up = 1.0, name = _('Governor Auto/Emer Switch'), category = _('Pedestal')},
and see if that works for you.

If I was unclear about anything, or you have further questions, feel free to ask.
__________________
When you hit the wrong button on take-off


System Specs.
Spoiler:
System board ... MSI X99A GAMING 9 ACK
CPU ............ Intel Core i7-5820K @ 3800MHz per OC Genie
CPU cooling .... Noctua NH-D15
Memory ......... 16GB DDR4-3000 G.Skill Ripjaw
PSU ............ Corsair AX860i PSU
Graphics card .. Zotac Nvidia GeForce GTX 1080 Ti Amp! Extreme
System disk .... SanDisk Extreme PRO 480GB SSD
Monitor ........ ASUS MG279Q, 27"
VR ............. Oculus Rift CV1
Captain Orso is offline   Reply With Quote
Old 01-18-2018, 01:14 AM   #9
kolga
Member
 
kolga's Avatar
 
Join Date: Sep 2014
Location: Depends on where I am.
Posts: 518
Default

Quote:
Originally Posted by Captain Orso View Post
Add these two lines to 'c:\Program Files\Eagle Dynamics\DCS World\Mods\aircraft\P-51D\Input\P-51D\joystick\default.lua' and bind them to what ever buttons or key-presses you desire through Options -> Controls -> P-51D Sim.

Code:
{down = device_commands.Button_4, up = device_commands.Button_4, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, name = _('Landing Gear Down'), category = _('Systems')},
{down = device_commands.Button_4, up = device_commands.Button_4, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 0.0, name = _('Landing Gear Up'), category = _('Systems')},
I would suggest creating this as a mod and using JSGME or OvGME to implement it, as opposed to editing the original file, as the original file will be overwritten at every update or repair.

IIRC it is not possible, or at least I could not mod it, to create a mirror control.
Thanks!
__________________
"Long life It is a waste not to notice that it is not noticed that it is milk in the title." Amazon.co.jp review for milk translated from Japanese
"Amidst the blue skies, A link from past to future. The sheltering wings of the protector..." - ACE COMBAT 4
"Blessed be the LORD my strength, which teacheth my hands to war, and my fingers to fight"-Psalm 144:1 KJV
i5-4430 at 3.00GHz, 8GB RAM, GTX 1060 FE, Windows 7 x64
kolga is offline   Reply With Quote
Old 01-18-2018, 04:14 AM   #10
DoomEngine
Member
 
DoomEngine's Avatar
 
Join Date: Mar 2017
Location: Kentucky, USA
Posts: 192
Default

Captain Orso is a wizard, confirmed.
__________________
http://img.wp.scn.ru/camms/ar/375/pics/3_31.jpg
DoomEngine is offline   Reply With Quote
Reply

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 07:49 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.