Jump to content

Guide To the Structure of Leatherneck Simulations Keybinds Lua Files


Colseg

Recommended Posts

After having created and maintained my "TM Warthog Keybinds For 3 and 2 Position Switches" lua file for the MiG-21Bis which can be found here http://forums.eagle.ru/showthread.php?t=130459 I saw just how differently Leatherneck Simulations has structured their keybinds in comparison to other modules and have decided to create this guide on their structure as seen in the MiG-21Bis and I predict will continue to be used in subsequent Leatherneck modules. I have made the explanation of certain aspects (namely comments) rather explicit in the hopes of making it easier to understand for people who have not worked with code previously.

 

(1)--Alternate Airbrakes
{down=(2)device_commands.Airbrakes,(3)up=device_commands.Airbrakes,
(4)cockpit_device_id=devices.AIRBRAKE,(5)value_down=1.0,value_up=0.0,
(6)name='Alternate Airbrakes On',(7)category='Flight Controls'},


Above I have taken a line from my MiG-21BIS Custom Controls lua and added reference
marks in the form of numbers in parenthesis(note that all numbers with parenthesis
shown in the above line should not be included in an actual controls lua as they will
render it non-functional and are shown here for reference purposes)


(1) "--" this double minus symbol, when placed at the beginning of a line, will 
     identify that line as a comment, a comment is simply a line of text and/or 
     symbols that will be ignored by the program and can be used for creating 
     anything from organization headers, to comments for others who open the 
     file to read, to temporary disabling a line of code for buggfixing reason

(2) "device_commands." device_commands. identifies which command is being given a
     value by your "value_down" or "value_up" from later within this line, the . is 
     followed immediately by a defined command, all commands can be found in the 
     "Eagle Dynamics\DCS World\Mods\aircraft\MiG-21BIS\Cockpit\command_defs.lua" 
     file or the equivalent file in future leatherneck products (keep in mind that 
     some commands that have not been used in the final product may be included 
     here, this can be great if it happens to include one that you needed for your 
     keybinds but can also include commands that still include bugs and therefore 
     could produce odd or even unintendedly useful results or simply do absolutely 
     nothing)

(3) "down=" and "up=" these define what device_commands will be used when the button 
     is pressed down and released respectively and these can differ if needed for 
     your keybind

(4) "cockpit_device_id=" defines the device id of the device being given a command by 
     your "device_commands." earlier in the line, all of the device ids can be found
     in the "Eagle Dynamics\DCS World\Mods\aircraft\MiG-21BIS\Cockpit\devices.lua"
     file and the same warning from the commands explanation applies

(5) "value_down=,value_up=," "value_down" identifies the value of the command 
     identified by your "down=" which will be sent to the device identified in your
     "cockpit_device_id=", "value_up" does the same but identifies the value of your 
     "down=" command instead

(6) "name=" identifies the name of this keybind that it will show up under in the DCS 
     keybinds menu

(7) "category=" identifies the category that this keybind will show up under in the 
     DCS keybinds menu


Edited by Colseg
  • Like 2
Link to comment
Share on other sites

  • 8 months later...

Why hasnt anyone done this for the A-10C?

Win 10 Pro - Intel I7 12700k@4.9ghz water cooled - ASUS TUF Z690 -EVGA RTX 3080 12G Hybrid - EVGA 1000W PSU - 32GB 3200 G-Skill XMP- Reverb G2 -Custom mip and side panels - Leo Bodnar  BBI32x2, BBI64x4 - TM Warthog HOTAS - TM Cougar MFD's x 3 - TM TPR pedals

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • Recently Browsing   0 members

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