Change music and battle background during a fight

Once the enemy reaches 50 percent or less HP, he transforms. That works. But the battlebackground and the music don't change. What am I doing wrong please?
1649817249492.png
you're changing the map attributes for BGM and picture
those are not directly the values used in the current battle

there is a script command that forces the battlescreen to update this from the map data, but I don't have that ready, you'll have to wait until someone else posts it.
Once the enemy reaches 50 percent or less HP, he transforms. That works. But the battlebackground and the music don't change. What am I doing wrong please?
there is a script command that forces the battlescreen to update this from the map data, but I don't have that ready, you'll have to wait until someone else posts it.

Yep as @Andar mentioned... script call is needed for that..
sooo umm... tada ☺️
here ya go:
JavaScript:
BattleManager.playBattleBgm();
const spriteset = SceneManager._scene._spriteset;
spriteset._back1Sprite.bitmap = spriteset.battleback1Bitmap();
spriteset._back2Sprite.bitmap = spriteset.battleback2Bitmap();

setup like this:
Spoiler
1649824477659.png
That'll do it for ya 🙂
Also note you will want the span set to "battle" ...since the condition is the Enemy HP is 50% or less
Leaving it set to "turn" will run this constantly every turn as long as the Enemy is at 50% HP or less
With the span instead set to "battle" it will only run once during the battle, as to not jam up the battle

and it should also be noted..
that way of doing it will probably not quite create the desired outcome still since it will permanently change the battle bgm and battle back for future battles even after defeating or escaping the enemy.
Again as @Andar mentioned above it's actually changing the map attributes for BGM and battle back pictures not just the ones for the current battle

Soooo...
if you only want a temporary change until the battle is over you would want to do something like this:
Spoiler
1649824887938.png
Just use the "Play BGM" command and then using the following script instead to change the battleback just for the current battle:
JavaScript:
const spriteset = SceneManager._scene._spriteset;
spriteset._back1Sprite.bitmap = ImageManager.loadBattleback1('1DemonicWorld');
spriteset._back2Sprite.bitmap = ImageManager.loadBattleback2('1DemonicWorld');

That should do it as needed for ya. 😉
Let me know how it goes and if that solves it all for ya :popcorn:
Much appreciated, I wouldn't have thought about that, thanks!
Much appreciated, I wouldn't have thought about that, thanks!
Very welcome. Glad to help out ☺️
I like your idea for the enemy transformation battle also. Very cool. :LZSgrin:

Happy Game Making! ☺️

Original thread: https://forums.rpgmakerweb.com/threads/change-music-and-battle-background-during-a-fight.146709/