I'm looking to add a script call that can take a list of existing game variables and sort them in order from highest to lowest. I'm not too familiar with how to do this in RPG Maker MV. Here's my noob attempt, but it's obviously wrong:
I'm curious how I might actually do this properly so that I can save out the ordered values from the array into new variables.
Thanks!
-~-
Code:
var numbers = [$gameVariables.value(33),$gameVariables.value(37),$gameVariables.value(41),$gameVariables.value(152);
numbers.sort();
$gameVariables.setValue(152) = numbers[0];
$gameVariables.setValue(153) = numbers[1];
$gameVariables.setValue(154) = numbers[2];
$gameVariables.setValue(155) = numbers[3];
I'm curious how I might actually do this properly so that I can save out the ordered values from the array into new variables.
Thanks!
-~-