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,707
Reaction score
2,808
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,325
Reaction score
8,383
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

Sometimes a mechanic that is meant to add challenge is just annoying. Even the Final Fantasy games did not completely escape this pitfall of design. (FF8 draw system I'm looking at you - grrrr)
starting working on the sprites for one of my games major antagonists finally. here's the first frame of his chanting motion in battle.
Have spent too much time hammering out with a friend just how to make a reoccurring enemy that permanently learns skills you use against her.
I know what I want in a loose sense. Maybe I should just make a post asking for opinions and suggestions.
Shoot Enemy Off-Screen, Run RPG Maker Game as a Web Server, & Thai Keyboard | RPG Maker News #109

Forum statistics

Threads
113,734
Messages
1,077,036
Members
147,762
Latest member
Bad_At_Scripting
Top