Trouble with Event Switches

I usually don't have trouble with using and modifying plug n play scripts, but this one has me pulling my hair out.


I'm trying to use a Battle BGM randomizer script, and I don't understand some of the language.


The script I'm using is here:

#==============================================================================


# Random Battle Themes


# Version: 1.0


# Author: DiamondandPlatinum3


# Date: July 23, 2012


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


# Description:


# This script allows you to play a random battle theme upon starting a


# battle, it can be turned off before a boss battle via switch so that


# the appropriate battle them still plays for them.


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


# Turn this switch on before a boss battle so that the


# music you actually want to play will play.


EVENT_SWITCH_ID = 10
 
The random tracks work fine, but I don't know what this means:


# Turn this switch on before a boss battle so that the


# music you actually want to play will play.


EVENT_SWITCH_ID = 10


I've tried script calls and comments before the Boss Battle, but I can't get this to work. Help?
This has nothing to do with script calls. You have to use an event command, the control switch command, to activate and deactivate the function.

And the ID of the switch you reserved for using this is the number you place in the line as the switch ID - in default the script would be conditioned on the switch with the number 10.

I suggest you read this tutorial on configuring scripts: How to use a script - RMVX Ace Tutorials - RPG Maker Forums

Pleas LINK to the script you have problems with, do NOT repost it here. I deleted the script from your post (especially as it isn't needed for such a basic problem)
Thank you for your quick reply and link.

Let me see if I understand:

So I put the script in my script list, (under Materials and above Main, of course) then create a switch, I'll name it 'Boss BGM', which is switch number 0048.

Next, I need to change the above script so it's EVENT_SWITCH_ID = 48  and in the battle trigger event, before I initiate the Boss Battle, turn on switch 48 and change Battle BGM to the boss' theme.

Then after the battle, I turn off switch 48, correct?
yes
It worked like a charm. Thanks again for your expertise, Andar.

Original thread: https://forums.rpgmakerweb.com/threads/trouble-with-event-switches.42103/