Jump to content

Need a full command macro list for LoSetCommand()


shilka

Recommended Posts

Not necessarily the command code for LoSetCommand() function but I need a full list of command codes for cockpit events. I found some commands listed in export.lua(the same information is posted on DCS website http://www.digitalcombatsimulator.com/en/dev_journal/lua-export/) but this list is not complete. For example I can deduce that the "Engage Descent Mode" in BS is code 507 but it's not mentioned in the list(It says "To be continued..." in export.lua).

 

 

I want to map the position of some toggle switches into independent keyboard shortcut so that it can be synchronized with the toggle switches on my HOTAS. For example I want LSHIFT+g for "Gear Down" and RSHIFT+G for "Gear Up" instead of a simple G for "gear lever". I'm editing keyboard.lua and it works fine so far. I can deduce the rest of command code from existing entries in keyboard.lua but an official reference would certainly save me a lot of time...

  • Like 1
Link to comment
Share on other sites

Not yet. The only lead I got so far is to go through other ***.lua files in case the functions are lucky enough to be used somewhere in the official script already.

 

that "to be continued..." is driving me crazy~

Link to comment
Share on other sites

I'm curious to know what the device and action numbers mean in the Macro_sequences.lua file. That file contains auto-start, auto-stop, and auto-lights macros. You can easily tell what the engine start/stop (action 311, 312, 313, 314) and canopy open close (action 71) actions are, but the rest have device numbers with actions in the 3000s. I would like to modify my auto-start to be quicker with ground power, but I don't know what all these commands are.

Link to comment
Share on other sites

Actually these 30xx commands are also in command_defs.lua

The problem is that it only tells you they belongs to "button ##". But exactly which button on that device (\scripts\aircrafts\ka-50\cockpit\devices.lua)? That's another story.

why don't you just cut their time field to half to see if it works? regardless of the nature of the command code.

check the last section of that file:

 

start_command = 3000

device_commands =

{

Button_1 = start_command + 1;

Button_2 = start_command + 2;

Button_3 = start_command + 3;

Button_4 = start_command + 4;

Button_5 = start_command + 5;

Button_6 = start_command + 6;

....

Link to comment
Share on other sites

  • 2 years later...
  • 11 months later...

I know this is an old thread, but for those future souls who land here by searching for LoSetCommand(), here is how to get a list (see attachment).

 

I added the following code to the beginning of Config/Input/Aircrafts/Default/keyboard/default.lua to get this list (DCS 1.2.10):

local lfs = require("lfs")
local io = require("io")
f = io.open(lfs.writedir()..[[Logs\inputenum.txt]], "w")
if f then
f:write("\n\n*** fenv:\n")
for k, v in pairs(getfenv()) do
	f:write(tostring(k))
	f:write("\t")
	f:write(tostring(v))
	f:write("\n")
end	
f:close()
end

 

After that, start DCS, go into options and switch to the "Controls" tab to trigger the export.

inputenum.txt

Link to comment
Share on other sites

  • 9 months later...
Ian;2215144']I know this is an old thread, but for those future souls who land here by searching for LoSetCommand(), here is how to get a list (see attachment).

 

I added the following code to the beginning of Config/Input/Aircrafts/Default/keyboard/default.lua to get this list (DCS 1.2.10):

local lfs = require("lfs")
local io = require("io")
f = io.open(lfs.writedir()..[[Logs\inputenum.txt]], "w")
if f then
f:write("\n\n*** fenv:\n")
for k, v in pairs(getfenv()) do
	f:write(tostring(k))
	f:write("\t")
	f:write(tostring(v))
	f:write("\n")
end	
f:close()
end

 

After that, start DCS, go into options and switch to the "Controls" tab to trigger the export.

 

Thanks a lot [FSF]Ian :thumbup:

Gametrix JetSeats thread (in English) ,

SimShaker addon for bass-shakers thread (in English),

Andre's blog, downloads, manuals (in English).

 

 

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

  • 2 years later...
  • 5 years later...

FYI for the future explorers

If you modify the keybedding in the settings and save the profile you get a diff.lua

The diff key contains the id

In my example here I was truing to get the free camera which was in the export above as

iCommandViewFreeJump    158

So this example marries up to the exported file above where 

Export.LoSetCommand(158); -- iCommandViewFreeJump    158
    ["keyDiffs"] = {
        ["d158pnilunilcdnilvdnilvpnilvunil"] = {
            ["added"] = {
                [1] = {
                    ["key"] = "Z",
                    ["reformers"] = {
                        [1] = "LAlt",
                        [2] = "LCtrl",
                        [3] = "LShift",
                    },
                },
            },
            ["name"] = "F11 Jump to free camera",
        },
    },
}
return diff

There is also a lot of stuff inside the game installation directories if you CTRL+F for the text from the Options Menu

-- Config\Input\UiLayer\keyboard\default.lua
 
{combos = {{key = 'Z', reformers = {'LCtrl'                 }}}, down = iCommandAccelerate          , name = _('Time accelerate'                    ), category = general},
{combos = {{key = 'Z', reformers = {'LAlt'                  }}}, down = iCommandDecelerate          , name = _('Time decelerate'                    ), category = general},
{combos = {{key = 'Z', reformers = {'LShift'                }}}, down = iCommandNoAcceleration      , name = _('Time normal'                        ), category = general},
 

Edited by Subliminal-SS
Link to comment
Share on other sites

  • 3 months later...
  • Recently Browsing   0 members

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