Change battleback during battle

I've tried the usual Change Battleback command, and that didn't work.
Can this be done using event commands or will I need a snippet?

Thanks.
yes and no

the event command changes the setting for the map, that is why it doesn't work during battle.
However I once read a post here that there is a script command to force the battlescreen to update the battleback at any time from the then-current map setting.

So that way you'll need both - the event command to set the new battleback and the script command to force the update.

Unfortunately I don't remember the script command myself, but someone around here should be able to find the old post for it...
Searched. Found an Archeia post. I'll quote it:
Feb 12, 2014
There is a way. In troops tab:

Change Battleback to your desired graphic.

Script Call: SceneManager.scene.refresh_battleback

This will only work if you play in-game from Map -> Battle and not in test play.

Might as well try this?
@Faye Valentine Thank you very much for this. I'll test it as soon as I get home this evening.
Refresh battleback doesn't exist. Try this instead (which again, I'm too lazy to test)
Code:
spriteset = SceneManager.scene.instance_variable_get("@spriteset")
spriteset.dispose_battleback1
spriteset.dispose_battleback2
spriteset.create_battleback1
spriteset.create_battleback2
@TheoAllen: tested, it's not working. Tested under standard parameters (blank project)

Archeia script is working. Tested. Only in-game, though. Game crash on troops testing.
@TheoAllen and @Faye Valentine
I tried both ways.
With Archeia's method I got a crash with the error message
undefine method 'refresh battleback'

With TheoAllen's code in the script call, however, it worked like a charm.

Thank you both very much for your help with this.
I shall keep the thread open for a little while in case some oddity creeps out of the woodwork, but I'm hopeful that all will now be well.
@Kes: wow funny thing. I tested it in a blank project, but straight on the game and it showed no crash message whereas theo's crashed, both in-game and on troops tab. Well, glad you found a working solution, mate.
@Faye Valentine I was going to reply u that I don't believe, but it's Kes that has the problem so I shrugged in the end.
What was the crash though? Those are really default script function, while "refresh_battleback" was never in default script.
It's funny it's working in your side actually.
Using @TheoAllen 's code I got a script to work.
Spoiler: Change Battleback by Spell
Ruby:
# Change Battle background with a spell
# Created by Roninator2
# Version 1.0
# free for commercial use

# How to use
# Name the graphic files whatever name you specify in the Filename below
# and numbered, with the second battleback with an a at the end.
# e.g.
# SpellBG1.png <- battleback 1
# SpellBG1a.png <- battleback 2
# SpellBG2.png <- battleback 1
# SpellBG2a.png <- battleback 2
# SpellBG3.png <- battleback 1
# SpellBG3a.png <- battleback 2

# files must be present even if they are empty
# then have the spell with the notetag <change_bbg: 1>

# it does not restore the original battleback if no battleback is
# setup before the battle starts. *You get the swirl image of the map.

module R2_change_bbg_by_skill
  Regex = /<change_bbg:[ ](\d+)>/i
  Filename = "SpellBG"
end

class Scene_Battle < Scene_Base
  alias r2_use_item_skill_bg    use_item
  def use_item
    r2_use_item_skill_bg
    item = @subject.current_action.item
    @setbg = false
    if item.is_a?(RPG::Skill) && item.note.split(/[\r\n]+/).each { |line|
      case line
      when R2_change_bbg_by_skill::Regex
        @bgnum = $1.to_i
        @setbg = true
      end
      }
    end
    if @original_bg1 == nil
      @original_bg1 = $game_map.battleback1_name
      @original_bg2 = $game_map.battleback2_name
    end
    if @setbg == true
      bbgimage = R2_change_bbg_by_skill::Filename.to_s
      spellbg1 = bbgimage.to_s + @bgnum.to_s
      spellbg2 = bbgimage.to_s + @bgnum.to_s + "a"
      Graphics.freeze
      $game_map.change_battleback(spellbg1, spellbg2)
      spriteset = SceneManager.scene.instance_variable_get("@spriteset")
      spriteset.dispose_battleback1
      spriteset.dispose_battleback2
      spriteset.create_battleback1
      spriteset.create_battleback2
      Graphics.transition(60)
    end
  end
  alias r2_terminate_bg   terminate
  def terminate
    r2_terminate_bg
    $game_map.change_battleback(@original_bg1, @original_bg2)
    @original_bg1 = nil
  end
end
Neither of your codes works.

The Archeia code says "refresh_battleback" is undefined. For Theo's code, "instance_variable_get" is undefined.

Are you using plugins to do this?
@Knight9910 without more information, I'm guessing you're using either MV or MZ. This was for none of them. It is for RPG Maker VXAce.
Necro-post notice: @Knight9910

Please start your own thread and give more details about your issue. Clearly you are not using the same engine, so this code will not work for you.

Original thread: https://forums.rpgmakerweb.com/threads/change-battleback-during-battle.102769/