The Daily Click ::. Forums ::. Klik Coding Help ::. 360 Movement Issues
 

Post Reply  Post Oekaki 
 

Posted By Message

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
24th June, 2009 at 03:32:47 -

I've been messing around with Joystick 2 Object to give first person controls in a top down view, i.e. left stick controls the movement forwards and back, right stick rotates. Reading off the percentage of how much the sticks have moved from the center and dividing that by 20 means the movement speed is limited to 5 in both rotation and movement. Plugging all this into a couple of cos and sin expressions gives a nice smooth movement except for one issue.

At lower speeds the angle that the player moves at is clearly different to the way they're pointing. I've no idea what's causing this and it's making my otherwise nice movement all screwy >__>

Any help would be greatly appreciated, as always

http://www.deviantart.com/download/127019855/Analogue_by_SumDood2003.mfa

 
There are 10 types of people in the world: Those who understand binary and those who don't.

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
25th June, 2009 at 03:08:56 -

That's pretty strange, Rob. I actually just picked up a wired Xbox 360 controller today with the intention of looking into using it with my platform shooter.

As for your issue, I can't really say what the problem is. Have you tried putting the player angle into a counter and displaying it on screen? Might help with the debugging.

Also, have you found out how to use the Xbox 360 controller's triggers? I just installed the Joystick2 object and only seem to be able to use the analog sticks and buttons - not the triggers.

 

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
25th June, 2009 at 21:18:29 -

I'm not sure how to set up the triggers. I don't need them at the moment so I've not experimented. Although interestingly when I first started using the Joystick 2 object the input from the all the "right stick" events and expressions were actually being fed from the triggers until I discovered the "Map Right Stick Axis" event. Bizarre.

EDIT: Fixed it. Converted all the ints to floats

Edited by Rob Westbrook

 
There are 10 types of people in the world: Those who understand binary and those who don't.

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
26th June, 2009 at 05:41:14 -

Okay, I figured out how to use the triggers. They aren't buttons - they are the z-axis.

 

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
26th June, 2009 at 15:34:45 -

Oh really? Well that doesn't make any kind of sense...

 
There are 10 types of people in the world: Those who understand binary and those who don't.

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
26th June, 2009 at 16:37:29 -

Yeah, pretty strange, eh? I guess the triggers are the z-axis because they have a range of values (-999 to +999 I think) depending on which trigger you're pressing and how far down you're pressing it. Pressing the trigger gently increases/decreases the value only a little while holding it all of the way down produces the largest change.

You can check this (in Vista) by going to Control Panel > Classic View > Game Controllers > Properties > Test tab.

Hold down the trigger and watch the z-axis change. You'll need to look at the z-axis in a counter object in MMF to see what the value actually is.

Checking the control panel applet for Game Controllers will also show you which buttons are assigned to which numbers (for use in the Joystick2 object). I think it is like this:
A - 1
B - 2
X - 3
Y - 4
Left Shoulder - 5
Right Shoulder - 6
Back - 7
Start - 8
Left Stick (pressed) - 9
Right Stick (pressed) - 10

 

Jess Bowers

Cake > Pie

Registered
  09/01/2009
Points
  310

Has Donated, Thank You!GOTM FEB - 2010 - WINNER!GOTW Winner!
26th June, 2009 at 16:39:44 -

BTW, I gotta say "Joystick2 object FTW!"

There is nothing like force feedback when you're shooting a weapon.

 
   

Post Reply



 



Advertisement

Worth A Click