The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Polraudio on July 20, 2007, 10:34:30 PM

Title: How to make a script play the 1st music
Post by: Polraudio on July 20, 2007, 10:34:30 PM
ok here is what i have
Audio.bgm_play("Audio/BGM/" + "001-Battle01", 100, 100)
i want it to play the 1st BGM. what im trying to say is there a way i can just put "1" instead of typing "001-Battle01" to play the 1st BGM.

need more info just ask
Title: Re: How to make a script play the 1st music
Post by: Kokowam on July 20, 2007, 11:24:54 PM
Couldn't you just do @one = "001-Battle01" in the beginning and then do Audio.bgm_play("Audio/BGM/" + @one, 100, 100) ?
Title: Re: How to make a script play the 1st music
Post by: tSwitch on July 21, 2007, 02:24:43 AM
yes you could
but that would create an extra line of needless code
I'm pretty sure that you need to type the name.
if you need to sort through several tracks, then I'd use an array of all their names
and it would look like

@songs = ["001-Whatever", etc...]
then
Audio.bgm_play("Audio/BGM/" + @songs[i], 100, 100)
where i is the index in the array that you want to play

actually, if you're only looking to play one you can just type in
Audio.bgm_play("Audio/BGM/001-Whatever",100,100)
if I'm not mistaken