State Removal Turns Switch Off?

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
Hi all,

So I have a bard class that sings songs to buff the entire party. Only one song can be active at any time and starting a new song ends the previous song. Each song has a state assigned to it and each state lasts 3 turns. Each song also changes the background music accordingly. This is done using call common event when each song skill is used. The problem is when the state is removed it does not change the music back to the original music.

My idea was for when the state is removed that it would switch the called common event off. However I have found no way of doing this. Perhaps their is a plugin or some script. Maybe this can all be done using Troop Events instead, though that sounds tedious.

I am using Yanfly Plugins including Buff State Core. I know there is a note tag as follows:

<Custom Remove Effect>
code
code
</Custom Remove Effect>

However I'm not sure what code to put their or if it's even possible to turn a common event off in this way. So anyone have any ideas or suggestions??? All is welcomed and appreciated.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,096
First Language
English
Primarily Uses
RMMV
1.) What do you mean by "switch the called common event off" ? Is your Common Event running with a trigger of Parallel? (perhaps a screenshot of the common event would help).

2.) If you're running a parallel Common Event, I would suggest an alternative. Each song has its own Common Event, plus one for the original song.

Each of these Common Events would have a trigger of "None" (because they are triggered by the skills, it's not running all the time) and would change the BGM to the corresponding music.

Each state would have this "remove effect".
Code:
<Custom Remove Effect>
$gameTemp.reserveCommonEvent(X);
</Custom Remove Effect>
Where X is the # of the Common Event that changes the BGM back to normal.
 

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
1.) What do you mean by "switch the called common event off" ? Is your Common Event running with a trigger of Parallel? (perhaps a screenshot of the common event would help).

2.) If you're running a parallel Common Event, I would suggest an alternative. Each song has its own Common Event, plus one for the original song.

Each of these Common Events would have a trigger of "None" (because they are triggered by the skills, it's not running all the time) and would change the BGM to the corresponding music.

Each state would have this "remove effect".
Code:
<Custom Remove Effect>
$gameTemp.reserveCommonEvent(X);
</Custom Remove Effect>
Where X is the # of the Common Event that changes the BGM back to normal.
I was actually using Autorun so I'm glad you said something about the trigger and each song will have it's own common event. I've never seen a note tag that effected a common event. Will the Custom Remove Effect note tag work with common events? If it does that is great!
 

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
I was going to try this next but I'm not good with variables yet, and by switch the common event off I had meant turn the event's switch off. Also thanks for the quick response!
 

Attachments

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
Also what if I wanted to use different Background Music for different encounters? How would I input that into the common event and note tag? I was hoping just to turn off the on switch on each common event, and hoped that would allow the music to return to normal.
 
Last edited:

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,096
First Language
English
Primarily Uses
RMMV
I guess some of this depends on how you have the whole thing set up. For example, in the screenshot of your common event, I don't really understand what the variable counting to 3 is for. Does the state stack? Or are you counting the turns until it expires?

If you're just wanting the state to expire after X turns, that's done on the State itself by setting the "Duration in Turns".

Anyways to set the music back to normal, you first need to save it by using the "Save BGM" Event Command. It would make sense to do this on Turn 0 (before the battle starts) in a Troop Event. To save yourself the hassle of copy/pasting it to every single troop event, you can use YEP Base Troop Event.

Then in your Common Event that runs upon State Removal, you use the "Replay BGM" event command.
 

Yawgmoth

Veteran
Veteran
Joined
Jan 9, 2018
Messages
138
Reaction score
11
First Language
English
Primarily Uses
RMMV
I guess some of this depends on how you have the whole thing set up. For example, in the screenshot of your common event, I don't really understand what the variable counting to 3 is for. Does the state stack? Or are you counting the turns until it expires?

If you're just wanting the state to expire after X turns, that's done on the State itself by setting the "Duration in Turns".

Anyways to set the music back to normal, you first need to save it by using the "Save BGM" Event Command. It would make sense to do this on Turn 0 (before the battle starts) in a Troop Event. To save yourself the hassle of copy/pasting it to every single troop event, you can use YEP Base Troop Event.

Then in your Common Event that runs upon State Removal, you use the "Replay BGM" event command.
Yeah I tossed my common event out. The variable was for turns. Anyways I think I can definitely set this up now. I came up with a slightly different solution in the following screen shots. I may still need "Save BGM" function though as I was going to wait till tomorrow morning to test it out. Thank you for helping so much! Please let me know if you think my alterations will work, if not I try your suggestions above.
 

Attachments

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Husband has roped me into playing one of his PSO2 characters. Productivity is now negative.
Tileset A is lava! Don't burn D:
as MZ come out what you guys think about.....Some particles engine :3c?
Who wants to sing this song with me?~

Decided to submit my games to the Monday Night Stream. Figured it might be a fun way to get some traction.

Forum statistics

Threads
100,704
Messages
978,547
Members
132,320
Latest member
LavaWave
Top