Key-binding for the three way select switch? - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 07-11-2019, 01:08 PM   #1
xvii-Dietrich
Member
 
Join Date: Mar 2016
Location: Pohjoiskalotti
Posts: 552
Default Key-binding for the three way select switch?

I am looking for the key-binding for the three-way select switch, which is used to choose which gun system is used. I can find the nearby switches on that panel, but not this one. See attached image. Can anyone help? Thanks!
Attached Thumbnails
Click image for larger version

Name:	mi8_threeway_switch.jpg
Views:	223
Size:	168.5 KB
ID:	213581  
xvii-Dietrich is offline   Reply With Quote
Old 07-12-2019, 08:39 AM   #2
NOALB
Junior Member
 
Join Date: Feb 2018
Posts: 37
Default

Code:
{down = 3042, value_down = 0.3, up = 3042, value_up = 0.2, cockpit_device_id = 12, name = _('# GUV Mode Switch - 622/624'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.1, up = 3042, value_up = 0.2, cockpit_device_id = 12, name = _('# GUV Mode Switch - 624/800'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
Copy/pasted from my default.lua. The '#'s are there so the custom additions appear at the top of the sort order, as well as the '# Custom' category. If you want them to be sorted normally delete the leading # and space.
NOALB is offline   Reply With Quote
Old 07-13-2019, 03:59 AM   #3
xvii-Dietrich
Member
 
Join Date: Mar 2016
Location: Pohjoiskalotti
Posts: 552
Default

Quote:
Originally Posted by NOALB View Post
Code:
{down = 3042, value_down = 0.3, up = 3042, value_up = 0.2, cockpit_device_id = 12, name = _('# GUV Mode Switch - 622/624'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.1, up = 3042, value_up = 0.2, cockpit_device_id = 12, name = _('# GUV Mode Switch - 624/800'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
Copy/pasted from my default.lua. The '#'s are there so the custom additions appear at the top of the sort order, as well as the '# Custom' category. If you want them to be sorted normally delete the leading # and space.
Many thanks for the report, but I am not sure which file this is? I did a search on the DCSWorld\Mods\aircraft\Mi-8MTV2\ folder and found about 10 "default.lua" files in that folder tree.
xvii-Dietrich is offline   Reply With Quote
Old 08-22-2019, 05:54 AM   #4
NOALB
Junior Member
 
Join Date: Feb 2018
Posts: 37
Default

First of all, I am SO sorry for the long delay in replying; it kept slipping my mind

If by some chance you haven't already resolved the issue yourself, I'll admit I'm not entirely sure what you're looking for - I rather hastily assumed you were looking for a way to bind a 3-way switch on a physical controller (which is what the mentioned default.lua file is for). If you're simply looking for the control name in the settings, what you want is "GUV Mode Switch - Decrease" and "GUV Mode Switch - Increase". Their default keybinds respectively (I think) are Right Alt + Right Ctrl + [ and Right Alt + Right Ctrl + ].

If instead you're looking for a set of keybinds to directly select a particular switch position (instead of the Increase/Decrease rotary we're given), I think I could whip something up real quick.


EDIT:
If I've already answered your question, you can ignore everything past here if you want. What follows is a description of how to add certain custom functionality to DCS; if that isn't what you're interested in it's probably a waste of time to read.

Here's the requisite code; I don't intend to use it myself, though I did test that it works.
Code:
{down = 3042, value_down = 0.0, cockpit_device_id = 12, name = _('# GUV Mode Switch - OFF'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.3, cockpit_device_id = 12, name = _('# GUV Mode Switch - 622'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.2, cockpit_device_id = 12, name = _('# GUV Mode Switch - 624'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.1, cockpit_device_id = 12, name = _('# GUV Mode Switch - 800'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
From your question, I assume you're not familiar with the function of the default.lua file I mentioned. I haven't really seen any good, concise explanations so I'll try to summarize:

The files in question can be found at [DCS]\Mods\aircraft\[Module]\Input\[Module] or something similar. What they do is define functions which can be bound to physical controls, so they're often edited to adapt DCS's keybinding functionality to a particular peripheral device (usually to support toggle switches). This means that typically, only the joystick/default.lua file is edited, although the keyboard/default.lua file can also be edited to change or add functions which can be bound to keypresses.

Looking at an example, in this case [DCS]\Mods\aircraft\Mi-8MTV2\Input\Mi-8MTV2\keyboard\default.lua we can see some script stuff happening at the top (which I'm not gonna explain in order to keep this somewhat concise), then underneath is the start of a long block of code concatenating base.keyCommands with all the necessary controls to actually use the module (this means that you could add your own join(base.keyCommands,{}) block, though you may prefer to just insert your modifications into the existing block).

So, in order to actually use the code I've provided, you'd open the file and then paste the code within the join(base.keyCommands,{}) block, which would then look something like this (excerpted):
Code:
ignore_features(base.keyCommands,{
"Camera jiggle"
})


join(base.keyCommands,{

{down = 3042, value_down = 0.0, cockpit_device_id = 12, name = _('# GUV Mode Switch - OFF'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.3, cockpit_device_id = 12, name = _('# GUV Mode Switch - 622'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.2, cockpit_device_id = 12, name = _('# GUV Mode Switch - 624'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.1, cockpit_device_id = 12, name = _('# GUV Mode Switch - 800'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},

------------------------------------------------
-- Cheat ---------------------------------------
------------------------------------------------
{combos = {{key = 'Home', reformers = {'LWin'}}},    down = iCommandEnginesStart,    name = _('Auto Start'),        category = _('Cheat')},
{combos = {{key = 'End' , reformers = {'LWin'}}},    down = iCommandEnginesStop,        name = _('Auto Stop'),        category = _('Cheat')},
This will cause four new controls to appear after restarting DCS, allowing you to easily bind keypresses to individual GUV Mode Switch positions.

It's also important to note that files under the main DCS directory (as opposed to Saved Games) will be overwritten when updating the game, so keep a backup or use something like JSGME (if anyone knows of a way to use Saved Games for this, please correct me!).
NOALB is offline   Reply With Quote
Old 02-21-2020, 04:48 PM   #5
BonzoDCS
Member
 
BonzoDCS's Avatar
 
Join Date: Oct 2019
Location: Germany
Posts: 462
Default

Quote:
Originally Posted by NOALB View Post
First of all, I am SO sorry for the long delay in replying; it kept slipping my mind

If by some chance you haven't already resolved the issue yourself, I'll admit I'm not entirely sure what you're looking for - I rather hastily assumed you were looking for a way to bind a 3-way switch on a physical controller (which is what the mentioned default.lua file is for). If you're simply looking for the control name in the settings, what you want is "GUV Mode Switch - Decrease" and "GUV Mode Switch - Increase". Their default keybinds respectively (I think) are Right Alt + Right Ctrl + [ and Right Alt + Right Ctrl + ].

If instead you're looking for a set of keybinds to directly select a particular switch position (instead of the Increase/Decrease rotary we're given), I think I could whip something up real quick.


EDIT:
If I've already answered your question, you can ignore everything past here if you want. What follows is a description of how to add certain custom functionality to DCS; if that isn't what you're interested in it's probably a waste of time to read.

Here's the requisite code; I don't intend to use it myself, though I did test that it works.
Code:
{down = 3042, value_down = 0.0, cockpit_device_id = 12, name = _('# GUV Mode Switch - OFF'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.3, cockpit_device_id = 12, name = _('# GUV Mode Switch - 622'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.2, cockpit_device_id = 12, name = _('# GUV Mode Switch - 624'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.1, cockpit_device_id = 12, name = _('# GUV Mode Switch - 800'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
From your question, I assume you're not familiar with the function of the default.lua file I mentioned. I haven't really seen any good, concise explanations so I'll try to summarize:

The files in question can be found at [DCS]\Mods\aircraft\[Module]\Input\[Module] or something similar. What they do is define functions which can be bound to physical controls, so they're often edited to adapt DCS's keybinding functionality to a particular peripheral device (usually to support toggle switches). This means that typically, only the joystick/default.lua file is edited, although the keyboard/default.lua file can also be edited to change or add functions which can be bound to keypresses.

Looking at an example, in this case [DCS]\Mods\aircraft\Mi-8MTV2\Input\Mi-8MTV2\keyboard\default.lua we can see some script stuff happening at the top (which I'm not gonna explain in order to keep this somewhat concise), then underneath is the start of a long block of code concatenating base.keyCommands with all the necessary controls to actually use the module (this means that you could add your own join(base.keyCommands,{}) block, though you may prefer to just insert your modifications into the existing block).

So, in order to actually use the code I've provided, you'd open the file and then paste the code within the join(base.keyCommands,{}) block, which would then look something like this (excerpted):
Code:
ignore_features(base.keyCommands,{
"Camera jiggle"
})


join(base.keyCommands,{

{down = 3042, value_down = 0.0, cockpit_device_id = 12, name = _('# GUV Mode Switch - OFF'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.3, cockpit_device_id = 12, name = _('# GUV Mode Switch - 622'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.2, cockpit_device_id = 12, name = _('# GUV Mode Switch - 624'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},
{down = 3042, value_down = 0.1, cockpit_device_id = 12, name = _('# GUV Mode Switch - 800'), category = {_('Left Overhead Panel'), _('Armament System'), _('# Custom')}},

------------------------------------------------
-- Cheat ---------------------------------------
------------------------------------------------
{combos = {{key = 'Home', reformers = {'LWin'}}},    down = iCommandEnginesStart,    name = _('Auto Start'),        category = _('Cheat')},
{combos = {{key = 'End' , reformers = {'LWin'}}},    down = iCommandEnginesStop,        name = _('Auto Stop'),        category = _('Cheat')},
This will cause four new controls to appear after restarting DCS, allowing you to easily bind keypresses to individual GUV Mode Switch positions.

It's also important to note that files under the main DCS directory (as opposed to Saved Games) will be overwritten when updating the game, so keep a backup or use something like JSGME (if anyone knows of a way to use Saved Games for this, please correct me!).
Very good information here, thank you for sharing this. DCS should really offer these bindings instead of having us figure out stuff like this.

Greetings,

Bonzo
__________________
A-10C | F-16C | F/A-18C | MiG-21bis | Ka-50 | Mi-8MTV2 | UH-1H | Bf-109K4 | Christen Eagle II

QVI DESIDERAT PACEM BELLVM PRAEPARAT
BonzoDCS is offline   Reply With Quote
Reply

Tags
mi8-mtv2

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:45 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.