Notice: fwrite(): Write of 461 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 59 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 1714 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 44 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 8192 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Print Page - Flash Selected Enemy 1.0

The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: modern algebra on September 01, 2009, 01:46:57 PM

Title: Flash Selected Enemy 1.0
Post by: modern algebra on September 01, 2009, 01:46:57 PM
Flash Selected Enemy
Version: 1.0
Author: modern algebra
Date: September 1, 2009

Version History




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


Screenshots

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg25.imageshack.us%2Fimg25%2F3997%2Fblinkselectenemy.png&hash=89de784f64c7f41c777cd5001f1907d9c4c11a5e) (http://img25.imageshack.us/i/blinkselectenemy.png/)

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 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.



Creative Commons License
This script by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.
Title: Re: Flash Selected Enemy 1.0
Post by: Raukue on September 03, 2009, 12:04:50 AM
This is pretty sweet and awesome. I can't believe no one had made something like this before. I really appreciate this, it's just the best, you are the best! I hope others appreciate this as much as I do.
Title: Re: Flash Selected Enemy 1.0
Post by: modern algebra on September 03, 2009, 02:03:09 AM
I'm glad you like it :)