Make "Change Battle Back" work mid-battle? Is this possible? [SOLVED]

Hello! I'm new to RPG Maker, and I tried to make my first enemy battle. I already had the background for the battle setup, but I wanted it to change mid-battle. I tried 'Change Battle Back' in battle event that triggers after 4 turns in the battle, but it doesn't seem to work. Is there any way to make it work?
yes, you'll need to use a script command to force update the background after the event command change battleback.

however I don't remember what that command was, Ace was too long ago for me.
yes, you'll need to use a script command to force update the background after the event command change battleback.

however I don't remember what that command was, Ace was too long ago for me.
I actually managed to find the scripts and how to do it
So I will leave solution here.
In the Script Editor between Materials and Main Process need to insert this code:

Code:
class Game_Interpreter

alias_method :command_283_orig_kal, :command_283
def command_283
command_283_orig_kal
if SceneManager.scene.is_a?(Scene_Battle)
scene = SceneManager.scene
scene.spriteset.dispose_battleback1
scene.spriteset.dispose_battleback2
scene.spriteset.create_battleback1
scene.spriteset.create_battleback2
end
end
end

class Scene_Battle
attr_reader :spriteset
end

Can be named as Change_Battleback or something like that.
Then in the Troops Battle Event need to put just this script:


Code:
spriteset = SceneManager.scene.instance_variable_get("@spriteset")
spriteset.dispose_battleback1
spriteset.dispose_battleback2
spriteset.create_battleback1
spriteset.create_battleback2

and after it insert the Change Battle Back and pick the one Battle Back that you want to change.

This only works in play testing of the whole game. The change of Battle Back won't show up in the Troops Battle Test.

Original thread: https://forums.rpgmakerweb.com/threads/make-change-battle-back-work-mid-battle-is-this-possible-solved.177483/