Been using RPG maker for a while, but let's just saying JS isn't quite my forte.
In any case, what would be the best method to look a batch of variables. and return the highest variable?
for example I have 3 variables. 1,2,3 with respective values of 5,8,2,
What would be the best method of indexing this variable and storing it to a new variable?
I think it would have something to do with math.max but again. JS isn't my strong suit.
Been stumped on this all day. any advice is appreciated.
FAST EDIT
I found this snippet for @Sumrnddde but again. My JS is terrible so if someone can explain if this is in the right direction.
var maxValue = 0;for(i = 197; i < 200; i++){ if($gameVariables.value(i) > maxValue) { maxValue = $gameValue.value(i); $gameVariables.setValue(6, i); }}
In any case, what would be the best method to look a batch of variables. and return the highest variable?
for example I have 3 variables. 1,2,3 with respective values of 5,8,2,
What would be the best method of indexing this variable and storing it to a new variable?
I think it would have something to do with math.max but again. JS isn't my strong suit.
Been stumped on this all day. any advice is appreciated.
FAST EDIT
I found this snippet for @Sumrnddde but again. My JS is terrible so if someone can explain if this is in the right direction.
var maxValue = 0;for(i = 197; i < 200; i++){ if($gameVariables.value(i) > maxValue) { maxValue = $gameValue.value(i); $gameVariables.setValue(6, i); }}
