You need glovepie to run this script and you need ppjoy to set up a virtual joystick. After you set up a virtual joystick in ppjoy, you need to map one of its virtual axis to the brakes in the settings.ini file (IL-2 game file). It should something like this:
[HotKey move]
AXE_RZ JoystickDevice3=brakes
Joystickdevice3 refers to the numbering that Windows assigns to game controllers. It starts at 0 and increases incrementally. You can tell from this i have 3 real controllers (devices #0, #1, and #2, my joystick and 2 gamepads) and 1 virtual controller, #3). Go to windows game controllers in the control panel. You will see a list of what you have connected. It is listed in numerical order from top to bottom, 0,1,2,3...etc. Wherever your virtual joystick lies in this list is the number it is assigned.
Here is the glovepie script that does what you want. Copy/paste/save to glovepie and run when you play the game. I tested in game and it works. When you turn the twist rudder to the left, nothing happens, the brake is off. When the rudder sits at center, the brake is off. When you twist it to the right, the brake is applied proportionally. PPJoy1.Analog3 would be the Z axis of my virtual joystick as shown in ppjoy. Joystick1.roll is the glovepie identifier for my real joystick rudder action. Most likely your 3d joystick will be recognized the same as mine is in glovepie. If not, you will have to use the glovepie debug command to find how glovepie recognizes your rudder action on your twist joystick, and then subsitute that identifier for where I have joystick1.roll in the script. But it will probably work ok if it is standard 3d joystick.
GlovePieScript
if joystick1.roll <=0 then
var.brake=-1
elseif joystick1.roll >0 then
var.brake=(2*(joystick1.roll))-1
endif
PPJoy1.Analog3=var.brake
|