Hi all… I have a strange thing going on here. I’ve hooked up my PS3 remote to my computer as well as my GameCube controller with a Mayflash adapter, and I’ve been hauling away on getting controller support working in my game.
After much toil and travail, I’ve created a really, really flexible configuration system for loading controllers up in my game. I request the user for various inputs (action button, back button, etc.), then store the button names. The button part is going really well, because it seems button names stay constant. However, I’ve had a small problem which has led to an important question when trying to implement axis discovery.
Before, I was identifying axes by their “axis.descriptor” key. The problem was that this value wasn’t constant for an axis. Sometimes the left stick’s axes would be defined as “Joystick 1: Axis n” and sometimes as “Joystick 2: Axis n”. I’ve since switched to using axis.number instead. It seems to be constant so far, but I want to make sure. Does an axis always return the same value for axis.number? Can I be assured that, if axis #4 shows up as a controller’s left stick Y axis, axis #4 will remain that axis and not be reassigned no matter how many times I disconnect the controller and restart my game?
- Caleb