Wow,
I didn't know about the "max" command edit:Ok, N/M I see what you did there. That's awesome,
I'll test it out and see how it goes. thanks!
Edit: Ok, I tested it, it worked as great as expected. But it gave me the value that the variable held, not the variable ID number which is what I was aiming for.Here's what the code ended up looking like:
ids = [11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 26, 27,
28, 30]
max = $game_variables[ids.shift]
ids.each {|id|
if max < $game_variables[id]
max = $game_variables[id]
end}
$game_variables[31] = max
In my test, variable ID #28 ended up with the highest valued number at 7.
I tested the code by using a simple message that said "test \v[31]"
It said "test 7" rather than "test 31" as I hoped.
Is there a way to identify change the max variable to equal the variable ID # rather than it's value?
Edit: I'm pretty much a n00b with scripting, and this now seems to be moving on to a script request topic, but here is what I came up with, does it make any sense at all? (I tried to test it but it's too large to fit in the script call, and i'm not sure how to arrange it not to error in the script editor)ids = [11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 26, 27,
28, 30]
max = $game_variables[ids.shift]
ids.each {|id|
if max < $game_variables[id] &
max = $game_variables[11] : max = 11
elsif max = $game_variables[12] : max = 12
elsif max = $game_variables[13] : max = 13
elsif max = $game_variables[14] : max = 14
elsif max = $game_variables[15] : max = 15
elsif max = $game_variables[16] : max = 16
elsif max = $game_variables[17] : max = 17
elsif max = $game_variables[18] : max = 18
elsif max = $game_variables[19] : max = 19
elsif max = $game_variables[20] : max = 20
elsif max = $game_variables[21] : max = 21
elsif max = $game_variables[22] : max = 22
elsif max = $game_variables[23] : max = 23
elsif max = $game_variables[24] : max = 24
elsif max = $game_variables[26] : max = 26
elsif max = $game_variables[27] : max = 27
elsif max = $game_variables[28] : max = 28
elsif max = $game_variables[30] : max = 30
end}
$game_variables[31] = max