Changing background and music mid fight for a few turns

I have been trying to make a skill that
  1. Changes the background in the middle of a fight
  2. Changes the song in the middle of a fight
  3. Buffs the character who used it
  4. Gives him a new move to use
  5. Ends at the end of a certain number of turns, changing back to the original background and music when it is done
So far I have managed to get everything from numbers 1-4 to work, but I can't get number 3 to work in its entirety. The buff ends, but everything else stays the same. The "buff" is actually a state I gave the character, but it works as intended. I would like very much to figure out how to change the background and music to what it once was once the move is over, I would also like if I could get the game to activate the move without saying "It had no effect on %1" (this is because there is technically no buff being applied to the character as rather it is a state that is being applied.

I would also like to mention that when I finally got the move to change the background it was because someone else had helped me by writing out the script I need to copy and past into the event page.
Welcome!

I can't get number 3 to work in its entirety.
...do you mean number 5? Number 3 is "buff the user."

I would like very much to figure out how to change the background and music to what it once was once the move is over
The same way you changed it in the first place, but using the filenames for the original stuff. We can't help you any further than that because you haven't shown us how you're doing anything now.

I would also like if I could get the game to activate the move without saying "It had no effect on %1" (this is because there is technically no buff being applied to the character as rather it is a state that is being applied.
You must be doing something incorrectly or be using a plugin that changes things. By default, if a skill has the Add State Effect, it will not display the "no effect" message.

So, basically, instead of just trying to describe everything with words, actually show screenshots of the skill and anything related to it.
1710122485048.png
1710122445827.png
So the first problem you addressed was that I said I can't get #3 to work fully, what I meant was I couldn't get it to not say that it had no effect. However that was because the skill itself did *not* apply the state and rather the state was applied in the common event, so that has been solved.

The issue *now* is that while it changes the map to what I have it set as I am unsure how I can change it back to what it was since the background environment will not always be the same. Im also unsure of how I can get it to change back after a set amount of turns, the state works fine but not the map or the music. Here are pictures of what I have right now, I again would like to state I didn't write the script.
Also I apologize, Im new to posting on forums in general.
You could do this with the engine, but it would be cumbersome. You'd add to the event setting a variable to 1. Then you'd put a troop event in every troop that checks for that variable to be > 0. If yes, increment the variable; then, if it's equal to the number of turns, set the variable to 0 and turn the background and music back.

The much simpler way is to use a plugin. My Eval Tags plugin (link in my signature) will work unless you're already using VisuStella plugins, in which case you can use their Skills and States.
Using my Eval Tags, you'd put this in the notes field of your Gale Buff state:
Code:
<State End Eval>
SceneManager._scene._spriteset._back1Sprite.bitmap = SceneManager._scene._spriteset._back1Sprite.battleback1Bitmap();
SceneManager._scene._spriteset._back1Sprite.bitmap = SceneManager._scene._spriteset._back1Sprite.battleback2Bitmap();
</State End Eval>
If I did the first method, how would I implement the troops to check for a variable? I could make it look for a switch in conditions, but then how would I make it count the turns? For the second option I went to your about page and saw your pulgins and snippets but the only things I found with the word "Eval" in it were yanfly plugins, were you talking about those? If so would I need both or just one? I apologize for my ignorance I am new to rpg maker
If I did the first method, how would I implement the troops to check for a variable?
1710182002595.png



I went to your about page and saw your pulgins and snippets but the only things I found with the word "Eval" in it were yanfly plugins, were you talking about those?
Did you look for the actual words I typed?

1710182069071.png
I didn't see that part... I thought it was just the spoilers... Sorry, and also thank you.
1710183763343.png
Im trying the cumbersome method first because usually thats the one that works, but Im not sure what Im doing wrong. Im not sure I fully understood your example, and at this point Im not sure how I managed to solve all my other problems on my own.
1 - per my original explanation, you need to make sure that variable is initialized (set to a non-0 value) before you start incrementing it.
Then you'd put a troop event in every troop that checks for that variable to be > 0. If yes, increment the variable; then, if it's equal to the number of turns, set the variable to 0 and turn the background and music back.

2 - Why are you incrementing the variable twice? That means (presuming you initialize it to 1), your stuff will expire after 2 turns.

3 - The Else branch looks correct, presuming you pasted in the code I gave you. I don't see any event command to change the music back, though.
1 - I have it set to initialize in the common event by having it set Gale Buff to 1

2 - I thought I would need it to be inside the if statement for it to count

3 - Im focusing on getting the map to switch back correctly before I do anything else

If I have it set to "If : Gale buff<= 4" it wont swap back and if I have it set to "If : Gale buff = 4" or "If : Gale buff >= 4" it swaps it back immediately. So I am still unsure of what I am doing wrong.
1710190092028.png
1710190127571.png
Hey man, if you see this I just wanna say thank you for your help and that I apologize for being so oblivious to the fact that I had the span set to "Battle" and not "Turn", so when I found out that it does in fact work as intended I decided to implement this code
<State End Eval>
SceneManager._scene._spriteset._back1Sprite.bitmap = SceneManager._scene._spriteset._back1Sprite.battleback1Bitmap();
SceneManager._scene._spriteset._back1Sprite.bitmap = SceneManager._scene._spriteset._back1Sprite.battleback2Bitmap();
</State End Eval>
and it appears to almost work, however now when the map turns back the smoke effect is there and somehow overlaying the grassmaze back and the floor is just gone. When put into the notes of the Gale Buff state it does nothing.
1710257321732.png

If I need to manually switch it back to the map you would fight those enemies at I could honestly deal with it, you have been such a major help already. I apologize for my lack of ability to read. Also how would I swap the music back with a script?
Also how would I swap the music back with a script?
Presumably the same way you changed it in the first place. Hopefully you saved the original music in a variable or have some other way to access that data.
the floor is just gone.
There's a typo in my code above - it references back1sprite.bitmap on both lines. Change the second line to back2sprite.

Also how would I swap the music back with a script?
Why would you need a script? Just use the same Change BGM event command you used the first time and put it back to your default battle music.
Presumably the same way you changed it in the first place. Hopefully you saved the original music in a variable or have some other way to access that data.
I just used the engine, page 2 of the event commands. No script was written for it.
I just used the engine, page 2 of the event commands. No script was written for it.
I didn't say you had to use a script, but the engine commands are basically scripts with a coat of paint.

Original thread: https://forums.rpgmakerweb.com/threads/changing-background-and-music-mid-fight-for-a-few-turns.166680/