Jump to content

Recommended Posts

Posted

I'm trying to bind two position switches on my Hotas Warthog to the Master Arm and Gun Arm switches. Currently they only have toggle functionality, meaning I have to flip the switch twice to change on/off. Unfortunately I can't find a cockpit_device_id and enumeration of the switch, but I have added a line to the 3-Pos switch abstractions to toggle them -

 

{down = iCommandPlaneAHCPGUNArm, up = iCommandPlaneAHCPGUNArm,    name = _('Gun Arm TOGGLE ME'),      category = _('3-Pos. Switch Abstractions')},

However, this doesn't account for the position of the switch to start with. Is there a way to do this better?

 

I've also tried blindly using "iCommandPlaneAHCPGUNArmOff" following the landing gears principal - "iCommandPlaneGearUp" and "iCommandPlaneGearDown", but that didn't work.

 

Does anyone know the switch enumeration for the master arm/gun arm?

Posted (edited)

{down = 3234, up = 3234, cockpit_device_id = 6, value_down = 0, value_up = 1, name = _('Master Arm Switch'), category = _('Weapons Management')},

{down = 3463, up = 3463, cockpit_device_id = 6, value_down = 0, value_up = 1, name = _('Gun Arm Switch'), category = _('Weapons Management')},

 

 

Try it

Edited by Rlaxoxo
  • Like 1

[sIGPIC][/sIGPIC]

Youtube

Reddit

Posted (edited)

Here is for Master Arm and Gun Arm

 

{down = 3234, up = 3234, cockpit_device_id = 6,  value_down = 1, name = _('Master Arm On'), category = _('Weapons Management')},
 {down = 3234, up = 3234, cockpit_device_id = 6,  value_down = 0, name = _('Master Arm Off'), category = _('Weapons Management')},

 {down = 3463, up = 3463, cockpit_device_id = 6,  value_down = 1, name = _('Gun Arm To Armed'), category = _('Weapons Management')},
 {down = 3463, up = 3463, cockpit_device_id = 6,  value_down = 0, name = _('Gun Arm To Safe'), category = _('Weapons Management')},

However, for Master Arm i have tested and, if the switch (the 3D model) is actually activated, the program does not take it as "Master Arm" command, it only moves the switch, so unfortunatly, this is perfectly useless...

 

For Gun Arm, i don't have tested...

 

 

EDIT:

 

I forget that: To enable the Master Arm switch to moves (which is useless i repeat) you must also edit the clickabledata.lua script.. line 500, as this:

 

elements["PTN_234"] = default_2_position_tumb(_("Master Arm Switch"), devices.PCA_PPA, device_commands.Button_234, 234)

Edited by sedenion
Posted

These are the keybinds for the Master Arm and the Gun Arm switches:

 

{combos = {{key = '6', reformers = {'LCtrl'}}}, down = iCommandPlaneAHCPGUNArm, name = _('Gun Arm TOGGLE'), category = _('Weapons Management')},
{combos = {{key = '0'}}, down = iCommandSwitchMasterArm,   name = _('Master Arm TOGGLE'),   category = _('Weapons Management')},

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."

"The three most dangerous things in the world are a programmer with a soldering iron, a hardware type with a program patch and a user with an idea."

Posted (edited)
{down = 3234, up = 3234, cockpit_device_id = 6, value_down = 0, value_up = 1, name = _('Master Arm Switch'), category = _('Weapons Management')},

{down = 3463, up = 3463, cockpit_device_id = 6, value_down = 0, value_up = 1, name = _('Gun Arm Switch'), category = _('Weapons Management')},

 

 

Try it

 

Master Arm doesn't work (not even the switch moves), Gun Arm switch moves but haven't tested shooting yet. Thanks for the help so far, I'll play around some more and try to get something working.

 

How do you find the switch enumeration and cockpit_device_id? I googled for a while to find a method but resorted to just checking current bindings.

 

 

 

 

These are the keybinds for the Master Arm and the Gun Arm switches:

 

{combos = {{key = '6', reformers = {'LCtrl'}}}, down =  iCommandPlaneAHCPGUNArm, name = _('Gun Arm TOGGLE'), category =  _('Weapons Management')},
{combos = {{key = '0'}}, down = iCommandSwitchMasterArm,   name = _('Master Arm TOGGLE'),   category = _('Weapons Management')},

 

I can see those, but that's only a toggle - The switch only has an On position and an Off position, to I have to flip it to On twice to toggle. I'm trying to make it work for Switch on - Arm on, Switch off - Arm off.

 

 

Here is for Master Arm and Gun Arm

 

I forget that: To enable the Master Arm switch to moves (which is useless i repeat) you must also edit the clickabledata.lua script.. line 500, as this:

 

elements["PTN_234"] = default_2_position_tumb(_("Master Arm Switch"),  devices.PCA_PPA, device_commands.Button_234, 234)

 

Thanks. I guess we'll have to wait for a iCommandSwitchMasterArmOn method to be added before it works though.

Edited by Compulse
Posted (edited)
These are the keybinds for the Master Arm and the Gun Arm switches:

 

We are speaking about non-toggle commands :) The warthog switchs are two ways without automatic return to center (unlike the X55)... this is why non-toggle commands are precious to map Warthog...

 

 

To be precise (and to understand exactly what is the problem):

 

Physicaly (without programming) the Warthog switchs are:

- Position Up : ButtonX Pressed (keeped ON)

- Position Down : ButtonX Released (keeped OFF)

(in this case, the "3-Pos. Switch Abstractions" are used)

 

Virtually (if we use programming) this is:

- Position Up : Command A (Only Once)

- Position Donw : Command B (Only Once)

(in this case, the separated X OFF and X ON commands are used)

 

All without return to center, this is Up OR Down... this is why toggle commands are a problem to map with Whartog.

Edited by sedenion
Posted

 

For Gun Arm, i don't have tested...

 

 

 

I just tested the Gun Arm, and it works fine with that code. Master Arm doesn't :(

 

Can you explain how you find the enumerations and panel IDs of the switches?

Posted
Can you explain how you find the enumerations and panel IDs of the switches?

 

In Mods/aircraft/M-2000C/Cockpit/ :

 

clickabledata.lua

 

give you the full list of virtual cockpit buttons and switchs. To have the correct button Id for input default LUA, you have to add 3000 to each original value, for example:

 device_commands.Button_235, [b]235[/b], 0, 1)

235 => 3235

 

devices.lua

 

give you the device list with id in comments (at right, after -- )

  • Like 1
  • Recently Browsing   0 members

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