Page 1 of 1

Axis redirection in FreePIE

Posted: Mon Nov 14, 2016 8:21 pm
by Mr. Roboto
I have Saitek's X-45 HOTAS controller and have been using GlovePIE for programming as Saitek/MadCatz no longer support it, at least not for Windows 10 64-bit. I recently discovered FreePIE, since GlovePIE killed itself by politics, and am start to get the hang of the basics.

One problem I've discovered is that my throttle control isn't the z-axis, rather it is slider[0]. Since I have a game that doesn't recognize slider controls, I need a way to have slider[0] be reassigned/redirected/rerouted to the Z-axis. What's the easiest way to do this?

Re: Axis redirection in FreePIE

Posted: Tue Nov 15, 2016 9:56 am
by Jabberwock
Does the game allow for choosing different controllers (or picks up the defaut one selected in Game Controllers)? If so, you can use a virtual controller (such as vJoy or virtual XBOX controller) and assign the axes as you prefer. Note the differences in values, though.

Re: Axis redirection in FreePIE

Posted: Tue Nov 15, 2016 7:34 pm
by Mr. Roboto
The game does pick up my X-45 (6-Axis, 24 buttons), but then it's the only controller connected for this game.

I also have vJoy installed as well, and have made a preliminary script, mostly for testing:

Code: Select all

vJoy[0].x = joystick[0].x
vJoy[0].y = joystick[0].y
vJoy[0].rz = joystick[0].zRotation
vJoy[0].z = joystick[0].sliders[0]

diagnostics.watch(vJoy[0].x)
diagnostics.watch(vJoy[0].y)
diagnostics.watch(vJoy[0].z)
diagnostics.watch(vJoy[0].rz)
Tried it in the game, but z-axis still doesn't respond, even though I configured the first vJoy with z-axis.

Re: Axis redirection in FreePIE

Posted: Tue Nov 15, 2016 11:53 pm
by Jabberwock
The question is whether the game sees as the controller X45 or vJoy. If it is the former, then obviously it will not work. Try first controlling the vJoy with something else (e.g. mouse), while X45 is still connected. Then make sure the game is using vJoy and not X45.

Re: Axis redirection in FreePIE

Posted: Wed Nov 16, 2016 4:50 pm
by Mr. Roboto
Nope, the game only sees the X-45 when it's plugged in, even when vJoy is selected as the default controller. vJoy does work with the mouse (except the buttons for some reason, already let them know about that), but as long as the X-45 is connected it's the controller seen and used.

I was hoping I can use the HOTAS throttle normally, but now it looks like I'll have to make it into some type of digital control instead (crud). BTW, the game is an old XP-era app gone open source called No Gravity (https://sourceforge.net/projects/nogravity/)

Re: Axis redirection in FreePIE

Posted: Wed Nov 16, 2016 5:05 pm
by Jabberwock
You can try loading the mouse vJoy script with x45 disconnected, when the game is started (and configured), and stop that and connect/load the x45-vJoy script when the game is already running. Some games only pick up the controller at the beginning/configuration and then communicate with it further on. Sadly, some games stop working at all when the controller input is stopped (been there, done that).

Re: Axis redirection in FreePIE

Posted: Wed Nov 16, 2016 8:58 pm
by Mr. Roboto
... and now vJoy is going to be a dick by refusing to respond even though the axis worked earlier today. [Nuclear explosion from skull.jpg] Gonna have to put this on hold until I hear from vJoy about this latest fubar.

Re: Axis redirection in FreePIE

Posted: Wed Nov 16, 2016 11:42 pm
by Jabberwock
When it does work you might want to check out this thread:
http://vjoystick.sourceforge.net/site/i ... ontrollers

They mention two utilities for reordering controllers that might help you.

Re: Axis redirection in FreePIE

Posted: Fri Nov 25, 2016 2:45 pm
by Mr. Roboto
Sorry about not getting back sooner, been having problems getting vJoy to work properly. But now everything's working.

I am also happy to report the axis-redirection script I made DOES work in "No Gravity". I just have to plug in my X-45 and start the script after the game loads to the main menu. Now all I need to do is get a deadzone worked into the rudder.

Re: Axis redirection in FreePIE

Posted: Fri Nov 25, 2016 2:57 pm
by Jabberwock
That's great!

The deadzone should be trivial: map the real axis to the virtual one, if its absolute value exceeds the threshold.