Issue with Controller....?
Posted: Sat Oct 23, 2010 10:07 pm
Alrighty guys, I have a lot of code so I cant show all of it.
My question is, howcome the controller only works for 1 actor.
here we go:
Menu - Button 2(On controller is pressed) - Create Actor - DialogBox
The dialog box shows up with this code in the draw-actor of the menu.
Now in the draw_actor of the dialog box:
I have also tried this:
Adding that to the code with int ii of course, (Why not i you ask? i does nothing for some strange reason)
anyway, the problem is, it doesnt register. I have no idea whats going on!!
My question is, howcome the controller only works for 1 actor.
here we go:
Menu - Button 2(On controller is pressed) - Create Actor - DialogBox
The dialog box shows up with this code in the draw-actor of the menu.
- Code: Select all
double JOYS = GetJoystick1Axis(1);
int ii;
int TEMP;
for (ii=0;ii<17;ii++) {
PAD[ii] = GetJoystick1Button(ii);
}
if (PAD[B_B] == 1 && TEMP == 0) {
TEMP = 1;
PlaySound2("data/conferm.wav", 1.000000, 1, 0.000000);
press = index;
}
if (PAD[B_B] == 0 && TEMP == 1) {
TEMP = 0;
}
switch(press) {
case 0:
break;
case 1:
if (SAVEEXISTS == 0) {
CreateActor("D_MENU", "dark_menu", "(none)", "(none)", 0, 0, true);
focus = 999;
}
break;
case 2:
break;
case 3:
musicvol-=.02;
TIMER++;
if (TIMER>=60) {
ExitGame();
}
EventDisable("Event Actor", EVENTKEYDOWN);
break;
}
if (JOYS>=1000 && tmp == 0) {
tmp = 1;
if (index<4) {
index++;
y+=20;
}
if (index == 4) {
index = 0;
y-=80;
}
PlaySound2("data/cursor.wav", 1.000000, 1, 0.000000);
}
if (JOYS<=-1000 && tmp == 0) {
tmp = 1;
if (index>-1) {
index--;
y-=20;
}
if (index==-1) {
index = 3;
y+=80;
}
PlaySound2("data/cursor.wav", 1.000000, 1, 0.000000);
}
if (JOYS<1000 && JOYS>-1000 && tmp == 1) {
tmp = 0;
}
Now in the draw_actor of the dialog box:
- Code: Select all
int TEMP;
if (PAD[B_B] == 1 && TEMP == 0) {
TEMP = 1;
PlaySound2("data/conferm.wav", 1.000000, 1, 0.000000);
DestroyActor("Event Actor");
}
if (PAD[B_B] == 0 && TEMP == 1) {
TEMP = 0;
}
I have also tried this:
- Code: Select all
for (ii=0;ii<17;ii++) {
PAD[ii] = GetJoystick1Button(ii);
}
Adding that to the code with int ii of course, (Why not i you ask? i does nothing for some strange reason)
anyway, the problem is, it doesnt register. I have no idea whats going on!!