RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Flash Selected Enemy 1.0

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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

Screenshots



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


Code: [Select]
#==============================================================================
#    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


  • modern algebra

Thanks

  • Raukue, for the request

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.
« Last Edit: February 11, 2010, 09:48:20 PM by Modern Algebra »

**
Rep:
Level 83
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.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
I'm glad you like it :)