PDA

View Full Version : Chun li - Instant Air Legs script help



kasumiberry
16th December 18, 14:55
I'm trying to figure out how to execute this better in my script. It's chun's instant air legs mapped to R3, but I can only execute it if I'm not holding down any of the directionals (for example, it won't execute correctly if I press R3 while holding back for block).

Is there a way to modify this so it can execute correctly? I was thinking maybe add a neutral button at the top to force a neutral? Or is there a command to ignore all directionals/buttons while executing a combo?

I'm also using script manipulator, but I looked through most of the functions and didn't see an option for it.

// 2018-12-16 10:25:15// Combo generated by MAX Combo Plugin.
//----------------------------------------
combo ial {// instant air legs
set_val(PS4_DOWN, 100);
wait(50);
set_val(PS4_DOWN, 100);
set_val(PS4_RIGHT, 100);
wait(40);
set_val(PS4_DOWN, 0);
set_val(PS4_RIGHT, 100);
wait(20);
set_val(PS4_UP, 100);
set_val(PS4_RIGHT, 100);
wait(20);
set_val(PS4_UP, 100);
set_val(PS4_RIGHT, 0);
wait(30);
set_val(PS4_UP, 100);
set_val(PS4_RIGHT, 100);
wait(20);
set_val(PS4_UP, 0);
set_val(PS4_RIGHT, 100);
wait(10);
set_val(PS4_DOWN, 100);
set_val(PS4_RIGHT, 100);
wait(50);
set_val(PS4_DOWN, 100);
set_val(PS4_RIGHT, 100);
set_val(PS4_CIRCLE, 100);
wait(50);
set_val(PS4_DOWN, 100);
set_val(PS4_RIGHT, 0);
set_val(PS4_CIRCLE, 100);
wait(50);
set_val(PS4_DOWN, 0);
set_val(PS4_CIRCLE, 100);
wait(10);
set_val(PS4_LX, 22);
set_val(PS4_LY, 23);
set_val(PS4_CIRCLE, 100);
wait(10);
set_val(PS4_LX, 0);
set_val(PS4_LY, 0);
set_val(PS4_CIRCLE, 100);
wait(10);
set_val(PS4_CIRCLE, 0);
}

Batts
16th December 18, 16:31
I'm trying to figure out how to execute this better in my script. It's chun's instant air legs mapped to R3, but I can only execute it if I'm not holding down any of the directionals (for example, it won't execute correctly if I press R3 while holding back for block).

Is there a way to modify this so it can execute correctly? I was thinking maybe add a neutral button at the top to force a neutral? Or is there a command to ignore all directionals/buttons while executing a combo?

I'm also using script manipulator, but I looked through most of the functions and didn't see an option for it.

// 2018-12-16 10:25:15// Combo generated by MAX Combo Plugin.
//----------------------------------------
combo ial {// instant air legs
set_val(PS4_DOWN, 100);
wait(50);
set_val(PS4_DOWN, 100);
set_val(PS4_RIGHT, 100);
wait(40);
set_val(PS4_DOWN, 0);
set_val(PS4_RIGHT, 100);
wait(20);
set_val(PS4_UP, 100);
set_val(PS4_RIGHT, 100);
wait(20);
set_val(PS4_UP, 100);
set_val(PS4_RIGHT, 0);
wait(30);
set_val(PS4_UP, 100);
set_val(PS4_RIGHT, 100);
wait(20);
set_val(PS4_UP, 0);
set_val(PS4_RIGHT, 100);
wait(10);
set_val(PS4_DOWN, 100);
set_val(PS4_RIGHT, 100);
wait(50);
set_val(PS4_DOWN, 100);
set_val(PS4_RIGHT, 100);
set_val(PS4_CIRCLE, 100);
wait(50);
set_val(PS4_DOWN, 100);
set_val(PS4_RIGHT, 0);
set_val(PS4_CIRCLE, 100);
wait(50);
set_val(PS4_DOWN, 0);
set_val(PS4_CIRCLE, 100);
wait(10);
set_val(PS4_LX, 22);
set_val(PS4_LY, 23);
set_val(PS4_CIRCLE, 100);
wait(10);
set_val(PS4_LX, 0);
set_val(PS4_LY, 0);
set_val(PS4_CIRCLE, 100);
wait(10);
set_val(PS4_CIRCLE, 0);
}

You could do something like this...






main {
//--run the combo
if(event_press(PS4_R3))
combo_run(MY_COMBO);

//--while combo is running look for and block dpad
if(combo_running(MY_COMBO)) {
check_dpad(PS4_UP);
check_dpad(PS4_DOWN);
check_dpad(PS4_LEFT);
check_dpad(PS4_RIGHT);
}
}
combo MY_COMBO {
//--combo stuff
}
function check_dpad(f_btn) {
if(get_val(f_btn))
set_val(f_btn,0);
}

kasumiberry
16th December 18, 17:57
^ Thanks for the suggestion! Unfortunately it didn't work though.

Here's the script I'm working on so far for Chun. All of them are unstable because the directional input on the dpad messes up the directional properties of the macro'd combos. It's weird because if I input a directional dpad movement, then return to neutral (no dpad presses), the script is set to that direction. For example if I press left > let go to return to neutral > press RS direction for macro > the script seems to think I'm pressing left the entire time so it messes the whole thing up.

I haven't done directional switching with the touchpad yet, so maybe that's the problem. If anyone has a template or code that switches sides via the dpad I can just copy paste, that would be much appreciated!

// Script was generated with < Script Manipulator > ver. 14.0 Date :12/16/18 Time: 12:42:11 PM//------------------------------------------------------------------------

define BTN1 = 17; // TRIANGLE, Y
define BTN2 = 18; // CIRCLE, B
define BTN3 = 19; // CROSS, A
define BTN4 = 20; // SQUARE, X
define BTN5 = 3; // R1, RB
define BTN6 = 4; // R2, RT
define BTN7 = 6; // L1, LB
define BTN8 = 7; // L2, LT
define TOUCH = 27; // TOUCH PAD
define UP = 13; // DPAD UP
define DOWN = 14; // DPAD DOWN
define LEFT = 15; // DPAD LEFT
define RIGHT = 16; // DPAD RIGHT
define MOVE_X = 11; // LEFT ANALOG X
define MOVE_Y = 12; // LEFT ANALOG Y
//-----------------------------------------------------
define BACK = 128; // BACK FLAG
define FORWARD = 129; // FORWARD FLAG


// End Flags. 254 and 255 should never be used in the
// data segment for other purposes.
//-----------------------------------------------------
define EOC = 254; // End of Combo
define EOD = 255; // End of Data Segment
//-----------------------------------------------------


define hitcon1 = 0;
define ial = 1;
define pun1 = 2;
define qcfk = 3;
define crush1 = 4;
data(
hitcon1,
1,DOWN,
2,
2,DOWN,
BTN4,
13,
0,14,
1,BTN1,
6,
2,DOWN,
BTN1,
9,
1,DOWN,
30,
2,DOWN,
BTN2,
14,
1,DOWN,
12,
2,DOWN,
BACK,
2,
1,UP,
5,
2,UP,
BTN2,
11,
1,BTN2,
3,
EOC,
ial,
1,DOWN,
5,
2,DOWN,
FORWARD,
4,
1,FORWARD,
2,
2,UP,
FORWARD,
2,
1,UP,
3,
2,UP,
FORWARD,
2,
1,FORWARD,
1,
2,DOWN,
FORWARD,
5,
3,DOWN,
FORWARD,
BTN2,
5,
2,DOWN,
BTN2,
5,
1,BTN2,
1,
1,BTN2,
1,
1,BTN2,
1,
EOC,
pun1,
1,DOWN,
8,
2,BTN5,
DOWN,
10,
1,DOWN,
8,
2,DOWN,
FORWARD,
3,
2,FORWARD,
BTN3,
9,
2,DOWN,
BTN3,
1,
1,BTN3,
4,
0,2,
1,DOWN,
81,
2,DOWN,
BTN4,
10,
3,DOWN,
FORWARD,
BTN4,
1,
2,DOWN,
FORWARD,
6,
1,FORWARD,
1,
2,UP,
FORWARD,
1,
2,UP,
BTN3,
7,
3,BTN6,
UP,
BTN3,
2,
2,UP,
BTN3,
2,
EOC,
qcfk,
1,DOWN,
5,
2,DOWN,
FORWARD,
2,
1,FORWARD,
3,
2,FORWARD,
BTN2,
4,
1,BTN2,
1,
1,BTN2,
1,
1,BTN2,
1,
1,BTN2,
1,
1,BTN2,
2,
EOC,
crush1,
1,BTN6,
17,
0,50,
1,FORWARD,
10,
0,6,
1,FORWARD,
12,
0,8,
1,DOWN,
3,
2,DOWN,
BTN2,
13,
1,DOWN,
7,
2,DOWN,
FORWARD,
5,
1,FORWARD,
4,
2,BTN6,
FORWARD,
1,
1,BTN6,
6,
EOC,
EOD );
int i = -1, b, v;
int back = LEFT, forward = RIGHT;
int button_1, button_2, button_3, button_4, button_5;
int value_1, value_2, value_3, value_4, value_5;
int wait_time;
int switch;
int delay_t;
int RUMBLE_TYPE=RUMBLE_A;
int cancel;
int EndOfCombo;
int CanStart;

main {



// Determine Back and Forward
if(get_val(RIGHT) || get_val(MOVE_X) >= 30) {
back = LEFT; forward = RIGHT;
} else if(get_val(LEFT) || get_val(MOVE_X) <= -30) {
back = RIGHT; forward = LEFT;
}//----------------------------------------------



// If there is a combo to be executed
if(i >= 0 && delay_t<=0) {
// Execute the combo step-by-step
if(!combo_running(execute_step)) {
if(get_step_values()) {
if(wait_time == 0) {
combo_run(execute_step_no_wait);
} else {
combo_run(execute_step);
}
} else { // the combo finished
i = -1;
}
}

// RS X and Y are in rest - cancel the combo
if ( (abs(get_val(9)) <= 20 && abs(get_val(10)) <= 20) && (abs(get_val (11)) <= 20 && abs(get_val (12)) <= 20) && (!get_val(5) && !get_val(8))) {
i = -1;
combo_stop(execute_step);
}
//CANCEL ----------------------------------------------------------



// Make sure the user inputs does not interfere in the combo
set_val(BTN1 , 0);
set_val(BTN2 , 0);
set_val(BTN3 , 0);
set_val(BTN4 , 0);
set_val(BTN5 , 0);
set_val(BTN6 , 0);
set_val(BTN7 , 0);
set_val(BTN8 , 0);
set_val(UP , 0);
set_val(DOWN , 0);
set_val(LEFT , 0);
set_val(RIGHT , 0);
set_val(MOVE_X , 0);
set_val(MOVE_Y , 0);

// if no combo execute - look for combo activation
} else {
// EDIT THIS PART OF SCRIPT for combo run ---------------------------
//////////////////////////////////////////////////////////////////////////
// Right Stick RIGHT
if (get_val (9) >= 60) { //combo hitcon1
i = get_combo_index(hitcon1);
}
// Right Stick LEFT
if (get_val (9) <= -60) { //combo crush1
i = get_combo_index(crush1);
}
// Right Stick DOWN
if (get_val (10) >= 60) { //Combo pun1
i = get_combo_index(pun1);
}
// hold RS / R3
if (get_val (5)) { //Fatality 2
i = get_combo_index(ial);
}
// end editing here --------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////////////////////
}// <combo activation> end
}//<main> block end

// This combo will run a step with wait
combo execute_step {
set_buttons_values();
wait(wait_time);
set_buttons_values();
}

// This combo will run a step without wait
combo execute_step_no_wait {
set_buttons_values();
}


combo RUMBLE_NOTIFICATION {
set_rumble(RUMBLE_TYPE, 100);
wait(300);
reset_rumble ();
}

// Returns the starting index of a combo
function get_combo_index(combo_id) {
i = 0;
while(TRUE) {//-----------------------
v = dbyte(i);
if(v == combo_id) {
return(i + 1);
} else {//====================
while(v != EOC && v != EOD) {//#
i = i + 1;
v = dbyte(i);
}//#
if(v == EOD) break;
else i = i + 1;
}//=============================
}//-----------------------------------
return(-1);
}

// Set the buttons, values and wait time of a step
function get_step_values() {
b = dbyte(i); i = i + 1;
if(b > 5) return(FALSE);

if(b >= 1) {
button_1 = convert_back_forward(dbyte(i)); i = i + 1;
value_1 = 100;
} else { button_1 = -1; value_1 = 0; }

if(b >= 2) {
button_2 = convert_back_forward(dbyte(i)); i = i + 1;
value_2 = 100;
} else { button_2 = -1; value_2 = 0; }

if(b >= 3) {
button_3 = convert_back_forward(dbyte(i)); i = i + 1;
value_3 = 100;
} else { button_3 = -1; value_3 = 0; }

if(b >= 4) {
button_4 = convert_back_forward(dbyte(i)); i = i + 1;
value_4 = 100;
} else { button_4 = -1; value_4 = 0; }

if(b >= 5) {
button_5 = convert_back_forward(dbyte(i)); i = i + 1;
value_5 = 100;
} else { button_5 = -1; value_5 = 0; }

wait_time = dbyte(i); i = i + 1;
wait_time = (wait_time - 1) * 10;
if(wait_time < 0) wait_time = 0;

return(TRUE);
}

// If the step has FORWARD and BACK buttons, set the correct value.
function convert_back_forward(button) {
if(button == FORWARD) {
return(forward);
} else if(button == BACK) {
return(back);
}
return(button);
}

// Set the buttons and values, function used on the combos.
function set_buttons_values() {
if(button_1 != -1) set_val(button_1, value_1);
if(button_2 != -1) set_val(button_2, value_2);
if(button_3 != -1) set_val(button_3, value_3);
if(button_4 != -1) set_val(button_4, value_4);
if(button_5 != -1) set_val(button_5, value_5);
}

Batts
16th December 18, 20:13
^ Thanks for the suggestion! Unfortunately it didn't work though.

Here's the script I'm working on so far for Chun. All of them are unstable because the directional input on the dpad messes up the directional properties of the macro'd combos. It's weird because if I input a directional dpad movement, then return to neutral (no dpad presses), the script is set to that direction. For example if I press left > let go to return to neutral > press RS direction for macro > the script seems to think I'm pressing left the entire time so it messes the whole thing up.

I haven't done directional switching with the touchpad yet, so maybe that's the problem. If anyone has a template or code that switches sides via the dpad I can just copy paste, that would be much appreciated!

// Script was generated with < Script Manipulator > ver. 14.0 Date :12/16/18 Time: 12:42:11 PM//------------------------------------------------------------------------

define BTN1 = 17; // TRIANGLE, Y
define BTN2 = 18; // CIRCLE, B
define BTN3 = 19; // CROSS, A
define BTN4 = 20; // SQUARE, X
define BTN5 = 3; // R1, RB
define BTN6 = 4; // R2, RT
define BTN7 = 6; // L1, LB
define BTN8 = 7; // L2, LT
define TOUCH = 27; // TOUCH PAD
define UP = 13; // DPAD UP
define DOWN = 14; // DPAD DOWN
define LEFT = 15; // DPAD LEFT
define RIGHT = 16; // DPAD RIGHT
define MOVE_X = 11; // LEFT ANALOG X
define MOVE_Y = 12; // LEFT ANALOG Y
//-----------------------------------------------------
define BACK = 128; // BACK FLAG
define FORWARD = 129; // FORWARD FLAG


// End Flags. 254 and 255 should never be used in the
// data segment for other purposes.
//-----------------------------------------------------
define EOC = 254; // End of Combo
define EOD = 255; // End of Data Segment
//-----------------------------------------------------


define hitcon1 = 0;
define ial = 1;
define pun1 = 2;
define qcfk = 3;
define crush1 = 4;
data(
hitcon1,
1,DOWN,
2,
2,DOWN,
BTN4,
13,
0,14,
1,BTN1,
6,
2,DOWN,
BTN1,
9,
1,DOWN,
30,
2,DOWN,
BTN2,
14,
1,DOWN,
12,
2,DOWN,
BACK,
2,
1,UP,
5,
2,UP,
BTN2,
11,
1,BTN2,
3,
EOC,
ial,
1,DOWN,
5,
2,DOWN,
FORWARD,
4,
1,FORWARD,
2,
2,UP,
FORWARD,
2,
1,UP,
3,
2,UP,
FORWARD,
2,
1,FORWARD,
1,
2,DOWN,
FORWARD,
5,
3,DOWN,
FORWARD,
BTN2,
5,
2,DOWN,
BTN2,
5,
1,BTN2,
1,
1,BTN2,
1,
1,BTN2,
1,
EOC,
pun1,
1,DOWN,
8,
2,BTN5,
DOWN,
10,
1,DOWN,
8,
2,DOWN,
FORWARD,
3,
2,FORWARD,
BTN3,
9,
2,DOWN,
BTN3,
1,
1,BTN3,
4,
0,2,
1,DOWN,
81,
2,DOWN,
BTN4,
10,
3,DOWN,
FORWARD,
BTN4,
1,
2,DOWN,
FORWARD,
6,
1,FORWARD,
1,
2,UP,
FORWARD,
1,
2,UP,
BTN3,
7,
3,BTN6,
UP,
BTN3,
2,
2,UP,
BTN3,
2,
EOC,
qcfk,
1,DOWN,
5,
2,DOWN,
FORWARD,
2,
1,FORWARD,
3,
2,FORWARD,
BTN2,
4,
1,BTN2,
1,
1,BTN2,
1,
1,BTN2,
1,
1,BTN2,
1,
1,BTN2,
2,
EOC,
crush1,
1,BTN6,
17,
0,50,
1,FORWARD,
10,
0,6,
1,FORWARD,
12,
0,8,
1,DOWN,
3,
2,DOWN,
BTN2,
13,
1,DOWN,
7,
2,DOWN,
FORWARD,
5,
1,FORWARD,
4,
2,BTN6,
FORWARD,
1,
1,BTN6,
6,
EOC,
EOD );
int i = -1, b, v;
int back = LEFT, forward = RIGHT;
int button_1, button_2, button_3, button_4, button_5;
int value_1, value_2, value_3, value_4, value_5;
int wait_time;
int switch;
int delay_t;
int RUMBLE_TYPE=RUMBLE_A;
int cancel;
int EndOfCombo;
int CanStart;

main {



// Determine Back and Forward
if(get_val(RIGHT) || get_val(MOVE_X) >= 30) {
back = LEFT; forward = RIGHT;
} else if(get_val(LEFT) || get_val(MOVE_X) <= -30) {
back = RIGHT; forward = LEFT;
}//----------------------------------------------



// If there is a combo to be executed
if(i >= 0 && delay_t<=0) {
// Execute the combo step-by-step
if(!combo_running(execute_step)) {
if(get_step_values()) {
if(wait_time == 0) {
combo_run(execute_step_no_wait);
} else {
combo_run(execute_step);
}
} else { // the combo finished
i = -1;
}
}

// RS X and Y are in rest - cancel the combo
if ( (abs(get_val(9)) <= 20 && abs(get_val(10)) <= 20) && (abs(get_val (11)) <= 20 && abs(get_val (12)) <= 20) && (!get_val(5) && !get_val(8))) {
i = -1;
combo_stop(execute_step);
}
//CANCEL ----------------------------------------------------------



// Make sure the user inputs does not interfere in the combo
set_val(BTN1 , 0);
set_val(BTN2 , 0);
set_val(BTN3 , 0);
set_val(BTN4 , 0);
set_val(BTN5 , 0);
set_val(BTN6 , 0);
set_val(BTN7 , 0);
set_val(BTN8 , 0);
set_val(UP , 0);
set_val(DOWN , 0);
set_val(LEFT , 0);
set_val(RIGHT , 0);
set_val(MOVE_X , 0);
set_val(MOVE_Y , 0);

// if no combo execute - look for combo activation
} else {
// EDIT THIS PART OF SCRIPT for combo run ---------------------------
//////////////////////////////////////////////////////////////////////////
// Right Stick RIGHT
if (get_val (9) >= 60) { //combo hitcon1
i = get_combo_index(hitcon1);
}
// Right Stick LEFT
if (get_val (9) <= -60) { //combo crush1
i = get_combo_index(crush1);
}
// Right Stick DOWN
if (get_val (10) >= 60) { //Combo pun1
i = get_combo_index(pun1);
}
// hold RS / R3
if (get_val (5)) { //Fatality 2
i = get_combo_index(ial);
}
// end editing here --------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////////////////////
}// <combo activation> end
}//<main> block end

// This combo will run a step with wait
combo execute_step {
set_buttons_values();
wait(wait_time);
set_buttons_values();
}

// This combo will run a step without wait
combo execute_step_no_wait {
set_buttons_values();
}


combo RUMBLE_NOTIFICATION {
set_rumble(RUMBLE_TYPE, 100);
wait(300);
reset_rumble ();
}

// Returns the starting index of a combo
function get_combo_index(combo_id) {
i = 0;
while(TRUE) {//-----------------------
v = dbyte(i);
if(v == combo_id) {
return(i + 1);
} else {//====================
while(v != EOC && v != EOD) {//#
i = i + 1;
v = dbyte(i);
}//#
if(v == EOD) break;
else i = i + 1;
}//=============================
}//-----------------------------------
return(-1);
}

// Set the buttons, values and wait time of a step
function get_step_values() {
b = dbyte(i); i = i + 1;
if(b > 5) return(FALSE);

if(b >= 1) {
button_1 = convert_back_forward(dbyte(i)); i = i + 1;
value_1 = 100;
} else { button_1 = -1; value_1 = 0; }

if(b >= 2) {
button_2 = convert_back_forward(dbyte(i)); i = i + 1;
value_2 = 100;
} else { button_2 = -1; value_2 = 0; }

if(b >= 3) {
button_3 = convert_back_forward(dbyte(i)); i = i + 1;
value_3 = 100;
} else { button_3 = -1; value_3 = 0; }

if(b >= 4) {
button_4 = convert_back_forward(dbyte(i)); i = i + 1;
value_4 = 100;
} else { button_4 = -1; value_4 = 0; }

if(b >= 5) {
button_5 = convert_back_forward(dbyte(i)); i = i + 1;
value_5 = 100;
} else { button_5 = -1; value_5 = 0; }

wait_time = dbyte(i); i = i + 1;
wait_time = (wait_time - 1) * 10;
if(wait_time < 0) wait_time = 0;

return(TRUE);
}

// If the step has FORWARD and BACK buttons, set the correct value.
function convert_back_forward(button) {
if(button == FORWARD) {
return(forward);
} else if(button == BACK) {
return(back);
}
return(button);
}

// Set the buttons and values, function used on the combos.
function set_buttons_values() {
if(button_1 != -1) set_val(button_1, value_1);
if(button_2 != -1) set_val(button_2, value_2);
if(button_3 != -1) set_val(button_3, value_3);
if(button_4 != -1) set_val(button_4, value_4);
if(button_5 != -1) set_val(button_5, value_5);
}




I guess I should have actually read all of your post before I threw that out there...doh :facepalm:. All that script does is look for input from the dpad and set it to zero. Now that I've actually read both of your posts....

Here's what's happening. This bit of code....

// Determine Back and Forward
if(get_val(RIGHT) || get_val(MOVE_X) >= 30) {
back = LEFT; forward = RIGHT;
}
else if(get_val(LEFT) || get_val(MOVE_X) <= -30) {
back = RIGHT; forward = LEFT;
}//----------------------------------------------

This is how it sets back & forward. That's how it able to work from both sides. If you're setting values in your combos to either Dpad LEFT or RIGHT, on the next iteration this code will pick up that value and think that the directional button is being pressed. Are you using the left joystick to move? Because as is, it is looking at both Left and Right on the DPAD and LX. It should be one or the other...not both.