// GPC Online Library
// ps4_cross_over_gaming_script.gpc
/*
PS4 Cross Over Gaming Script - with XB1 Elite Controller support
Starts notifying when there's 2 minutes left to reconnect.
Will get more intense over time.
Reconnect when convenient with Select/Share + A button
Elite paddles will register only as button presses, hiding paddle input
(due to odd mapping with PS4)
Select/Share + Right Joystick will perform a Share Button click
(bring up share menu on ps4)
Select/Share + D-Pad Left will click the PS4 thumbpad on the left side in the center.
Select/Share + D-Pad Right will click the PS4 thumbpad on the right side in the center.
Author: melty_THC */
int authCount;
int disableElitePaddleRec = 1;
main{
//turn off paddle info
if(disableElitePaddleRec == 1){
if(get_val(XB1_P4)){
set_val(XB1_P4, 0);
}
if(get_val(XB1_P3)){
set_val(XB1_P3, 0);
}
if(get_val(XB1_P2)){
set_val(XB1_P2, 0);
}
if(get_val(XB1_P1)){
set_val(XB1_P1, 0);
}
}
if(get_console()==PIO_PS4 && get_controller()!=PIO_PS4){
authCount = ps4_authtimeout();
if(authCount <= 1){
combo_run(notify);
}
else if (authCount <=4){
combo_run(notifyPrep);
}
}
if(get_val(XB1_VIEW)){
set_val(XB1_VIEW, 0);
if(event_press(XB1_LEFT)){
combo_run(clickLeftThumbPad);
}
else if(event_press(XB1_RIGHT)){
combo_run(clickRightThumbPad);
}
else if(event_press(XB1_A)){
output_reconnection();
set_val(XB1_A, 0);
}
else if(event_press(XB1_RS)){
combo_run(clickShare);
}
}
}
combo clickShare{
set_val(XB1_RS,0);
set_val(XB1_VIEW,100);
wait(100);
}
combo clickRightThumbPad{
set_val(XB1_RIGHT, 0);
ps4_set_touchpad(95, 45);
set_val(PS4_TOUCH, 100);
wait(150);
}
combo clickLeftThumbPad{
set_val(XB1_LEFT,0);
ps4_set_touchpad(-95, 45);
set_val(PS4_TOUCH, 100);
wait(150);
}
//get more intense over time and the delay between will become shorter
combo notifyPrep{
if(authCount==4){
set_rumble(RUMBLE_A, 5);
set_rumble(RUMBLE_B, 5);
} else if (authCount == 3) {
set_rumble(RUMBLE_A, 15);
set_rumble(RUMBLE_B, 15);
} else if (authCount == 2) {
set_rumble(RUMBLE_A, 45);
set_rumble(RUMBLE_B, 45);
}
wait(200);
reset_rumble();
wait(1000 * authCount);
}
combo notify{
set_rumble(RUMBLE_A,100);
set_rumble(RUMBLE_B,100);
wait(200);
reset_rumble();
wait(500);
}