Save-Point
ChangeBattleBack VX - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+--- Thread: ChangeBattleBack VX (/thread-8832.html)



ChangeBattleBack VX - kyonides - 10-24-2023

ChangeBattleBack VX

by Kyonides

Introduction

By default, VX has no direct way to let you change the battle background or floor during gameplay.
But don't worry about it! Winking I've got the right solution to your graphical issues.
It's very easy to use it indeed. Two Thumbs Up! 
Copy and paste it and then make 1 or 2 script calls BEFORE battle even begins and that's it, my friend! Grinning

Please read Book the embedded comments to learn all about those brand new script calls.

The Script

Code:
# * Change BattleBack VX * #
#   Scripter : Kyonides Arkanthes
#   2023-10-23

# This scriptlet allows you to manually change both the battleback and
# the battlefloor by using a script call BEFORE battle begins.

# - Change Battleback: Here's an Example:
# $game_temp.battleback = "WhyNotHAL-2000"

# - Change Battlefloor: Here's an Example:
# $game_temp.battlefloor = "YourBattleFloor"

class Game_Temp
  attr_accessor :battleback, :battlefloor
end

class Spriteset_Battle
  def create_battleback
    if $game_temp.battleback
      bitmap = Cache.picture($game_temp.battleback)
      $game_temp.battleback = nil
    else
      source = $game_temp.background_bitmap
      bitmap = Bitmap.new(640, 480)
      bitmap.stretch_blt(bitmap.rect, source, source.rect)
      bitmap.radial_blur(90, 12)
    end
    @battleback_sprite = Sprite.new(@viewport1)
    @battleback_sprite.bitmap = bitmap
    @battleback_sprite.ox = 320
    @battleback_sprite.oy = 240
    @battleback_sprite.x = 272
    @battleback_sprite.y = 176
    @battleback_sprite.wave_amp = 8
    @battleback_sprite.wave_length = 240
    @battleback_sprite.wave_speed = 120
  end

  def create_battlefloor
    @battlefloor_sprite = Sprite.new(@viewport1)
    if $game_temp.battlefloor
      @battlefloor_sprite.bitmap = Cache.picture($game_temp.battlefloor)
      $game_temp.battlefloor = nil
    else
      @battlefloor_sprite.bitmap = Cache.system("BattleFloor")
    end
    @battlefloor_sprite.x = 0
    @battlefloor_sprite.y = 192
    @battlefloor_sprite.z = 1
    @battlefloor_sprite.opacity = 128
  end
end

Terms & Conditions

Free for use in ANY game. Gamer
That's it! Tongue sticking out