What I'm trying to do, is create a list of the music files in a certain folder so the player can pick one to play during battle. Sounds easy right? However, I don't know what files are in this folder because I want the player to put some of their songs in there.
So for this, I'm editing xLeD's Jukebox Script, which was probably not the best choice.
At the moment, this is the part I'm working on.
The script is designed so that the default songs are set up and can't be changed. What I need to do is change these so that it returns the filenames of whatever's in the folder.
So I found this in the help section:
This returns a filename, the problem is you have to actually the type the filename into the script to get the filename. Which is pretty much useless.
So, is there something I can add to that code so it returns the name just based on a directory and a number. So... first file from music folder, or second file or whatever?
So for this, I'm editing xLeD's Jukebox Script, which was probably not the best choice.
At the moment, this is the part I'm working on.
Code:
s1 = "Song 1"
s2 = "Song 2"
s3 = "Song 3"
s4 = "Song 4"
s5 = "Song 5"
s6 = "Back"
The script is designed so that the default songs are set up and can't be changed. What I need to do is change these so that it returns the filenames of whatever's in the folder.
So I found this in the help section:
Code:
File.basename(filename[, suffix])
So, is there something I can add to that code so it returns the name just based on a directory and a number. So... first file from music folder, or second file or whatever?