The while loop if the problem. It does run the code in it without ever leaving this loop, never being able to run the "main {} loop again. This causes the reboot of the T2.This should do the same as your code, but running one after the other.
I removed the set_val(button,0); lines as the second wait directly after the press wait will do the same. This saves some space.
Those wait(0); after the button press are doing nothing in this case as far as I know.
Use a wait time >0 if you want to have the previous button released for some time before the next button press happens.
the "call" function does run the combo, waits for it to complete, then runs the next call command, waiting for this combo to complete, and so on until it reached the end of the combo looper. The main loop "if" statement will start the looper combo again after it has finished.
- Code: Select all
#pragma METAINFO("Suicide Squad Infected", 1, 09, "captain")
#include <ps4.gph>
bool keepalive = TRUE;
main {
if (keepalive == TRUE) combo_run(looper);
}
combo looper {
call(ENTERTHEDRAGON);
call(WHACK);
call(SUICIDE);
call(STEPSPINWHACK);
}
combo ENTERTHEDRAGON {
/* select load out (then jump in game) */
set_val(PS4_CROSS, 100);
wait(50);
wait(250);
}
combo WHACK {
// whack x4
set_val(PS4_R3, 100);
wait(10);
wait(50);
set_val(PS4_R3, 100);
wait(10);
wait(50);
set_val(PS4_R3, 100);
wait(10);
wait(50);
set_val(PS4_R3, 100);
wait(10);
wait(0);
}
combo SUICIDE {
// suicide: throw smoke (or plant insertion flare), then cook grenade (or do nothing for 5 seconds)
set_val(PS4_L2, 100);
wait(50);
wait(0);
set_val(PS4_R2, 100);
wait(5000);
wait(0);
}
combo STEPSPINWHACK{ // step left, whack, and turn left
set_val(STICK_2_X, -100);
wait(50);
wait(0);
set_val(PS4_CROSS, 100);
wait(10);
wait(0);
set_val(STICK_1_X, -100);
wait(500);
wait(0);
}