Ok, the controller works with the new drivers but still nothing happens when I run your example
Have you ever had problems like this?
float ls_XAxis = GetJoystick1Axis(0);
float ls_YAxis = GetJoystick1Axis(1);
int i;
int Button[14];
for(i=0; i<14; i++){
Button[i] = GetJoystick1Button(i);
}
xvelocity=ls_XAxis/10000;
yvelocity=ls_YAxis/10000;
if (Button[0])
{
r = 89;
g = 0;
b = 0;
}
Hblade wrote:I doubt it o-o Try this code in a simple draw actor
Global Code:
- Code: Select all
int BTN[10];
double AXIS[2];
void SetupPad() {
int i; for(i=0;i<9;i++) {
BTN[i]=GetJoystick1Button(i);
}
AXIS[0]=GetJoystick1Axis(0);
AXIS[1]=GetJoystick1Axis(1);
}
Now for Draw Actor:
- Code: Select all
SetupPad();
if (AXIS[0]>10000) {
x+=5;
}
Move the joystick (Or Dpad) to the right and see if he moves
knucklecrunchgames wrote:Hey. Is there a ged file with this example? And can you make a multiplayer game with other controllers? If possible I will make my new game with game editor.
lcl wrote:Zivouhr, does your controller have a button for changing between different controlling modes?
My controller has a mode button for changing whether to use the D-pad or the left analog stick. My D-pad doesn't response if the Mode settings is on the wrong state (obviously). You may have the same kind of a problem.
Also, it really may be that your D-pad is is treated as extra buttons. Have you tried accessing the buttons up to number 14? It depends on the controller, which number is tied to which button. Also, if you want, you can have a look at this: viewtopic.php?f=4&t=11212
RippeR7420 wrote:Hmm, that's strange. When I plug in my Ps3 Controller the GetJoystick1Button(x) codes goes as follows;
I wonder why they are different. Zivouhr, Do you use an official PlayStation Controller?
float Xaxis = GetJoystick1Axis(0);
float Yaxis = GetJoystick1Axis(1);
if(Xaxis > 2500) //D-Pad or analog stick is pushed to the RIGHT.
{
switch(STATE)
{
case 0:
ChangeAnimation("Player", "Player Walk Right", NO_CHANGE);
STATE = 2;
break;
case 1:
ChangeAnimation("Player", "Player Walk Right", NO_CHANGE);
STATE = 2;
break;
case 2:
x += 4;
break;
}
}
else
if(Xaxis < -2500) //D-Pad or analog stick is pushed to the LEFT.
{
switch(STATE)
{
case 0:
ChangeAnimation("Player", "Player Walk Left", NO_CHANGE);
STATE = 3;
break;
case 1:
ChangeAnimation("Player", "Player Walk Left", NO_CHANGE);
STATE = 3;
break;
case 3:
x -= 4;
break;
}
}
//Here is the standing still code ya want :)
else
if(Xaxis < 2500 && Xaxis > -2500) //D-Pad or analog stick Is not being pressed LEFT or RIGHT. Motionless!
{
switch(STATE)
{
case 2:
ChangeAnimation("Player", "Stand Right", NO_CHANGE);
STATE = 0;
break;
case 3:
ChangeAnimation("Player", "Stand Left", NO_CHANGE);
STATE = 1;
break;
}
}
Users browsing this forum: No registered users and 1 guest