Jump to content

Recommended Posts

Posted (edited)

This modification was found by my friend and squad mate MyG while drinking his coffees in the mornings... but he is shy and more silent :D. He explained me on TeamSpeak and I post it in his place. Is funny that he lives in UK but doesn't like to write in english... I live in Romania and I like the challenge. I hope I don't make many mistakes :D... I've learned english listening songs.

 

 

Don't be afraid of the long post. Is just 3 little lines to be added to one file but I give the explanations so you can also understand what you do.

 

 

 

These are the ways to add input commands for pilot sight fo UH-1H:

 

Caution!

 

Although it was said many times by now I have to say it again.

 

USE ONLY NOTEPAD++ TO EDIT LUA FILES!!!!

 

Failure to do this removes any rights for anyone to complain he has corrupted his files.

 

 

 

1. FIRST WAY

 

Edit you joystick.lua files from:

 

C:\Users\Your User Name\Saved Games\DCS\Config\Input\UH-1H\joystick

 

You may have one or more lua files there depending on how many joysticks/controllers you have.

 

For example I have A logitech G940 and it has 3 devices so I have 3 lua files.

 

However because I wanted to assign the pilot sight controls only to Joystick I edited only the joystick lua file and not the throttle and rudder pedals ones.

 

So.

 

You will need to add the following line to the start of the "yourjoystick.lua" file from the above mentioned address after the line: keyCommands = {:

 

 

 

{down = 3006, cockpit_device_id = 49, value_down = 1, name = "Pilot Sight Lamp On", category = "Pilot Sight"},

 

Note that this line will be sorted by the game logic order immediately after you map that control in game options. So later if you wat to find it use search for word "sight". ;)

 

 

 

 

And these two lines in the last part of the file "yourjoystick.lua" where the axis are stored after the "axisCommands = {" line... you will see it:

 

{action = 3001, cockpit_device_id = 49, name = "Pilot Sighting Station Intensity"},

{action = 3003, cockpit_device_id = 49, name = "Sight Elevation"},

 

By this way you edit directly your personal controls files, the game reads them and applies them. The original game files remain unchanged. You can set your controls then in options.

 

Now some explanations about what some of the numbers and words mean:

 

down means that is a command for a button when it is in down position. You will see also Up and Pressed in that file, they mean the "up" position of the button and "while kept pressed" position.

 

3006 means button 06 while cockpit_device_id = 49 means the device from cockpit with the number 49. So you may rad them "6 of 49" and they mean "Pilot Sight Lamp Switch from Pilot Sight Device".

 

If you read the files:

 

clickabledata.lua and devices.lua (from the folder: Your DCS World folder\Mods\aircrafts\Uh-1H\Cockpit\Scripts) you will see in the first one the names (codes) of all cockpit available commands and in the second the names of cockpit devices (that have many of those commands or buttons and switches). The cockpit devices have a number to the right of them... for example: devices["PILOT_SIGHT"] = counter() -- 49

 

Of course by understanding what is in there you can add more commands to your joystick.lua files.

 

Then the value_down means that if a button have 2 states normally has 0 and 1 values. If it has 3 states it has 0,1 and -1 values. But it can have intermediate values sometimes and I didn't understood yet when. You can have value_up=1 and value_down=0 and what it does depends on what was programed to do that value.

 

name = "Pilot Sight Lamp On" means the name that command will have in your Option screen

 

category = "Pilot Sight" means the name of the category from the drop down list of the controls for UH1-H

 

These names you are free to choose them free. You can even create a category with your name... it will appear in controls like your category.

 

action means that line defines an axis.

 

3001 means is the axis 01 (30 is like a omnipresent number... consider it ED signature)

 

cockpit_device_id = 49as above means is the axis 3 on device 49. obviously you can have axis3 on another device... it is no conflict.

 

name= the name you choose to appear in your axis category.

 

 

 

 

2. SECOND WAY

 

Edit the file "Default.lua" from this folder:

 

Your DCS World folder\Mods\aircrafts\Uh-1H\Input\UH-1H\joystick

 

This file contains the default commands that appear when you installed first time UH1-H. Some commands are empty (we add them also empty) some already contains actual joystick buttons or axes.

 

Although this file basically does the same thing like the first one it has a little bit different syntax...

 

The same 3 commands as above will have to be added like this:

 

find the line:

 

-- Flexible sight

 

and add bellow this:

 

{down = device_commands.Button_6, cockpit_device_id = devices.PILOT_SIGHT, value_down = 1, name = 'Pilot Sight Lamp On', category = "Pilot Sight"},

 

as you can see... instead of using 3006 is using device_commands.Button_6 and instead of using cockpit_device_id = 49 it uses cockpit_device_id = devices.PILOT_SIGHT

 

thes coded names are founded in clickabledata.lua

 

example

elements["PILOT-SIGHT-SWITCH-PTR"] = default_2_position_tumb(_("Pilot Sight On/Off"), devices.PILOT_SIGHT, device_commands.Button_6, 439)

 

Then at the end on the axis zone after the -- joystick axes line add these:

 

{action = device_commands.Button_1, cockpit_device_id = devices.PILOT_SIGHT, name = 'Pilot Sighting Station Intensity'},

{action = device_commands.Button_3, cockpit_device_id = devices.PILOT_SIGHT, name = 'Sight Elevation'},

 

by now you should understand what it means. :D

 

3. THE THIRD WAY

 

The third way is simples to install but then you need to remap all buttons for UH1-H by deleting first the folder "Joystick" from this address:

 

C:\Users\Your User Name\Saved Games\DCS\Config\Input\UH-1H

 

Exactly like when ED adds a command and says in update note to delete your commands.

 

It could be annoying for some but you need nothing to edit...

 

This 3rd way is done by installing a mod via JSMGE.

 

The mod is attached to this post in a zip archive named: FIX UH1H pilot sight input.zip

 

To install... simply extract the folder named FIX UH1H pilot sight input from it into you _Mods folder and activate the mod via JSMGE.

 

Then delete your controls from Your user folder as described above (make backup obviously) and remap them in game.

 

 

Remember to disable this mod after ED or BST have added those missing commands later in a patch.

 

 

Final Notes.

 

I added as attachments 2 lua files that contains only the lines to be added as explained in this post but without any alteration from forum pagination.

 

I didn't understand yet how to make the Pilot Sight lamp toggle-able... so is just On position... for Off you sill have to use mouse but mapping Sight Toggle solves the problem... as the sight goes up the lamp doesn't matter if is on or off.

 

Also if you understand the principles you may add any other command for any other module.

 

You can even create buttons for axis and vice-versa if I understood correctly my friend MyG.

 

And two pics to see the controls

 

p3og.jpg

 

0a62.jpg

FIX UH1H pilot sight input.zip

lines to be added to default.lua

Lines to be added to your Joystick name.lua file.lua

Edited by zaelu

[sIGPIC][/sIGPIC]

I5 4670k, 32GB, GTX 1070, Thrustmaster TFRP, G940 Throttle extremely modded with Bodnar 0836X and Bu0836A,

Warthog Joystick with F-18 grip, Oculus Rift S - Almost all is made from gifts from friends, the most expensive parts at least

Posted (edited)

like in the pictures above. It just adds assignable controls to those commands that were just clickable.

Edited by zaelu

[sIGPIC][/sIGPIC]

I5 4670k, 32GB, GTX 1070, Thrustmaster TFRP, G940 Throttle extremely modded with Bodnar 0836X and Bu0836A,

Warthog Joystick with F-18 grip, Oculus Rift S - Almost all is made from gifts from friends, the most expensive parts at least

  • Recently Browsing   0 members

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