Julio 24, 2018, 10:26:39 PM Ultima modificación: Julio 25, 2018, 12:23:53 AM por kostra
Bueno, me he comprado un par de mandos para pc, estaba apunto de venir a preguntar pk no me salia, pero por fin me ha salido... lo que.... no sé si funcionará con todos los mandos, pero con el mio ya va PERFECT!!

Es un simple acomodado para tener más fácil uso del joystick y me gustaría que alguien lo puediera probar para ver que tal en otros mandos...

el script:
[spoiler]
[gml]///joy_check(id,button)

//joy
if argument1 == "joy_up" {
    return joystick_direction(argument0) == vk_numpad8;
    }
if argument1 == "joy_down" {
    return joystick_direction(argument0) == vk_numpad2;
    }
if argument1 == "joy_left" {
    return joystick_direction(argument0) == vk_numpad4;
    }
if argument1 == "joy_right" {
    return joystick_direction(argument0) == vk_numpad6;
    }

//buttons
if argument1 == "button_1" {
    return joystick_check_button(argument0,1);
    }
if argument1 == "button_2" {
    return joystick_check_button(argument0,2);
    }
if argument1 == "button_3" {
    return joystick_check_button(argument0,3);
    }
if argument1 == "button_4" {
    return joystick_check_button(argument0,4);
    }

//special
if argument1 == "button_L1" {
    return joystick_check_button(argument0,5);
    }
if argument1 == "button_R1" {
    return joystick_check_button(argument0,6);
    }
if argument1 == "button_L2" {
    return joystick_check_button(argument0,7);
    }
if argument1 == "button_R2" {
    return joystick_check_button(argument0,8);
    }
if argument1 == "button_select" {
    return joystick_check_button(argument0,9);
    }
if argument1 == "button_start" {
    return joystick_check_button(argument0,10);
    }

//joyclick
if argument1 == "joy_lclick" {
    return joystick_check_button(argument0,11);
    }
if argument1 == "joy_rclick" {
    return joystick_check_button(argument0,12);
    }

//pad
if argument1 == "button_up" {
    return gamepad_button_check(argument0+3,gp_padu);
    }
if argument1 == "button_down" {
    return gamepad_button_check(argument0+3,gp_padd);
    }
if argument1 == "button_left" {
    return gamepad_button_check(argument0+3,gp_padl);
    }
if argument1 == "button_right" {
    return gamepad_button_check(argument0+3,gp_padr);
    }

//extra - por terminar, botones "turbo" y "clear"[/gml]
[/spoiler]

botones (se pone entre comillas):
[spoiler]
"joy_up", "joy_down", "joy_left" y "joy_right" = direccion del joystick (palanquita) izquierdo
"button_1" = triángulo (ps)
"button_2" = redonda/círculo (ps)
"button_3" = equis/cruz (ps)
"button_4" = cuadrado (ps)
"button_L1", "button_R1", "button_L2", "button_R2" = gatillos (ps)
"button_select", "button_start" = select y start, obviamente xD
"joy_lclick", "joy_rclick" = clicks de los joysticks (palanquitas) izquierda y derecha
"button_up", "button_down", "button_left", "button_right" = panel direccional (botones/flechas)
[/spoiler]

un ejemplo de uso:
[spoiler]
[gml]
if joy_check(1,joy_up) y -= 4;
if joy_check(1,joy_down) y += 4;
if joy_check(1,joy_left) x -= 4;
if joy_check(1,joy_right) x += 4;

if joy_check(1,button_R2) disparando = true;
else disparando = false;
[/gml]
esto sería para moverse y disparar solo si pulsas R2
[/spoiler]



espero que les sirva a principitos, digo principiantes como io :B

PD: el +3 que ven en algunas ultimas lineas es pk en ese comando, los mandos tipo playstation empieza a contar el player desde 4 a 11, lo lei en youtube y resulta que sí xD para xbox alomejor se tendría que quitar, nuse, si alguien puede probar xd

PD2: me dio pereza simplificarlo, lo haré, no hace falta ni que me lo comenten xDD
[spoiler="ola k ase clickarme o k ase"]la imagen no se quita xD
[/spoiler]