Help - Search - Members - Calendar
Full Version: Battle Backgrounds
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS2-Submissions
Wellus
Rpg Maker Vx

Claimh (English Translation By: Elemental Crisis)
Version: 1.0.0
Number Of Scripts: 1


This script simply takes a picture of your hero's current location & puts it in the background

Under Materials you have to make a new file called Battle Backgrounds.
then past this script into it.
Simple instructions but you have to follow them exactly.
Enjoy!

Script
CODE
#------------------------------------------------------------------------------
# English Translation By: Elemental Crisis
#------------------------------------------------------------------------------
# Changes the battle background.
#==============================================================================

module BattleBack
# Select Battle Background Type
# 0:Current map with wave effect for battle background (Default VX Style).
# 1:Current map used as battle background.
# 2:Uses a picture for battle background.
BB_TYPE = 1

# Display Battle Floor
BT_FLOOR = false

# Picture (Only required if BB_TYPE = 2)
M_B_BACK = {
# All picture files must be in the Graphics/System folder.
# Map ID => "Picture File Name"
1 => "SnowCliff1"
}
end


#==============================================================================
# ■ Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● Creating Battle Back Sprite
#--------------------------------------------------------------------------
def create_battleback
case BattleBack::BB_TYPE
when 0
source = $game_temp.background_bitmap
bitmap = Bitmap.new(640, 480)
bitmap.stretch_blt(bitmap.rect, source, source.rect)
bitmap.radial_blur(90, 12)
@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
when 1
source = $game_temp.background_bitmap
bitmap = Bitmap.new(640, 480)
bitmap.stretch_blt(bitmap.rect, source, source.rect)
@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
when 2
@battleback_sprite = BattleBackSprite.new(@viewport1)
end
end
#--------------------------------------------------------------------------
# ● Creating Battle Floor Sprite
#--------------------------------------------------------------------------
alias create_battlefloor_mbb create_battlefloor
def create_battlefloor
create_battlefloor_mbb if BattleBack::BT_FLOOR
end
#--------------------------------------------------------------------------
# ● Delete Battle Floor Sprite
#--------------------------------------------------------------------------
alias dispose_battlefloor_mbb dispose_battlefloor
def dispose_battlefloor
dispose_battlefloor_mbb if BattleBack::BT_FLOOR
end
#--------------------------------------------------------------------------
# ● Update Battle Floor Sprite
#--------------------------------------------------------------------------
alias update_battlefloor_mbb update_battlefloor
def update_battlefloor
update_battlefloor_mbb if BattleBack::BT_FLOOR
end
end


#==============================================================================
# ■ BattleBackSprite
#==============================================================================
class BattleBackSprite < Sprite
# Background Screen Size
WIDTH = 544.00
HEIGHT = 288.00
#--------------------------------------------------------------------------
# ● Object Initialization
# viewport : viewport
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
self.bitmap = Cache.system(BattleBack::M_B_BACK)
# Zoom is carried out according to picture size.
@x_zoom = WIDTH / self.bitmap.width
@y_zoom = HEIGHT / self.bitmap.height
@zoom = @x_zoom > @y_zoom ? @x_zoom : @y_zoom
# Zoom is carried out.
self.zoom_x = @zoom
self.zoom_y = @zoom
# Made into central display.
self.ox = self.bitmap.width / 2
self.oy = self.bitmap.height / 2
self.x = (self.bitmap.width / 2) * @zoom

self.y = (self.bitmap.height / 2) * @zoom
end
end
Barchetta3223
Place this in the scripts section and not in the tutorials section. Thank you.
kaz
QUOTE (Barchetta3223 @ May 20 2011, 10:37 AM) *
Place this in the scripts section and not in the tutorials section. Thank you.


Report this not backseat mod thank you tongue.gif
amerk
Out of curiosity, is this any different than just following Runefreak's method to tweak the Spriteset_Battle script?

http://forum.chaos-project.com/index.php?topic=8717.0

If so, it would seem that would be easiest as you are simply adjusting a couple lines of code verses adding a completely new script.
Kread-EX
Added codebox and spoiler.

Amerk, it's almost the same, except you can use pictures too if you want (like in Synthesize's script).
Wellus
QUOTE (amerk @ May 20 2011, 09:29 AM) *
Out of curiosity, is this any different than just following Runefreak's method to tweak the Spriteset_Battle script?

http://forum.chaos-project.com/index.php?topic=8717.0

If so, it would seem that would be easiest as you are simply adjusting a couple lines of code verses adding a completely new script.


Runefreak's method? honesty I dont have any clue what you are talking about my rpg skill is 1-`10 & I would have no clue on how to tweak the Spriteset_Battle script. this script is for rpg's with little to no knowledge on scripting smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.