I was trying to shuffle the contents of a range of variables, but couldn't figure out how, so I asked for help.
Night5h4d3 took the call, and progress was made toward the goal.
After posting back and forth, the problem was resolved, and my variables were successfully scrambled about.
END RESULT:
CODE
temp1 = []
temp2 = []
for i in 1..100
temp1[i-1] = $game_variables[i]
end
temp2 = temp1.sort_by {rand}
for i in 0..temp2.size
$game_variables[i+1] = temp2[i]
end
temp2 = []
for i in 1..100
temp1[i-1] = $game_variables[i]
end
temp2 = temp1.sort_by {rand}
for i in 0..temp2.size
$game_variables[i+1] = temp2[i]
end
USAGE:
In your event, use the "Script..." command, copy/paste the above code,
then change "1..100" to whatever range of variables you want to shuffle.
(also, if you use this, you should probably credit Night5h4d3, it's only fair)
THANKS to Night5h4d3
for taking such a strange and badly-explained request, and for being patient with me until the problem was resolved.
ORIGINAL POST

