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,711
Reaction score
2,822
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,371
Reaction score
8,392
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

Finally, deleted my Reddit account
I cant say I dont regret it, I honestly liked FMA subreddit, but nah, reddit succs
Ami
need a time to not open my MV,still addicted with new vegas

i wonder what addiction effect behind playing new vegas too much,maybe INT & Science gone worse in many days :D
cdjensen94 wrote on Kaliya's profile.
Are you the one who develops Kaliya's Visual Map Enhancements. If so I desperately need some help. I bought the plugin back a few months. I've only started using it recently.
Cause MP Damage instead of HP, Localization Plugin for Translation | RPG Maker News #112

Here in Fla were are seeing crazy covid spikes and some vaccinated getting bad infections. I had a mild fever on Thurs but it went down fast. How is everyone else doing. Hopefully you are all well. :)

Forum statistics

Threads
113,833
Messages
1,077,788
Members
147,892
Latest member
rosefinch
Top