Jump to content

Recommended Posts

Posted (edited)

I'm trying to add 'nudge' CW/CCW bindings to the 'weapon interval' rotary control in the Viggen. Normally creating new bindings isn't too difficult but in this case the LUA files are using command numbering I don't understand.

 

A comparable example I was trying to copy is the weapon selector knob, which does have 'nudge' bindings. In clickabledata.lua we have:

elements["WepSEL-PTR"] = multiposition_switch_limited(_("Weapon Selector Knob - J/A Valjare"), devices.WEAPON_SYSTEM, 3304, 264, 6, 0.1, false, 0)

 

In the default.lua for keyboard commands we have:

	{down = 3304,            cockpit_device_id = devices.WEAPON_SYSTEM, value_down = 0.0,                 name = _("Weapon Selector 0 SJÖ/PLAN"), category = _("Weapons")}, -- added v0.6
	{down = 3304,            cockpit_device_id = devices.WEAPON_SYSTEM, value_down = 0.1,                 name = _("Weapon Selector 1 RB75/MARK/DYK"), category = _("Weapons")}, -- added v0.6
	{down = 3304,            cockpit_device_id = devices.WEAPON_SYSTEM, value_down = 0.2,                 name = _("Weapon Selector 2 LUFT/RR"), category = _("Weapons")}, -- added v0.6
	{down = 3304,            cockpit_device_id = devices.WEAPON_SYSTEM, value_down = 0.3,                 name = _("Weapon Selector 3 AKAN/JAKT"), category = _("Weapons")}, -- added v0.6
	{down = 3304,            cockpit_device_id = devices.WEAPON_SYSTEM, value_down = 0.4,                 name = _("Weapon Selector 4 ATTACK"), category = _("Weapons")}, -- added v0.6
	{down = 3304,            cockpit_device_id = devices.WEAPON_SYSTEM, value_down = 0.5,                 name = _("Weapon Selector 5 IR-RB"), category = _("Weapons")}, -- added v0.6

 

I understand this so far. But this is the key bindings for individual rotary positions. For the 'nudge' CW/CCW commands, on the same control, we have:

	{combos = {{key = "W", reformers = {"LShift","LCtrl"}}}, down = 3969, cockpit_device_id = devices.WEAPON_SYSTEM, value_down = -1.0, name = _("Weapon selector turn clockwise"), category = _("Weapons")},
    {combos = {{key = "W", reformers = {"LAlt","LCtrl"}}}, down = 3969, cockpit_device_id = devices.WEAPON_SYSTEM, value_down = 1.0, name = _("Weapon selector turn counterclockwise"), category = _("Weapons")},

 

Where does 3969 come from? Why doesn't it use 3304? I've done a text search and the only files where 3969 appears is the default.lua files, there's nothing in clickabledata.lua. I don't understand how it's assigned, or how to establish what the command number would be for a 'nudge' binding for the weapon interval selector.

Edited by electricaltill
  • Recently Browsing   0 members

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