domdavis / ch-products-elite-map

CH Products joystick map and game config files for Elite: Dangerous
Other
43 stars 20 forks source link

Update to the v2.0.0 version of the maps #3

Closed domdavis closed 9 years ago

Krashlog commented 9 years ago

As a newbie with CH Control Manager, I'm curious about the pros/cons of the map being "almost entirely virtual". Care to elaborate? Thanks.

domdavis commented 9 years ago

Certainly @Krashlog :)

When you fire up the CH Control Manager and add devices it simply maps that to a Direct X device. The first thing you add becomes Direct X device 1, the second things is Direct X device 2, and so on.

By default the axis are mapped to x, y and z for that device and buttons are mapped from button 1 to button 16 (or however many buttons the device has).

You can then use the software to change these assignments through the UI. Games tend not to like two joysticks, so I often end up using the UI to map both the throttle and stick to Direct X device 1.

Assuming you only need 32 button assignment you can then map one of the sticks to Direct X device 1 buttons 17-32.

By mapping one of the buttons to shift in the Control Manager you can double up the number of buttons available to you. Direct X only allows for 32 buttons and 8 axis per device so you need to start getting a bit creative. Generally this just involves mapping some buttons to presses on the keyboard.

There's a few other things you can do through the UI to do with modes and sequences, but every one of these mappings is a direct mapping to a physical device. The only way to control the axis or button is by moving the relevant axis or pressing the relevant button on the device.

The Control Manager also allows you to write what they call CMS scrips, and these can access the CMS device. The CMS device has 256 buttons and 64 axis. Mapping these buttons and axis is similar to mapping buttons and axis on the actual devices (the only difference is that you can directly assign a button to a POV Hat direction one the CMS device rather than just declaring the POV hat act like a POV hat) and is done in the UI.

Crucially these buttons and axis are not controlled by any physical device. They are controlled by the CMS script, which is why I refer to them as 'virtual'.

With a CMS script and CMS buttons/axis I can do things like CMS.A1 = JS2.A1 which sets the first axis on the CMS device to have the same value as the X axis on the second physical device (the Fighterstick in my map). Where this gets clever is when you start combining it with logic.

Consider:

toggle(D2) = JS1.B5 and not JS2.B4 and JS1.B3;

if (D2) then
  CMS.A1 = 128;
  CMS.A4 = JS2.A1;
else
  CMS.A1 = JS2.A1;
  CMS.A4 = 128;
endif

Line 1 sets a special variable, called a toggle, that toggles between on and off (true and false) every time I press right on hat 1 on the throttle, and button 3 on the throttle, but not the pinky button on the stick.

I then say if the toggle is on then set the first CMS axis to have the value 128 (centred - axis go from 0 to 256) and control the 4th CMS axis via the x axis on the second device (fighterstick).

Finally we say that if the toggle is not set then control the 1st CMS axis via the x axis on the fighterstick and set the 4th CMS axis to be centred.

In the CMS map I've set axis 1 to be Direct X device 1 x axis, and axis 2 to be Direct X device 1 slider 0. In the game I've then mapped the x axis to roll and slider 0 to yaw.

What this does is allow me to swap the x axis on the figherstick between roll and yaw on pressing alt + throttle hat 1 right on my map.

There is a similar setup for disabling the throttle, it swaps between CMS.A17 (the throttle axis in my map) between being controlled directly by the throttle, or being set to 0.

The other thing CMS scripting allows me to do is have more than one modifier button. Using the UI I can have a default action and a shifted action. Using a CMS script I can have as many modifiers as I like by just checking the state of various buttons and causing an CMS button to be pressed if a certain button combination is pressed.

If you look at the cms script you'll see things like:

%define shift JS2.B4
%define alt JS1.B3
%define stick.pov.up JS2.B25
CMS.B45 = stick.pov.up and not shift and not alt;
CMS.B46 = stick.pov.up and shift and not alt;
CMS.B47 = stick.pov.up and not shift and alt;
CMS.B48 = stick.pov.up and shift and alt;

The first two sections just define some nice names for the buttons to make the script easier to read. The block with 4 lines is setting 4 different buttons to the up direction on the POV hat. One with it pressed with neither of the modifier buttons set, one with it pressed with just shit, one with it pressed with just alt, and one with it pressed with shift and alt. We then bind the 4 actions to 4 different CMS buttons.

I hope that makes sense. Shout if you've got more questions :)

Krashlog commented 9 years ago

WOW - Thank you for the very detailed and thorough answer. I might try my hand at CMS scripting to tweak a few things but right now I'm using your map as is, and I find it very natural and logical. I'm loving my CH gear, and CH Control Manager is such a wonderful piece of software. Thanks again!