GPC SCRIPT LIBRARY

Example - Making combos using arrays ( With hold times )

( For this example tap left too activate the combo )

It can be helpful to make combos using arrays, it allows you too change parts of the combos while running. this script could also be adapted too allow people too "record" a combo...

I designed this too navigate the inventory in worms battlegrounds.

-if using for something where you only require the buttons to be held for the same amount of time, you can shorten this script by removing the hold time array ( http://cronusmax.com/gpclib/?s=1486 )
Version 1.0
Author ItsCliPzZ
Published Date 2015-08-09 08:37:12
Latest Date 2015-08-09 08:37:12
Downloads 19
VOTE NOW

1

0
Contact Author
Scripts by Author
RELEASE NOTES
-CliPzZ
Code:Select all
//--- [ Menu_Navigation/Men_Nav_With_Holdtimes! ] - / - (  VARS )  ------! [BELOW] 
define NAVIGATION_HOLDTIME=200;
define NAVIGATION_RELEASETIME=100;
//--- [ Menu_Navigation/Men_Nav_With_Holdtimes! ] - / - (  VARS )  ------! [ABOVE] 
//--- [ Menu_Navigation/Men_Nav_Activate_Button ] - / - (  VARS )  ------! [BELOW] 
define NAV_ACTIVATE_BTN=XB1_LEFT;
//--- [ Menu_Navigation/Men_Nav_Activate_Button ] - / - (  VARS )  ------! [ABOVE] 
//--- [ Menu_Navigation/Men_Nav_With_Holdtimes! ] - / - (  VARS )  ------! [BELOW] 
int menu_array_index=0; //current index
int menu_array_one[15];//menu nav array
int menu_array_one_htime[15];//menu nav array
int menu_combo_one_desired=FALSE;
int menu_array_action=0;
int menu_array_htime=0;
//--- [ Menu_Navigation/Men_Nav_With_Holdtimes! ] - / - (  VARS )  ------! [ABOVE] 

int cro_mods_disabled=FALSE;
init {
//--- [ Menu_Navigation/Men_Nav_With_Holdtimes! ] - / - (  Setup )  ------! [BELOW] 
menu_array_one[1]=XB1_UP;
menu_array_one_htime[1]=300;
menu_array_one[2]=XB1_LEFT;
menu_array_one_htime[2]=100;
menu_array_one[3]=XB1_UP;
menu_array_one_htime[3]=300;
menu_array_one[4]=XB1_LEFT;
menu_array_one_htime[4]=1000;
menu_array_one[5]=XB1_UP;
menu_array_one_htime[1]=70;
menu_array_one[6]=XB1_LEFT;
menu_array_one_htime[6]=70;
menu_array_one[7]=XB1_UP;
menu_array_one_htime[7]=170;
menu_array_one[8]=XB1_UP;
menu_array_one_htime[8]=170;
//--- [ Menu_Navigation/Men_Nav_With_Holdtimes! ] - / - (  Setup   )  ------! [ABOVE] 

}
main { 

if(cro_mods_disabled==TRUE){

} else { 
//--- [ Menu_Navigation/Men_Nav_With_Holdtimes! ] - / - (  Main )  ------! [BELOW] 
if(combo_running(NAV_DONAV) ) {
//We are playing a navigation combo
} else {
if(menu_combo_one_desired==TRUE) {
menu_array_index=menu_array_index + 1;
if(menu_array_one[menu_array_index]!=FALSE) {
menu_array_action=menu_array_one[menu_array_index];
menu_array_htime=menu_array_one_htime[menu_array_index];
combo_run(NAV_DONAV);
} else {
menu_array_index=0;
menu_combo_one_desired=FALSE;
} 
}
}
//--- [ Menu_Navigation/Men_Nav_With_Holdtimes! ] - / - (  Main   )  ------! [ABOVE] 
//--- [ Menu_Navigation/Men_Nav_Activate_Button ] - / - (  Main )  ------! [BELOW] 
if (event_release(NAV_ACTIVATE_BTN)) {
menu_combo_one_desired=TRUE;
}
//--- [ Menu_Navigation/Men_Nav_Activate_Button ] - / - (  Main   )  ------! [ABOVE] 

}
}
//--- [ Menu_Navigation/Men_Nav_With_Holdtimes! ] - / - (  Combos )  ------! [BELOW] 
 combo NAV_DONAV{
     set_val(menu_array_action,100);
     wait(menu_array_htime);
     set_val(menu_array_action, 0);
     wait(NAVIGATION_RELEASETIME);
     set_val(menu_array_action, 0);
 }
//--- [ Menu_Navigation/Men_Nav_With_Holdtimes! ] - / - (  Combos   )  ------! [ABOVE] 


Pin It on Pinterest

Share This