Versus Popup
Version: 1.0
Author: modern algebra
Date: August 27, 2009
Version History
- <Version 1.0> 08.27.2009 - Original Release
Description
This script allows you to show a brief versus screen at the beginning of the battle that takes the face of the first actor and the battler of the first enemy of the troop and shows them before the battle begins, with an image of your choosing between them.
Features
- Shows a simple and clean versus screen before battle
- Easy to change the important feature of the script, such as the SE that plays and the amount of time the versus screen is shown
- You can choose the image that you want for the Versus graphic easily
ScreenshotsInstructions In order for this script to work, you MUST have an image (of arbitrary size) in the System folder of graphics called "Versus". This is the image that will be displayed between the actor face and the enemy battler. A
sample image is attached to this post, but you can make your own image for this and it can be any size.
If you wish to change the amount of time the versus screen is up for, or the SE that plays, or if you are using faces that are non-standard size, than see the Editable Region at line 42 to receive instructions on how to configure those options.
Place this script above Main and below Materials.
Script
#==============================================================================
# Versus Popup
# Version: 1.0
# Author: modern algebra (rmrk.net)
# Date: August 27, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# This script allows you to show a brief versus screen at the beginning of
# the battle that takes the face of the first actor and the battler of the
# first enemy and shows them before the battle begins, with an image of your
# choosing between them.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
#
# In order for this script to work, you MUST have an image (of arbitrary
# size) in the System folder of graphics called "Versus". This is the image
# that will be displayed between the actor face and the enemy battler.
#
# If you wish to change the amount of time the versus screen is up for, the
# opacity of the background, the SE that plays, or if you are using faces
# that are non-standard size, than see the Editable Region at line 42 to
# receive instructions on how to configure those options.
#
# Place this script above Main and below Materials.
#==============================================================================
#==============================================================================
# ** Scene Battle
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new constants - MAVP_POPUP_FRAMES, MAVP_FACE_SIZE, MAVP_SE,
# MAVP_BACK_OPACITY
# aliased method - process_battle_start
# new method - create_versus_images
#==============================================================================
class Scene_Battle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * CONSTANTS
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# EDITABLE REGION
#``````````````````````````````````````````````````````````````````````````
# The constants do the following:
# MAVP_POPUP_FRAMES - the number of frames the versus screen remains up
# for. Note that there are 60 frames in a second.
# MAVP_FACE_SIZE - the face size of your faces. Note that the default
# face size is 96. This should not be changed unless you are using
# faces that are either larger or smaller than RTP.
# MAVP_SE - You can set an SE to play when the versus screen first shows
# up. The format for this is:
# MAVP_SE = ["filename", volume, pitch]
# If you do not fill in volume or pitch, they default to 100 each. If
# you leave the array empty (MAVP_SE = []), then no SE will play.
# MAVP_BACK_OPACITY - The opacity of the grey background that hides the
# battle scene. The value can be 0-255, where 0 is fully transparent
# and 255 is fully opaque
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MAVP_POPUP_FRAMES = 120
MAVP_FACE_SIZE = 96
MAVP_SE = ["Battle2"]
MAVP_BACK_OPACITY = 128
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Process Start Battle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malg_asbsh_vs_popup_prcs_stbtl_7jc2 process_battle_start
def process_battle_start (*args)
create_dimming_bg
create_face_window
create_enemy_battler
create_versus_image
# Play SE if set
RPG::SE.new (*MAVP_SE).play unless MAVP_SE.empty?
# Make versus popup
wait (MAVP_POPUP_FRAMES)
# Dispose versus images
@dimbg_sprite.bitmap.dispose
@dimbg_sprite.dispose
@versus_sprite.dispose
@actor_window.dispose
@battler_sprite.dispose
$game_temp.background_bitmap.dispose
# Run Original Method
malg_asbsh_vs_popup_prcs_stbtl_7jc2 (*args)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create Dimming BG
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def create_dimming_bg
# Create Background
@dimbg_sprite = Sprite.new
@dimbg_sprite.bitmap = Bitmap.new (Graphics.width, Graphics.height)
@dimbg_sprite.bitmap.fill_rect (@dimbg_sprite.bitmap.rect, Color.new (16, 16, 16, MAVP_BACK_OPACITY))
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create Face Window
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def create_face_window
# Create Face images
@actor_window = Window_Base.new (16, (Graphics.height - 160 - MAVP_FACE_SIZE) / 2, 32 + MAVP_FACE_SIZE, 128)
@actor_window.opacity = 0
@actor_window.draw_actor_face ($game_party.members[0], 0, 0, MAVP_FACE_SIZE) unless $game_party.members.empty?
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create Enemy Battler
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def create_enemy_battler
# Create Battler Image
@battler_sprite = Sprite_Base.new
unless $game_troop.members.empty?
enemy = $game_troop.members[0]
@battler_sprite.bitmap = Cache.battler (enemy.battler_name, enemy.battler_hue)
@battler_sprite.x = Graphics.width - 32 - @battler_sprite.bitmap.width
@battler_sprite.y = (Graphics.height - 128 - @battler_sprite.bitmap.height) / 2
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create Versus Image
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def create_versus_image
# Create versus image
@versus_sprite = Sprite_Base.new
@versus_sprite.z = 200
@versus_sprite.bitmap = Cache.system ("Versus")
@versus_sprite.x = @actor_window.x + @actor_window.width - 16
@versus_sprite.x += (@battler_sprite.x - @versus_sprite.x - @versus_sprite.width) / 2
@versus_sprite.y = (Graphics.height - 128 - @versus_sprite.bitmap.height) / 2
end
end
Credit
Thanks
- ashbash361, for requesting this script
Support
Please post here for support.
Known Compatibility Issues
No known compatibility issues, though it won't work with some exotic CBSes, particularly ones that occur outside of Scene_Battle
This script by
modern algebra is licensed under a
Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.