coyotte508/rpg-scripts — pull request #4 by CrystalMoogle (2012-11-28 22:43:03+00:00)
Title: Level up moves script+data

I used the info file you mentioned in #1 and cut it down to just B/W2 level up moves (or so I hope!)

The script itself converts the CSV file into a javascript object which really is quite easy to use :x. Advantage of doing it this way is if you ever make a way to edit the moves from within the scripts, you can easily save it as JSON file instead. Just to note, the JSON version of the CSV is about ~105kb compared to the CSV which is ~160 (though a little more compression could probably fix that), but I wasn't sure if using JSON for the data would be better than CSV. I find JSON easier to read/edit than CSV, but well it's up to you I guess, I kept it as CSV for the time being.

levelupMovesAt returns either a string (No moves or 1 move) or an array (multiple moves), I guess it's possible to convert the array into a string into that function, or make the function requesting the data sort it there. levelupMoves returns an array of moves the pokemon learns through level up, though the order is off, so we could either add a sort there or make the function requesting the data sort it as it receives it, I dunno which would be better of the two (I guess the former if a lot of functions are going to be request it).

Order was kind of a tricky part (moves that share a level), but I think I managed it well enough. I've tested this already and it -seemed- to work fine, but I miss obvious things a lot so verification might be needed :x. Feel free to decline, say it sucks etc!
I would have done the other stuff, but I didn't want to start them unless you were happy with this format first, I find it easy enough, but you might have something better in mind :x

I think that's everything I wanted to say about it :x