Main Menu
  • Welcome to The RPG Maker Resource Kit.

How to make a script play the 1st music

Started by Polraudio, July 20, 2007, 10:34:30 PM

0 Members and 1 Guest are viewing this topic.

Polraudio

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

Kokowam

Couldn't you just do @one = "001-Battle01" in the beginning and then do Audio.bgm_play("Audio/BGM/" + @one, 100, 100) ?

tSwitch

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


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon