Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Multiple Joysticks

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 6th Mar 2009 14:14 Edited at: 6th Mar 2009 14:19
Hello everyone!

I just bought two

"macro kit(tm) easyhold(tm) speed link strike 2 force vibration dual analogue programmable buttons for precise gaming control"

joystick thingies (unbelievable how long the names of some devices are these days) that pretty much look like a playstation 2 controller with a D-pad and a few extra functions.

small pic:



I want to be able to use both of them in my game for 2 players. Is this possible with DBC, or do I have to pay?

TheComet

Peachy, and the Chaos of the Gems

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th Mar 2009 19:13
Anyone?

Peachy, and the Chaos of the Gems

BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 11th Mar 2009 19:50
You could try switching to controller 1, figuring out what is pressed, switch to controller 2, figure out what is pressed, and then act on those.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th Mar 2009 20:11
What do you mean with "switching"? And what if they are both pressing the same button at the same time?

Peachy, and the Chaos of the Gems

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Mar 2009 20:37
If you use PERFORM CHECKLIST FOR CONTROL DEVICES, you may get a list of the attached controllers using checklist string$().

If so, then like BN2 said, swap between the control devices for input:



I don't know which commands you'd use to receive the buttons inputs. Maybe once the control device is set you could use the joystick commands. There seem to only be control device x() y and z commands. But after switching the device, see if the joystick commands work for it.

Enjoy your day.
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 12th Mar 2009 16:22
Something like this should technically work although for some reason it acts strangely:



Note that if the device names are the same, you won't be able to switch between them.

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Apr 2009 22:27
FINALLY, I got around to testing your great examples.

Thanks a lot for every ones help, but something happend:

*copy* - *open DarkEdit* - *paste* - *run* - "whoa!! OMG!! My game is running at 0.5 fps!!!"

The set control device command slows everything down and makes the game un-playable... Am I doing something wrong?

TheComet

Peachy, and the Chaos of the Gems

That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 5th Apr 2009 22:33
hey, u asked for a solution, not a FAST solution

There are only 10 kinds of people in the world, those who understand binary and those who dont
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 5th Apr 2009 22:33
Quote: "The set control device command slows everything down and makes the game un-playable... Am I doing something wrong?"

Yes, line 15 of your code... wait, you haven't shown as any code.

It may be that set control device is slow, which wouldn't surprise me.

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Apr 2009 22:38
Quote: "Yes, line 15 of your code... wait, you haven't shown as any code.

It may be that set control device is slow, which wouldn't surprise me."


Well, I don't really need to post any code because it all comes down to the code you posted. And yes, the set control device IS slow...

TheComet

Peachy, and the Chaos of the Gems

Login to post a reply

Server time is: 2025-08-08 20:42:35
Your offset time is: 2025-08-08 20:42:35