This is such an elegant solution,
man I need to take the time to learn how to script. It's hard for me to *think* in the way that a scripter/programmer thinks.
I used to use Qbasic back in the day, and in that language I would have solved this as:
FOR i = 1 to 10
IF $game_player.skill_hotkeys[i] = 0 THEN
$game_player.skill_hotkeys[i] = Skill_ID
BREAK
END IF
NEXT i
The thing that has me confused, is in the second line of your script, you use [i
%10]
The script works great, but I don't understand why it needs the modulus operator (%). Why couldn't you just use this script:
for i in 1..10
if $game_player.skill_hotkeys[i] <= 0
$game_player.skill_hotkeys[i] = SKILL_ID
break
end
end
I'm sure the answer is simple; but like I said, my brain doesn't work like a programmer's.