Using controllers with two analog sticks...
Blitz3D Forums/Blitz3D Beginners Area/Using controllers with two analog sticks...
| ||
If you are using a joystick with two analog sticks, is it possible for a Blitz3d game to be programmed so that it used both of them? If so, how is it done? |
| ||
yes blitz can use both analog sticks at the same time, they vary from controller to controller but are normally x and y axis there is an excelent example of dual stick controller method posted here a while back, one stick controlling the left and the other right thrusters of a hover vehicle edit: http://www.blitzbasic.com/Community/posts.php?topic=77308 and a util by pongo http://www.blitzbasic.com/codearcs/codearcs.php?code=1592 |
| ||
Try this joystick example, move both joysticks around and see what values change. |
| ||
To GIB3D: Are you using Biltz3D SDK? Because my Blitz3D didn't recognize a lot of the commands in your snippet of code... |
| ||
to robofan: can u post the control stick code please? ^^ |
| ||
Control stick code? |
| ||
i meant the dual analog stick code. |
| ||
I'm not sure where GIB3d got those commands but most of them are indeed nonsense ... Replace them with these commands .. JoyX( Port ) JoyY( Port ) JoyZ( Port ) JoyPitch( Port) JoyRoll( Port ) JoyYaw( Port ) JoyU( Port ) JoyV( Port ) JoyHat( Port ) On a PS2 controller L stick = JoyX for left/right , JoyY for up/down R stick = JoyRoll for left/right, JoyZ for up/down Note that you must divide the output from JoyRoll by 180.0 to get a valid result between -1 and 1. Stevie |
| ||
I got them straight out of the JoyV example in the help documents. It's the same example for JoyU, JoyYaw, JoyPitch, JoyRoll and some of the other ones. Edit: I'm not sure where GIB3d got those commands but most of them are indeed nonsense ... If I made the example I wouldn't have done it like that either, I just copied and pasted. |
| ||
I just updated my Blitz3D, and now I can use both joysticks! Thanks for the help! |
| ||
@superrobofan, can u release the source for the joysticks? |