Evening guys,i making a a generator for assigning matches for each team,long story short,this was supposed to be the final part of completing it,i made some lines of code,i spend more than 4 hours,andi just can't figured out why the life of me the result of this,i narrow down the issue and is the code i'm having problem with:
◆Script:$gameVariables.setValue(14, [1, 2, 3]);
◆Script:$gameVariables.setValue(16, $gameVariables.value(14)[1]);
◆Script:$gameVariables.value(14)[1] = $gameVariables.value(14)[2];
◆Script:$gameVariables.value(14)[2] = $gameVariables.value(16);
◆Script:$gameVariables.setValue(61, $gameVariables.value(14));
◆Comment:stop
◆Script:$gameVariables.setValue(16, $gameVariables.value(14)[1]);
◆Script:$gameVariables.value(14)[1] = $gameVariables.value(14)[2];
◆Script:$gameVariables.value(14)[2] = $gameVariables.value(16);
◆Script:$gameVariables.setValue(62, $gameVariables.value(14));
so i made an array in variables 14,as you can see,before the comment "stop",array 14 will be assign to array 61 which is (1,3,2),when i execute the code before the stop comment,there's no issue,
but execute as a whole,then that's the problem,the 2nd one is true,variable 14 return (1,2,3) and yes just like the code intended,but,when opening console log(not sure what it's named) by pressing F9,both variable 61and 62 are (1,2,3) ,any last variable will replace all the previous assign variable,let add another one on above
◆Script:$gameVariables.setValue(14, [1, 2, 3]);
◆Script:$gameVariables.setValue(16, $gameVariables.value(14)[1]);
◆Script:$gameVariables.value(14)[1] = $gameVariables.value(14)[2];
◆Script:$gameVariables.value(14)[2] = $gameVariables.value(16);
◆Script:$gameVariables.setValue(61, $gameVariables.value(14));
◆Comment:stop
◆Script:$gameVariables.setValue(16, $gameVariables.value(14)[1]);
◆Script:$gameVariables.value(14)[1] = $gameVariables.value(14)[2];
◆Script:$gameVariables.value(14)[2] = $gameVariables.value(16);
◆Script:$gameVariables.setValue(62, $gameVariables.value(14));
◆Comment:stop
◆Script:$gameVariables.setValue(16, $gameVariables.value(14)[1]);
◆Script:$gameVariables.value(14)[1] = $gameVariables.value(14)[2];
◆Script:$gameVariables.value(14)[2] = $gameVariables.value(16);
◆Script:$gameVariables.setValue(63, $gameVariables.value(14));
now i'm assign into 3 variables,which is 61,62,63
at variable 61,the value of variable 14 is (1,3,2) = variable 61 is now (1,3,2)
at variable 62,the value of variable 14 is (1,2,3) = problem is both variable 61 and 62 is (1,2,3) despite i did not assign it to variable 62
at variable 63,the value of variable 14 is (1,3,2) = now all 3 variable ,variable 61,variable 62, and variable 63 has same value (1,3,2) and not just variable 63
what am i doing it wrong,if this is indeed a bug,then i'm really am screwed,this is the last step for me to finish creating league table for sports,if anyone have better code or find flaws on the code above,that would really really helps me a lot.I will reply as soon as i can get since i might be at work.