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.
spriteset = SceneManager.scene.instance_variable_get("@spriteset")
spriteset.dispose_battleback1
spriteset.dispose_battleback2
spriteset.create_battleback1
spriteset.create_battleback2
# 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
@Knight9910 , please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.