Mad wrote:Doxy wrote:Quick question. Is there a way to randomize a script? For example: I press a button and a random script from a list of scripts will be executed.
Thanks.
You can use the irand function
- Code: Select all
int x;
main {
if(event_press(XB1_UP)) x = irand(1,5);
if(x == 1) { } // do stuff
else if(x == 2) { } //do other stuff
}
https://www.consoletuner.com/kbase/math ... .htm#irand
Thanks for the reply. I'm currently using a Titan one converted script. Is there a T1 version of this? Also, on a separate issue - I'm approaching file size limits on a few scripts, is there any creative ways I can reduce the size or expand over multiple scripts?
Edit:
So, it works with T1. Though I'm running into issues. This is what the code looks like.
- Code: Select all
if (event_press(PS4_TOUCH))x = irand(1,4);{
combo_stop(c_BDash1);
combo_stop(c_BDash);
combo_stop(c_Tap_11);
combo_stop(c_SSUP);
combo_stop(c_SSDOWN);
if(x == 1) {
combo_run(GiantSWING);
}
else if(x == 2) {
combo_run(Tombstone);
}
else if(x == 3){
combo_run(GS2);
}
else if(x == 4){
combo_run(Muscle);
}
It seems to loop the same throw over and over again and doesn't cancel on itself. The idea is to cancel whatever script is running, without having to paste the same combo_stop due to file size limitaiton that I'm already suffering from.
Any help would be grateful.