Jump to content

Recommended Posts

Posted (edited)

Hi guys,

 

I'm trying to get a key command for the FLAPS BIT test button in the AV8B so that I can assign it to my pit button. You can click the button in the game but there is no key command for it and it's not in the control options list at all.  I saw the youtube about assigning new commands in the LUA files but I'm confused how to do it for the harrier because it looks different to the Viggen example in the video. I see there is a 38 (?) page thread above regarding LUA amendments but before I read through all of that is there a quick way to do this? 

 

 

Edited by Bbow
Posted (edited)

I haven't flown it yet, so not familiar with where the button is to make sure it was pressing. I did hear a clicking sound and didn't have anything else bound to my test key, so I think it should work? Added it to the other Flaps controls in the VSTOL Controls group:

 

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

 

That'll go in your AV8BNA\Input\AV8BNA\keyboard\default.lua file. I've been adding a few controls for the F-14 (wing sweep lever) and A-10CII (hmcs power switch) lately and was feeling inspired.

 

My process based off my limited knowledge:

1) <plane>/Cockpit/ holds the files defining the controls and what is clickable. Like for this change, i opened up clickabledata.lua and searched for "flaps bit", since you mentioned it's already clickable. then the important bits are what device it's a part of and what command ID it has.

 

2) <plane>/Input/ holds the files that map the above controls to input devices. here, i went to AV8BNA\Input\AV8BNA\keyboard\default.lua, and then searched for other flaps controls. Then copied one and replaced the command reference with the one from the clickabledata.lua file (Button_FLAP_BIT). other flaps commands were already mapped to the VREST device, so no change needed there!

 

EDIT: Re-reading, if the button doesn't go back up on release, then add a value_up = 0 to it, so on release the value gets set back, like:

 

{down = 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')},

 

Edited by Monkwolf
  • Like 1
  • Thanks 1
Posted

To make the button go up on release you need to include this: "up = fcs_commands.Button_FLAP_BIT". So the complete line is:

{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')},

This makes the button go up and down, but I couldn't see any reaction. Frankly, I rarely fly the Harrier and since there is still no flight manual I have no way of knowing what the Flaps BIT is supposed to do.

  • Thanks 1

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Posted

Thanks for the replies guys! I had "following" for this thread set to ON but it didn't bring up a notification hence the late reply.   Anyhow, thank you for replying and I will be trying those lines of code to see if I can get it to work. 

 

 

  • 2 weeks later...
Posted

Just amended the lua with what you guys wrote and it worked perfectly!!! Thank you so much. 

 

Is there any difference in assigning an axis command as opposed to a button press? For example assigning an axis to control a brightness knob with a rotary encoder. 

Posted
1 minute ago, Bbow said:

Is there any difference in assigning an axis command as opposed to a button press? For example assigning an axis to control a brightness knob with a rotary encoder. 

Lighting brightness knobs in most cases are represented by both an axis command and a pair of commands for pushbuttons (or rotary encoders). If the key commands are optimized for pushbuttons, you will find rotary encoders slow. And if they are optimized for rotary encoders, pushbuttons will be fast.

  • Thanks 1

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Posted

Hi guys. ran into a bit of a weird problem. 

 

I'm trying to create a keybind for the IFF switch. It was only available in the clickable cockpit but there was no keybind. So this is the part from the clickabledata.lua:

 


-- IFF
elements["PTN_632"] = default_2_position_tumb_animated(_("IFF Operational Mode Switch"),            devices.ACNIP, acnip_commands.Switch_IFF_OPMODE,    632)
elements["PTN_632"].sound = {{SOUND_SW2}, {SOUND_SW2}}
elements["PTN_633"] = default_3_position_tumb_animated(_("IFF Crypto Mode Switch"),                    devices.ACNIP, acnip_commands.Switch_IFF_CRYPTO,    633, false, true)
elements["PTN_633"].sound = {{SOUND_SW2}, {SOUND_SW2}}

 

 

In the joystick LUA I created this for the 3 position switch (the Crypto Mode Switch):

 


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

 

I also created an addition to the keyboard LUA in order to assign the middle position of the 3 position switch. The addition is the 0.5 value command line. 

 

So, the weird problem is that in the cockpit when I move my joystick switch to the ZERO position it recognises that, when I move it to the middle or to the HOLD position it doesn't do anything. I tried swapping the down values but that didn't solve the problem. Any ideas what I did wrong?  

Posted (edited)

These work for me:

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

 

Edited by LeCuvier

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Posted

If you were to use a 3-position switch (like the one in the sim cockpit), it would be just these two lines:

{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')},

 

  • Thanks 1

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Posted

Thank you so much, that works perfectly now! I guess my coding was a bit wrong. 

 

So does the "value up" mean when you put the switch to the middle position? 

Posted

Short answer: yes.

A three-position switch is basically two mechanically interlocked ON/OFF switches.

"value_up" is the command value when either of the two switches goes from ON to OFF, and for our 3-position switch that is the mddle position.

  • Thanks 1

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Posted

Interesting, this method worked on the IFF switch but on another, I had to use the other method of having a Valuedown of 1 / 0 and 0.5 for the middle.  


Have you got any knowledge of how to create a line in the LUA to be assign an AXIS?   

For example, I want to create a brightness adjust knob for the formation lights. It is clickable in the cockpit but there is no possibility to add an axis to control this button. I had a look at the LUA to try and copy something that has an axis but it doesn't look simple.  Do you know how to do this?

Posted

this line creates an axis command for the formation light brightness knob:

{action = ext_light_commands.Knob_FORM_LT, cockpit_device_id = devices.LTEXT, name = _('Formation Lights Knob Axis')},

Set to Slider and Invert.

However, the command uses only 50% of the slider movement. That's quite common when you create an axis command this way.

The line needs to be added into the "axis" section of the file, after this line:

join(res.axisCommands,{

 

  • Thanks 1

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Posted

Amazing! So you are the LUA guru!   Thank you so much, I will try this tomorrow. Hopefully it's a building block to apply to other axis controls. Hardly any have been coded for the AV8B....so annoying. 

Posted

I agree, they have not done a sterling job with their control bindings. But you should be able to create the other axes by the same approach.

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

  • 2 weeks later...
Posted

LeCuvier, i have added the axis commands to the LUA file but have run into a strange problem. Every few minutes the axis that controls the HUD brightness goes from 100% to 0% in a fraction of a second, you can see the HUD flicker when it happens. The same happens with the FLOOD light but I have that one set 0% and every few minutes it goes from 0 to 100% and back to 0% , like a spike, it happens really really quickly but you can notice it.  I have checked the axis curves and the potentiometer connections but nothing unusual found.    Any ideas what could be causing this? 

Posted

Frankly no, I've never seen that phenomenon.

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Posted

yes, to me this sounds like a problem in hardware or connections.

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Posted

LeCuvier, I once again seek your expertise and knowledge. I am trying to create 2 lines in the joystick LUA for the BINGO fuel dial for the AV8B. There is no coding whatsoever at the moment and in the clickabledata.lua this is the line:

 

elements["PTN_380"] = default_axis_cycle(_("Bingo Fuel Set Knob"),                            devices.FQIS, fqi_commands.BingoSet,        380, 0, 0.01, false)
 

 

I want to assign a rotary encoder to it so that when I rotate the knob clockwise the bingo fuel number increase and decreases with a anti-clockwise rotation. I have been trying for several hours now to get this coding done but have no success. I think the problem is that it's "axis-cycle" and I have no idea how to code this. Any ideas?

  • Recently Browsing   0 members

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