multiple controllers

BlitzMax Forums/BlitzMax Beginners Area/multiple controllers

Idiot(Posted 2006) [#1]
I'm assuming the "port" in the joystick commands is for which controller to use? If this is true, it doesn't seem to be working. Regardless of which port I specify, the same stick is used. For example:

JoyY(0)
JoyY(1)
JoyY(2)

Will all use controller one. If I'm wrong about what port is, what is it? And how do you use controller 2?


Yan(Posted 2006) [#2]
I'm not sure whether it's a bug or just undocumented, but you need to call JoyCount() at least once.

So...
Graphics 400, 300, 0

JoyCount()

Repeat
  Cls

  drawText "Port 0 - " + JoyX(0) + " : " + JoyY(0), 12, 12
  drawText "Port 1 - " + JoyX(1) + " : " + JoyY(1), 12, 24

  flip
Until appTerminate()

End
...should work.

As you should really be calling JoyCount() at some point anyway, it's not a big problem.


Idiot(Posted 2006) [#3]
wow, works great! thanks


wedoe(Posted 2006) [#4]
I sometimes wonder if good old Yan have some kind
of secret documentation that noone else have, hmm....


Dreamora(Posted 2006) [#5]
No
He just reads the sources ... (the same thing users did that bought it at launch as this was and even now is the only way of using BM efficiently)


wedoe(Posted 2006) [#6]
He he, I bought at launch :o)
(But I saw no reason to convert before the GUI was released...)


Yan(Posted 2006) [#7]
There are indeed secret docs, which can only be seen if you're covered from head to toe with maple syrup, wearing nothing but a purple tutu.

...Just don't ask how I discovered this!

;o)


Wiebo(Posted 2006) [#8]
You must visit the same parties wedoe does...


wedoe(Posted 2006) [#9]
Maple syrup is a big favourite of mine and I always stock
up when going to the US. I'm going again in two months so
I could use the rest of my supply to test Yan's proposal.
Now where is that purple tutu of mine again.....?

You must visit the same parties wedoe does...
There's nothing like those parties! ;o)