How do I detect if certain music is playing by script?

GamoupIndustries

Villager
Member
Joined
May 25, 2021
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMVXA
I'm using VX Ace and when I run the following script:
Ruby:
if (AudioManager._currentBgm.name != "Dungeon4")
    Audio.bgm.play("Dungeon4");
It shows an error.
So how do I fix the script?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,699
Reaction score
2,800
First Language
English
Primarily Uses
RMMZ
What's the error?

Wait, AudioManager doesn't exist in VX Ace. The module is Sound, but I'm not sure it can have its currently-playing BGM checked like that. Let me have a look.

Edit: Got it.

if (RPG::BGM.last.name != "Dungeon4")
 
Last edited:

GamoupIndustries

Villager
Member
Joined
May 25, 2021
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMVXA
But how do I change the volume and pitch?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,279
Reaction score
8,361
First Language
German
Primarily Uses
RMMV
nothing in your original post said anything about volume or pitch.

I suggest you give us a full description of what you want to do (instead of questions about tiny steps of how you want to do the unknownwhat), and then we can point you to how it is best done - scripts are not always the best solution for example.
 

GamoupIndustries

Villager
Member
Joined
May 25, 2021
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Conditional Branch: If RPG::BGM.last.name != "Field3"
Conditional Branch: If Ship is Driven
Play BGM: "Ship", 105, 100
Else
Play BGM: "Field3", 105, 100
Branch End
Branch End
 

Latest Threads

Latest Posts

Latest Profile Posts

Feel free to check out our "Touch the Stars" gamejam submission, "Starlight, Starbright!"
just finished playing one shot. im kinda disappointed with return the sun ending ngl. i was hoping there would be some after credits scene that would play with my emotions
So apparently the surprise Google Search page browser game saves your progress when you close the browser.

This really makes me miss the golden age of Flash gaming.
ohh man im ending oneshot now (im doing the last stepping puzzle rn) and the music is so...sad...like...ive been thinking recently about how fast moments pass and...my anxious thoughts combined with that music and nostalgia...like...im comfortably sad...and want to cry internally
We're playing one of the Touch the Stars game jam entries, come join us!

Forum statistics

Threads
113,552
Messages
1,075,790
Members
147,551
Latest member
ananansy
Top