Hi, everyone. I am trying to see if there is a more efficient way of doing this. I hope am I giving sufficient information below.
First, I am using a script to create 81 arrays that are all the same. The array variables are 1401 - 1481. In the following script, variable 1386 starts off with a value of 1401 (for the first array). This seems to work fine and seems pretty efficient.
for (let i = 0; i < 81; i++) {
$gameVariables.setValue($gameVariables.value(1386), [1,2,3,4,5,6,7,8,9]);
($gameVariables.setValue(1386, $gameVariables.value(1386) +1));
}
Next, I'm getting a random number from 1 - 9 and using a script to remove it from the first array. Variable 1301 is the value of the random number. This also seems fine and pretty efficient.
const index = $gameVariables.value(1401).indexOf($gameVariables.value(1301));
const x = $gameVariables.value(1401).splice(index, 1);
Now, here is one big script that is removing the value of variable 1387 (which is the same as variable 1301) from a bunch of other arrays. The array variables are 1402 - 1412, 1419 - 1421, 1428, 1437, 1446, 1455, 1464, and 1473. So, I am using 3 separate for loops. This script works and removes the value from all necessary arrays. I'm just wondering if there is a more efficient way to do this part.
for (let i = 0; i < 11; i++) {
let index = $gameVariables.value($gameVariables.value(1386)).indexOf($gameVariables.value($gameVariables.value(1387)));
let x = $gameVariables.value($gameVariables.value(1386)).splice(index, 1);
($gameVariables.setValue(1386, $gameVariables.value(1386) +1));
} //This is for arrays 1402 - 1412
$gameVariables.setValue(1386, 1419); //This sets the variable for the array to 1419
for (let z = 0; z < 3; z++) {
index = $gameVariables.value($gameVariables.value(1386)).indexOf($gameVariables.value($gameVariables.value(1387)));
x = $gameVariables.value($gameVariables.value(1386)).splice(index, 1);
($gameVariables.setValue(1386, $gameVariables.value(1386) +1));
} //This is for arrays 1419 - 1421
$gameVariables.setValue(1386, 1428); //This sets the variable for the array to 1428
for (let y = 0; y < 6; y++) {
index = $gameVariables.value($gameVariables.value(1386)).indexOf($gameVariables.value($gameVariables.value(1387)));
x = $gameVariables.value($gameVariables.value(1386)).splice(index, 1);
($gameVariables.setValue(1386, $gameVariables.value(1386) +9));
} //This is for arrays 1428, 1437, 1446, 1455, 1464, and 1473
Any advice or suggestions are greatly appreciated!