Flash Selected Enemy
Version: 1.0
Author: modern algebra
Date: September 1, 2009
Version History
- <Version 1.0> 09.01.2009 - Original Release
Description
This script blinks the battler of the enemy when it is hovered over in the targetting window of the battle scene, so you know exactly which battler is being targetted.
Features
- Blinks the targetted enemy in the battle scene
- Can choose between a blink effect and a whiten effect
- can set a rest period between flashes easily configurable
ScreenshotsInstructions This script is plug & play. Just put it somewhere below Materials and above Main in the Script Editor (F11).
If you wish to configure the color of the blink, the time the blink takes, or the rest period in between blinks, then please go to line 28 and configure those constants. Note there are 60 frames per second
Script
#==============================================================================
# Flash Selected Enemy
# Version: 1.0
# Author: modern algebra (rmrk.net)
# Date: September 1, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# This script blinks the battler of the enemy when it is hovered over in the
# targetting window of the battle scene.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
#
# This script is plug & play. Just put it somewhere below Materials and
# above Main in the Script Editor (F11).
#
# If you wish to configure the rest period between flashes, or the type of
# flash (blink or whiten), then go to line 27
#==============================================================================
#==============================================================================
# ** Global Constants
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# new constants - FSE_REST_FRAMES; FSE_FLASH_TYPE
#==============================================================================
FSE_REST_FRAMES = 4 # The number of frames between battler flashes
FSE_FLASH_TYPE = 1 # The type of effect. 1 => Whiten; 2 => Blink
#==============================================================================
# ** Game Battler
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# attr_accessor - stop_effect
# aliased method - initialize
#==============================================================================
class Game_Battler
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_accessor :stop_effect # boolean to turn off any effect immediately
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malgbra_init_btllerblinkenmy_0nf3 initialize
def initialize (*args)
@stop_effect = false # Initialize stop effect boolean
malgbra_init_btllerblinkenmy_0nf3 (*args) # Run Original Method
end
end
#==============================================================================
# ** Sprite Battler
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - update_effect
#==============================================================================
class Sprite_Battler
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Stop Effect
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malgbr_updeffct_blnksenmy_9hv2 update_effect
def update_effect (*args)
# Stop effect if set to stop
if @battler.stop_effect
@effect_duration = 1
@battler.stop_effect = false
end
# Run Original Method
malgbr_updeffct_blnksenmy_9hv2 (*args)
end
end
#==============================================================================
# ** Scene_Battle
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - start_target_enemy_selection, end_target_enemy_selection,
# update_target_enemy_selection
#==============================================================================
class Scene_Battle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Start Target Enemy Selection
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malgbr_blinkenmytrgt_strtslct_6dc2 start_target_enemy_selection
def start_target_enemy_selection (*args)
@fse_effect_frames = FSE_FLASH_TYPE == 1 ? 16 : 20
@blink_frames = @fse_effect_frames + FSE_REST_FRAMES # Initialize blink count
# Run Original Method
malgbr_blinkenmytrgt_strtslct_6dc2 (*args)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Target Enemy Selection
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modrna_enmyblink_updtrgtselct_9la2 update_target_enemy_selection
def update_target_enemy_selection (*args)
old_enemy = @target_enemy_window.enemy
# Run Original Method
modrna_enmyblink_updtrgtselct_9la2 (*args)
# If target has changed
if @target_enemy_window.nil? || old_enemy != @target_enemy_window.enemy
# Stop that enemy from blinking
old_enemy.stop_effect = true
return if @target_enemy_window.nil?
# start other blink
@blink_frames = @fse_effect_frames + FSE_REST_FRAMES
end
# Blink selected battler when count is up
if @blink_frames >= @fse_effect_frames + FSE_REST_FRAMES
@blink_frames = 0
if FSE_FLASH_TYPE == 1 # White Flash
@target_enemy_window.enemy.white_flash = true
elsif FSE_FLASH_TYPE == 2 # Blink
@target_enemy_window.enemy.blink = true
end
end
@blink_frames += 1
end
end
Credit
Thanks
Support
Please post in this topic for support.
Known Compatibility Issues
It will likely not be compatible with very exotic battle systems, particularly ones that do not use Scene_Battle.
This script by
modern algebra is licensed under a
Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.