Jump to content

AV8B - LUA codings for missing/broken keybinds


Recommended Posts

Hi guys,

 

For the past few weeks I have been busy coding the LUA files whilst building my VR AV8B home cockpit. I have shared these with Razbam and hopefully they will implement them at some point. In case this doesn't happen I would like to share these with you.  I am not an expert coder by any means, so it may not be perfect but it works. 

 

The main additions are for the joystick lua file but add the coding to the keyboard lua file if you wish to use keyboard key combinations for a switch position (mainly OFF positions).  I use RS Mapper to enable a switch to function in the OFF position. For example, a 2 way stich has an ON and OFF position. In DCS you can only trigger an instruction in the ON position. With RS Mapper I have assigned a keyboard command to when the switch is moved to the OFF position. This keyboard command effectively gives me 2 inputs with 1 switch. The POKEYS software can also code this if you are making a home cockpit with one of their cards. So, in general I have not added keyboard coding for every switch/button, but usually they would have the option to assign a keyboard command for the OFF position (or the center position if it's a 3 position switch).  The only knob I can not get coded correctly is the BINGO fuel one, if anybody has this coded please share. 

 

So here is what I have done to the lua file:

 

The first section is JOYSTICK SWITCH ABSTRACTIONS:

 

I added this to enable the Antiskid test function to also work and switch back to ON.

 

 {down = fcs_commands.Switch_ANTISKID,       up = fcs_commands.Switch_ANTISKID,      cockpit_device_id=devices.FLIGHTCONTROLS,   value_down=1.0, value_up=0.5,   name = _('Anti-Skid TEST else ON'),                category = _('Joystick Switch Abstractions')},

 

I added these for the FLAP POWER SWITCH & the LANDING LIGHT SWITCH:

{down = fcs_commands.Handle_PARKING_BRAKE,  up = fcs_commands.Handle_PARKING_BRAKE, cockpit_device_id=devices.FLIGHTCONTROLS,    value_down=1.0, value_up=0.0,    name = _('Parking Brake Lever OFF else ON'),    category = _('Joystick Switch Abstractions')},
    {down = fcs_commands.Switch_FLAP_PWR,    up = fcs_commands.Switch_FLAP_RESET,   cockpit_device_id=devices.VREST,            value_down=1.0, value_up=0.5,   name = _('Flaps Power RESET else ON'),                category = _('Joystick Switch Abstractions')},
    {down = fcs_commands.Switch_FLAP_PWR,    up = fcs_commands.Switch_FLAP_PWR,   cockpit_device_id=devices.VREST,            value_down=0.0, value_up=0.5,   name = _('Flaps Power OFF else ON'),                category = _('Joystick Switch Abstractions')},  
    {down = ext_light_commands.Switch_LANDING_LT,  up = ext_light_commands.Switch_LANDING_LT,  cockpit_device_id = devices.LTEXT, value_down = 1,0, value_up=0.5, name = _('Landing Light APP else HVR'),                       category = _('Joystick Switch Abstractions')},
    {down = ext_light_commands.Switch_LANDING_LT,  up = ext_light_commands.Switch_LANDING_LT,  cockpit_device_id = devices.LTEXT, value_down = 0,0, value_up=0.5, name = _('Landing Light OFF else HVR'),                     category = _('Joystick Switch Abstractions')}, 


MASTER MODES -  NO CHANGE
HUD CONTROLS -  NO CHANGE

VSTOL CONTROLS: 

Added this to enable FLAP BIT BUTTON:

{down = fcs_commands.Button_FLAP_BIT, up = fcs_commands.Button_FLAP_BIT, cockpit_device_id = devices.VREST, value_down = 1.0, value_up = 0.0, name = _('Flaps BIT Button'), category = _('VSTOL Controls')},
    

FLIGHT CONTROL - NO CHANGE
SAAHS - NO CHANGE

 

-- Hydraulic & Mechanical

Added these lines to enable keybinding for the canopy locking lever:


        {down = misc_commands.canopy_lock_lever, up = misc_commands.canopy_lock_lever,         cockpit_device_id = devices.FLIGHTCONTROLS, value_down = 1, value_up = 0,    name = _('CANOPY LOCKING LEVER toggle'),            category = _('Hydraulic & Mechanical')},
    

Created a new category for the ECM panel and added these lines to be able to assign a rotary switch to the EXP and ECM knobs :

-- ECM Control Panel
        {down = rwr_commands.Knob_EXP,        cockpit_device_id = devices.EWS,    value_down = 0.00,     name = _('EXP Decoy Dispenser Control : OFF'),            category = _('ECM Control panel')},
    {down = rwr_commands.Knob_EXP,        cockpit_device_id = devices.EWS,    value_down = 0.25,     name = _('EXP Decoy Dispenser Control: AUTO'),        category = _('ECM Control panel')},
    {down = rwr_commands.Knob_EXP,        cockpit_device_id = devices.EWS,    value_down = 0.50,     name = _('EXP Decoy Dispenser Control: UP'),        category = _('ECM Control panel')},
    {down = rwr_commands.Knob_EXP,        cockpit_device_id = devices.EWS,    value_down = 0.75,     name = _('EXP Decoy Dispenser Control: DOWN'),            category = _('ECM Control panel')},
        {down = rwr_commands.Knob_EXP,        cockpit_device_id = devices.EWS,    value_down = 1.00,     name = _('EXP Decoy Dispenser Control: RWR'),            category = _('ECM Control panel')},
        {down = rwr_commands.Knob_ECM,        cockpit_device_id = devices.EWS,    value_down = 0.00,     name = _('Jammer Control Mode: OFF'),            category = _('ECM Control panel')},
    {down = rwr_commands.Knob_ECM,        cockpit_device_id = devices.EWS,    value_down = 0.25,     name = _('Jammer Control Mode: STBY'),        category = _('ECM Control panel')},
    {down = rwr_commands.Knob_ECM,        cockpit_device_id = devices.EWS,    value_down = 0.50,     name = _('Jammer Control Mode: BIT'),        category = _('ECM Control panel')},
    {down = rwr_commands.Knob_ECM,        cockpit_device_id = devices.EWS,    value_down = 0.75,     name = _('Jammer Control Mode: RCV'),            category = _('ECM Control panel')},
    {down = rwr_commands.Knob_ECM,        cockpit_device_id = devices.EWS,    value_down = 1.00,     name = _('Jammer Control Mode: RPT'),            category = _('ECM Control panel')},

 

ENGINE & FUEL:

Added this for the Fuel quantity indicator to be assigned to a 30 degree rotary switch.  

 

{down = fqi_commands.FuelSelector,    cockpit_device_id = devices.FQIS,    value_down = 0.0,     name = _('FQI: INT'),                                 category = _('Engine & Fuel')},
    {down = fqi_commands.FuelSelector,    cockpit_device_id = devices.FQIS,    value_down = 0.33,     name = _('FQI Mode: TOT'),                                      category = _('Engine & Fuel')},
    {down = fqi_commands.FuelSelector,    cockpit_device_id = devices.FQIS,    value_down = 0.66,     name = _('FQI Mode: FEED'),                                 category = _('Engine & Fuel')},
    {down = fqi_commands.FuelSelector,    cockpit_device_id = devices.FQIS,    value_down = 0.99,     name = _('FQI Mode: BIT'),                               category = _('Engine & Fuel')},
    {down = fqi_commands.FuelSelector,    cockpit_device_id = devices.FQIS,    value_down = -0.33,     name = _('FQI Mode: WING'),                        category = _('Engine & Fuel')},
    {down = fqi_commands.FuelSelector,    cockpit_device_id = devices.FQIS,    value_down = -0.66,     name = _('FQI Mode: INBD'),                        category = _('Engine & Fuel')},
    {down = fqi_commands.FuelSelector,    cockpit_device_id = devices.FQIS,    value_down = -0.99,     name = _('FQI Mode: OUTBD'),                        category = _('Engine & Fuel')},

 

ECS: 

 

Added these lines to enable all the switches on the ECS panel. The TEMP controller dial is in the AXIS section. 

 

{down = ecs_commands.Switch_FWD_EQUIP,                cockpit_device_id = devices.ECS, value_down = 0,    name = _('Fwd Equipment Bay NORM'),      category = _('Environmental Control')},         
    {down = ecs_commands.Switch_FWD_EQUIP,                cockpit_device_id = devices.ECS, value_down = 0.5,    name = _('Fwd Equipment Bay ECS Switch'),      category = _('Environmental Control')},         
    {down = ecs_commands.Switch_FWD_EQUIP,                cockpit_device_id = devices.ECS, value_down = 1,    name = _('Fwd Equipment Bay RESET'),      category = _('Environmental Control')},  
    {down = ecs_commands.Switch_AFT_EQUIP,                cockpit_device_id = devices.ECS, value_down = 0,    name = _('AFT Equipment Bay OFF'),      category = _('Environmental Control')},         
    {down = ecs_commands.Switch_AFT_EQUIP,                cockpit_device_id = devices.ECS, value_down = 0.5,  name = _('AFT Equipment Bay ON'),      category = _('Environmental Control')},         
    {down = ecs_commands.Switch_AFT_EQUIP,                cockpit_device_id = devices.ECS, value_down = 1,    name = _('AFT Equipment Bay RESET'),      category = _('Environmental Control')},
    {down = ecs_commands.Switch_CABIN,                        cockpit_device_id = devices.ECS, value_down = 1,    name = _('CABIN DEFOG NORM'),      category = _('Environmental Control')},         
    {down = ecs_commands.Switch_CABIN,                        cockpit_device_id = devices.ECS, value_down = 0.5,  name = _('CABIN DEFOG'),      category = _('Environmental Control')},         
    {down = ecs_commands.Switch_CABIN,                        cockpit_device_id = devices.ECS, value_down = 0,    name = _('CABIN DEFOG MAX'),      category = _('Environmental Control')},
    {down = ecs_commands.Switch_PRESS,                        cockpit_device_id = devices.ECS, value_down = 1,    name = _('PRESS NORM'),      category = _('Environmental Control')},         
    {down = ecs_commands.Switch_PRESS,                        cockpit_device_id = devices.ECS, value_down = 0.5,  name = _('PRESS DUMP'),      category = _('Environmental Control')},         
    {down = ecs_commands.Switch_PRESS,                        cockpit_device_id = devices.ECS, value_down = 0,    name = _('PRESS RAM'),      category = _('Environmental Control')},  

 

ELEC PANEL:

Added DC TEST switch function:

{down = elec_commands.Switch_DC_TEST,             cockpit_device_id = devices.ELECTRIC, value_down = 1,    name = _('DC Test Switch STBY'),    category = _('Electrical Panel')},
        {down = elec_commands.Switch_DC_TEST,             cockpit_device_id = devices.ELECTRIC, value_down = 0.5,    name = _('DC Test Switch OFF'),            category = _('Electrical Panel')},
        {down = elec_commands.Switch_DC_TEST,             cockpit_device_id = devices.ELECTRIC, value_down = 0,    name = _('DC Test Switch MAIN'),    category = _('Electrical Panel')},
    

Pilot & Seat controls - NO CHANGE
HOTAS - NO CHANGE 

LEFT & RIGHT MPCD - NO CHANGE

 

-- ARMAMENT CONTROL PANEL

Added the following lines to be able to assign a rotary switch to the manual bomb fuzing knob and the selective jettison control:

 {down = smc_commands.Knob_Bomb_Fuze,    cockpit_device_id = devices.SMC,    value_down = 0.0,     name = _('WPN MAN CONTROL : NORM'),                       category = _('Armament Control')},
       {down = smc_commands.Knob_Bomb_Fuze,    cockpit_device_id = devices.SMC,    value_down = 0.33,     name = _('WPN MAN CONTROL : N/T'),                   category = _('Armament Control')},
       {down = smc_commands.Knob_Bomb_Fuze,    cockpit_device_id = devices.SMC,    value_down = 0.66,     name = _('WPN MAN CONTROL : N'),            category = _('Armament Control')},
       {down = smc_commands.Knob_Bomb_Fuze,    cockpit_device_id = devices.SMC,    value_down = 0.99,     name = _('WPN MAN CONTROL : T'),                category = _('Armament Control')},
       {down = smc_commands.Knob_JETT,            cockpit_device_id = devices.SMC,    value_down = -1.0,     name = _('Jettison Mode Selector : STA'),               category = _('Armament Control')},
       {down = smc_commands.Knob_JETT,            cockpit_device_id = devices.SMC,    value_down = -0.5,     name = _('Jettison Mode Selector : STOR'),               category = _('Armament Control')},
       {down = smc_commands.Knob_JETT,            cockpit_device_id = devices.SMC,    value_down = 0.0,     name = _('Jettison Mode Selector : SAFE'),        category = _('Armament Control')},
       {down = smc_commands.Knob_JETT,        cockpit_device_id = devices.SMC,    value_down = 0.5,     name = _('Jettison Mode Selector : CMBT'),            category = _('Armament Control')},
       {down = smc_commands.Knob_JETT,        cockpit_device_id = devices.SMC,    value_down = 1.0,     name = _('Jettison Mode Selector : FUEL'),            category = _('Armament Control')},
 

UFC - NO CHANGE

ODU - NO CHANGE

COMMS - NO CHANGE

MISC PANEL:

I noticed that the Last 2 lines in this section is actually wrong, the name is "Mission Computer mode AUTO/OFF or OVRD/OFF". This in fact controls the DP switch. I have recoded this to be correct with these 3 lines:

{down = misc_commands.Switch_MC_Power,                cockpit_device_id = devices.MSC, value_down = 1.0, name = _('Mission Computer Mode OVRD'), category = _('Miscellaneous Controls')},
    {down = misc_commands.Switch_MC_Power,                cockpit_device_id = devices.MSC, value_down = 0.5, name = _('Mission Computer Mode AUTO'), category = _('Miscellaneous Controls')},              
    {down = misc_commands.Switch_MC_Power,                cockpit_device_id = devices.MSC, value_down = 0.0, name = _('Mission Computer Mode OFF'), category = _('Miscellaneous Controls')},

 

I also added these 
Probe heat switch function:

{down = misc_commands.Switch_PR_HT_Mode,                cockpit_device_id = devices.FLIGHTINSTRUMENTS, value_down = 1.0,    name = _('PRB HEAT HT'), category = _('Miscellaneous Controls')},
        {down = misc_commands.Switch_PR_HT_Mode,                cockpit_device_id = devices.FLIGHTINSTRUMENTS, value_down = 0.0,    name = _('PRB HEAT AUTO'), category = _('Miscellaneous Controls')},

 

VRS output : 

 {down = misc_commands.Switch_VRS_Output,                cockpit_device_id = devices.NAVFLIR, value_down = 0.0,    name = _('VRS DISPLAY SELECTOR MPCD'), category = _('Miscellaneous Controls')},
        {down = misc_commands.Switch_VRS_Output,                cockpit_device_id = devices.NAVFLIR, value_down = 1.0,    name = _('VRS DISPLAY SELECTOR HUD'), category = _('Miscellaneous Controls')},

 

VRS mode: 

{down = misc_commands.Switch_VRS_Mode,                        cockpit_device_id = devices.NAVFLIR, value_down = 0.0,    name = _('VRS MODE SWITCH AUTO'), category = _('Miscellaneous Controls')},
        {down = misc_commands.Switch_VRS_Mode,                        cockpit_device_id = devices.NAVFLIR, value_down = 1.0,    name = _('VRS MODE SWITCH RUN'), category = _('Miscellaneous Controls')},

 

NAV Panel:

Replaced the first 2 lines for the course selector switch with these 2 lines, now the course selector switch works without a problem. I do have the center position mapped to a keyboard command with RS MAPPER:

{down = inst_commands.Knob_Course, down = inst_commands.Knob_Course,    cockpit_device_id = devices.NAV_INS,    value_down =  -0.5, value_up = 0,       name = _('COURSE SELECTOR CCW'),                                        category = _('Navigation Control')},
        {down = inst_commands.Knob_Course, down = inst_commands.Knob_Course,    cockpit_device_id = devices.NAV_INS,    value_down =   0.5, value_up = 0,       name = _('COURSE SELECTOR CW'),                                         category = _('Navigation Control')},


-- IFF   , I added this section so that we can control the IFF switch ZERO/NORM/HOLD as you would do as part of the after landing checklist. 

-- IFF
        {down = acnip_commands.Switch_IFF_CRYPTO, up = acnip_commands.Switch_IFF_CRYPTO, cockpit_device_id = devices.ACNIP, value_down = -0.5, value_up = 0, name = _('IFF HOLD/NORM'), category = _('IFF')},
        {down = acnip_commands.Switch_IFF_CRYPTO, up = acnip_commands.Switch_IFF_CRYPTO, cockpit_device_id = devices.ACNIP, value_down = 0.5, value_up = 0, name = _('IFF ZERO/NORM'), category = _('IFF')},

 

INTERNAL LIGHTS:

Added these lines to allow the light test switch to work:

{down = int_light_commands.Switch_Compass_Light_Test,          cockpit_device_id = devices.LTINT, value_down = 0,   name = _('Compass Light/Test COMP'),        category = _('Internal Lights')},
        {down = int_light_commands.Switch_Compass_Light_Test,          cockpit_device_id = devices.LTINT, value_down = 0.5, name = _('Compass Light/Test OFF'),        category = _('Internal Lights')},
        {down = int_light_commands.Switch_Compass_Light_Test,          cockpit_device_id = devices.LTINT, value_down = 1.0,   name = _('Compass Light/Test TEST'),               category = _('Internal Lights')},


EXT LIGHTS:

I have recoded the position light switch coding with these 3 lines to have a more logical way of using this switch and removed the POS LIGHT TOGGLE coding in the original (2 lines):

{down = ext_light_commands.Switch_POS_LT,                cockpit_device_id = devices.LTEXT, value_down = 0, name = _('POS Lights OFF'), category = _('Exterior Lights')},
    {down = ext_light_commands.Switch_POS_LT,                cockpit_device_id = devices.LTEXT, value_down = 0.5, name = _('POS Lights DIM'), category = _('Exterior Lights')},
    {down = ext_light_commands.Switch_POS_LT,                cockpit_device_id = devices.LTEXT, value_down = 1.0, name = _('POS Lights BRT'), category = _('Exterior Lights')},

Added these 3 lines for the lights master switch for a more logical way of switching:

 {down = ext_light_commands.Switch_EXT_LT_NORM_NVG,                cockpit_device_id = devices.LTEXT, value_down = 0, name = _('EXT LIGHTS OFF'), category = _('Exterior Lights')},
    {down = ext_light_commands.Switch_EXT_LT_NORM_NVG,                cockpit_device_id = devices.LTEXT, value_down = 0.5, name = _('EXT Lights NVG'), category = _('Exterior Lights')},
    {down = ext_light_commands.Switch_EXT_LT_NORM_NVG,                cockpit_device_id = devices.LTEXT, value_down = 1.0, name = _('EXT Lights NORM'), category = _('Exterior Lights')},
    
KNEEBOARD - NO CHANGE
CHEAT - NO CHANGE
DEBUG - NO CHANGE

AXIS COMMANDS:

Added these lines to enable all the light adjustment dials to be controled with a potentiometer if making a home cockpit:

{action = ext_light_commands.Knob_FORM_LT, cockpit_device_id = devices.LTEXT, name = _('Formation Lights Knob Axis')},
{action = hud_commands.DisplayBRTKnob, cockpit_device_id = devices.HUDCONTROL, name = _('HUD BRT CONTROL')},
{action = hud_commands.VideoBRTKnob, cockpit_device_id = devices.HUDCONTROL, name = _('VIDEO BRT CONTROL')},
{action = hud_commands.VideoCONTKnob, cockpit_device_id = devices.HUDCONTROL, name = _('VIDEO CONT CONTROL')},
{action = edp_commands.BRT_Knob, cockpit_device_id = devices.EDP, name = _('EDP BRT CONTROL')},
{action = int_light_commands.Knob_Instr_Lights, cockpit_device_id = devices.LTINT, name = _('INST PANEL LIGHTS BRT')},
{action = int_light_commands.Knob_Console_Lights, cockpit_device_id = devices.LTINT, name = _('CONSOLE LIGHTS BRT')},
{action = int_light_commands.Knob_Flood_Lights, cockpit_device_id = devices.LTINT, name = _('FLOOD LIGHTS BRT CONTROL')},
{action = int_light_commands.Knob_Annunciator_Lights, cockpit_device_id = devices.LTINT, name = _('WARN/CAUT ANNUNC BRT CONTROL')},
{action = rwr_commands.Knob_RWR, cockpit_device_id = devices.RWRCONTROL, name = _('RWR VOL CONTROL')},

{action = acnip_commands.Knob_AUX_VOL, cockpit_device_id = devices.INTERCOM, name = _('ICS Aux Volume Knob')},
{action = ecs_commands.Knob_TEMP, cockpit_device_id = devices.ECS, name = _('ECS TEMP CONTROL')},

  • Like 1
Link to post
Share on other sites
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...