Game Development Community

Two analog sticks creating fatal error

by Cosmic Logic · in Torque Game Builder · 05/18/2009 (5:38 pm) · 5 replies

Hey,

I'm working with an xbox 360 controller as a gamepad and I'm getting fatal errors as soon as I put in some functionality for the 2nd analog stick.

I've got them put in using:
moveMap.bindObj(getWord(%this.xSpecial, 0), getWord(%this.xSpecial, 1), "specialX", %this);
   moveMap.bindObj(getWord(%this.ySpecial, 0), getWord(%this.ySpecial, 1), "specialY", %this);
It works fine to run if I'm not moving the 2nd analog stick, but soon after I move the 2nd analog stick it crashes.

Anyone have this problem or know how to fix it?

#1
05/19/2009 (1:51 am)
This works for me:

moveMap.bind(joystick, "xaxis", joyMoveX);
moveMap.bind(joystick, "yaxis", joyMoveY);
moveMap.bind(joystick, "rxaxis", joyMoveRX);
moveMap.bind(joystick, "ryaxis", joyMoveRY);
#2
05/22/2009 (11:17 pm)
Are you using that in a behavior? or just a regular script?
#3
05/25/2009 (7:13 am)
Regular script.
#4
05/28/2009 (11:02 am)
Ah. I need to use mine in a behavior so the bind has to be attached to the behavior object.
#5
05/29/2009 (6:52 am)
Just use rXaxis and rYaxis instead of xSpecial and ySpecial