Members | Sign In
All Forums > Hardware and LBE construction
avatar

How do you map a joystick to the helms duty station?

posted Jul 17, 2013 22:33:55 by DeaneGeiken
I picked up a free (but fully functional!) Interact RaiderPro Digital joystick from a sale and want to hook it up to the helm duty station. Currently with plug and play, it uses impulse when you push the stick forward or pull back and turns the ship right or left when you do the same with the stick. However, Warp 1 is Button 1, Warp 2 is on the thumb stick button, and Warp 3 and 4 are buttons 2 and 3. Reverse is not available at all. How does one remap the code to get the joystick to response as one might want to customize it? Thanks!
Commander -TSN Belisarius (BS 108)
page   1
10 replies
avatar
JoeGreene said Jul 18, 2013 01:28:27
in controls.ini file in Artemis Directory:
Here's the joystick section of the one we used at InConJunction:

ANALOG_RUDDER = UI_INPUT_JOY0_AXIS0
DEADZONE = 0.0
MULTIPLY = 1.0
POWER = 1.0
ADD = 0.0
HIGH_BOUND = 1.0
LOW_BOUND = -1.0

ANALOG_THROTTLE = UI_INPUT_JOY0_AXIS2

JOY_WARP_1 = UI_INPUT_JOY0_BUTT2
JOY_WARP_2 = UI_INPUT_JOY0_BUTT3
JOY_WARP_3 = UI_INPUT_JOY0_BUTT4
JOY_WARP_4 = UI_INPUT_JOY0_BUTT5
HELM_TOGGLE_REVERSE = UI_INPUT_JOY0_BUTT1

avatar
DeaneGeiken said Jul 18, 2013 02:34:46
Thanks Joe! I will give it a try! I appreciate it!!
Commander -TSN Belisarius (BS 108)
avatar
DeaneGeiken said Jul 18, 2013 02:49:16
What if I wanted to put Warp 1 into the trigger?
This stuff is pretty new to me....
Commander -TSN Belisarius (BS 108)
avatar
MarkBell said Jul 18, 2013 11:26:39
You'll have to figure out which button is which on your joystick.

Here are the default button mappings for the joystick in controls.ini:
JOY_WARP_1 = UI_INPUT_JOY0_BUTT0
JOY_WARP_2 = UI_INPUT_JOY0_BUTT1
JOY_WARP_3 = UI_INPUT_JOY0_BUTT2
JOY_WARP_4 = UI_INPUT_JOY0_BUTT3


Sounds like your current mapping is Button 1 is being read as Joystick 0 Button 0 (Warp 1), the Thumbstick button is read as Button 1 (Warp 2), and buttons 2 and 3 are read as buttons 2 and 3 (warp 3 and 4, respectively). As Joe mentioned above, it's pretty straightforward to remap things in your helm console's controls.ini file. If you can find your joystick in the Game Controllers section of your Control Panel, there should be a widget that lets you push buttons on the controller and see how they're mapped in the computer.
avatar
DeaneGeiken said Jul 18, 2013 14:07:38
Hi Mark! Thanks for the advice. I will look into this tonight. I think I can figure it out without too much issue. This stuff make a bit more sense than DMX coding! BTW-- any chance you could take a look at my DMX query on the other topic? Thanks! Joe, if I can get this to work, then maybe I might be able to add my system to yours for implementing your idea for InConJuntion 2014!
Commander -TSN Belisarius (BS 108)
avatar
DeaneGeiken said Jul 19, 2013 00:27:51
ok. Trigger is Button 1, thumb button is #2 base button (far left) is #3 Base button (second from left) is #4, Base button ((second from right) is #5 and base button (far right) is #6. Our preference would be to make the trigger #1 WARP 1, the thumb stick button#2 REVERSE, Base button #3 SHEILDS, Base button #4 WARP2, base button #4 WARP 3 and base button #5 WARP 4. (we thought maybe forgoing warp 4 and making it a request dock)

Would this look right?

ANALOG_THROTTLE = UI_INPUT_JOY0_AXIS2

JOY_WARP_1 = UI_INPUT_JOY0_BUTT1
JOY_WARP_2 = UI_INPUT_JOY0_BUTT4
JOY_WARP_3 = UI_INPUT_JOY0_BUTT5
JOY_WARP_4 = UI_INPUT_JOY0_BUTT6
HELM_TOGGLE_REVERSE = UI_INPUT_JOY0_BUTT2
TOGGLE_SHIELDS = UI_JOY0_BUTT3
Commander -TSN Belisarius (BS 108)
avatar
DeaneGeiken said Jul 19, 2013 00:52:44
Well it looks like my coding is bad, or my controller is bad. Button 1 (trigger) does nothing. Button 2 (stick thumb button) is Warp 1 instead of reverse, Button 3 is Reverse instead of toggling shields (maybe it should be raise shields instead) Button 4 does not respond with any action and Buttons 5 and 6 are Warp 2 and 3 accordingly. I tried flipping things around but still got everything off by one button. suggestions? (maybe a new controller might make this easier.....) ;)
Commander -TSN Belisarius (BS 108)
avatar
JoeGreene said Jul 22, 2013 15:46:21
Sounds like
Trigger=BUTT0 (the code uses a 0 based index instead of a 1 based index so the trigger is button 0 not button 1)
Thumb=BUTT1
your TOGGLE_SHIELDS line is borked should be TOGGLE_SHIELDS = UI_INPUT_JOY0_BUTT3 .. or more accurately .. oh just try this:

ANALOG_THROTTLE = UI_INPUT_JOY0_AXIS2

JOY_WARP_1 = UI_INPUT_JOY0_BUTT0
JOY_WARP_2 = UI_INPUT_JOY0_BUTT3
JOY_WARP_3 = UI_INPUT_JOY0_BUTT4
JOY_WARP_4 = UI_INPUT_JOY0_BUTT5
HELM_TOGGLE_REVERSE = UI_INPUT_JOY0_BUTT1
TOGGLE_SHIELDS = UI_INPUT_JOY0_BUTT2

avatar
DeaneGeiken said Jul 22, 2013 16:21:05
hahaha! Thanks Joe!!!
Commander -TSN Belisarius (BS 108)
avatar
DeaneGeiken said Jul 23, 2013 02:24:18
Bingo!!!!
Commander -TSN Belisarius (BS 108)
Login below to reply: