Jump to content

Key-binding for the three way select switch?


Recommended Posts

{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.

Link to comment
Share on other sites

{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. :helpsmilie:

Link to comment
Share on other sites

  • 1 month later...

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

 

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.

{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):

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!).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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