Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - A way to add a "sine wave" effect on the screen?

Save-Point

Full Version: A way to add a "sine wave" effect on the screen?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, everyone!  Grinning

I was wondering... is there an RPG Maker XP script that's able to add a sine wave effect to the entire screen? I was thinking that, since my game has an oxygen meter, that having the screen move in a sine wave would be a good effect to have when your oxygen's run out. The effect would grow more powerful until you eventually black out.



I can't really be any more specific than this...  Happy with a sweat

Example - watch the background underwater:
Well, someone back in 2010 worked upon a wave-effect script for RPGMaker XP to mimic the effect from RPGMaker VX. It doesn't affect the screen, but it does affect a defined sprite.... such as a semi-transparent image drawn over the screen

I discovered the script at Chaos Project, and I have to give thanks to Heretic86 (or now.... just Heretic) for archiving it. And obvious thanks to zecomeia for crafting it.

Code:
#========================================
# XP Wave Effect
#----------------------------------------
#by:      zecomeia
#date:    01/03/2010
#for:     RGSS
#version: 1.0
#www.colmeia-do-ze.blogspot.com
#----------------------------------------
=begin
Reproduction of the VX's wave effect
(see the help file of the RPGMaker VX
in the RGSS manual reference topic)
=end

#==============#
# Sprite class #
#==============#
class Sprite

  include Math

  attr_accessor   :wave_amp
  attr_accessor   :wave_length
  attr_accessor   :wave_speed
  attr_accessor   :wave_phase
  attr_accessor   :temp_bitmap

  alias initialize default_initialize rescue nil
  alias default_initialize initialize
  def initialize(viewport=nil)
    @wave_amp = 2
    @wave_length = 72
    @wave_speed = 720
    @wave_phase = 0.25
    default_initialize(viewport)
    @temp_bitmap = nil
  end

  alias update default_update rescue nil
  alias default_update update
  def update()
    # the wave effect only works if wave_amp
    # propertie is a number more than zero
    wave_effect if @wave_amp > 0
    default_update()
  end

  # Return the width of image, because when use
  # obj.bitmap.width the value will be more than
  # the original value(because effect)
  def width()
    return (self.bitmap.width - @wave_amp * 2)
  end
  
  #---------------
  # Wave Effect
  #---------------
  def wave_effect()
    return if self.bitmap.nil?
    @temp_bitmap = self.bitmap if @temp_bitmap.nil?
    cw = @temp_bitmap.width + (@wave_amp * 2)
    ch = @temp_bitmap.height
    # Follow the VX wave effect, each horizontal line
    # has 8 pixel of height. This device provides less
    # lag in game.
    divisions = @temp_bitmap.height / 8
    divisions += 1 if @temp_bitmap.height % 8 != 0
    self.bitmap = Bitmap.new(cw, ch)
    for i in 0..divisions
      x = @wave_amp * Math.sin(i * 2 * PI / (@wave_length / 8).to_i + Math.deg_to_rad(@wave_phase))
      src_rect = Rect.new(0, i*8, @temp_bitmap.width, 8)
      dest_rect = Rect.new(@wave_amp + x, i * 8, @temp_bitmap.width, 8)
      self.bitmap.stretch_blt(dest_rect, @temp_bitmap, src_rect)
    end
    # frame rate: VX = 60 | XP = 40
    # wave speed compatibility VX to XP: wave_speed * 60/40
    # then: wave_speed * 1.5
    @wave_phase += @wave_speed * 1.5 / @wave_length
    @wave_phase -= 360 if @wave_phase > 360
    @wave_phase += 360 if @wave_phase < 0
  end

end

#=============#
# module Math #
#=============#
module Math

  #-------------------------------
  # Conversion Degree to Radian
  #-------------------------------
  def Math.deg_to_rad(deg)
    return (deg * PI) / 180.0
  end

end

The instructions in the post were "Pop it in and monkey with the settings.", and it suggests that you have the RPGMaker VX help file to understand it.

First, let me suggest this type of code when it's in use:
Code:
@battleback_sprite.wave_amp = 8
    @battleback_sprite.wave_length = 240
    @battleback_sprite.wave_speed = 120
... VX didn't use a spriteset for the battleback as it used an actual sprite alone.

And this is from the VX help file
wave_amp (RGSS2)
wave_length (RGSS2)
wave_speed (RGSS2)
wave_phase (RGSS2)
Defines the amplitude, frequency, speed, and phase of the wave effect. A raster scroll effect is achieved by using a sinusoidal function to draw the sprite with each line's horizontal position a bit different from the last.


wave_amp is the wave amplitude and wave_length is the wave frequency, and each is specified by number of pixels.

wave_speed specifies the speed of the wave animation. The default is 360, and the larger the value, the faster the effect.

wave_phase specifies the phase of the top line of the sprite using an angle of up to 360 degrees. This is updated each time the update method is called. It is not necessary to use this property unless it is required for two sprites to have their wave effects synchronized.
Alright, I'll tinker with this script a bit and see what I can come up with.

Thanks for the help!

EDIT: It's not working. I used the commands to enable the wave effect but it gave me an error. Is there a way to turn it off and on easily?

[Image: kneI5tR.png]
When zecomeia designed the script, it appears he made it affect all sprites en-masse. This meant that all character sprites were affected, not a one was left out. There was no ability to limit the effect, nor turn it off.

So I spent some time (JUST TODAY) to examine and perform a bit of a rewrite. The below work grants you the ability to apply wave effects to individual characters on the map, battlers whilst in battle, and pictures presented with the SHOW PICTURE map event. Of these, I made script calls for all but the characterset events as these require a little more work by way of the 'set move route' map event.

Laughing I have instructions in the script of course. Anyone familiar enough with script calls 'should' understand them.

Please note: This will not affect the actual map itself. The system applies affects to anything that is part of the actual Sprite class. The Tilemap class (for the maps), Panoramas, Fogs, Weather, and Viewports are not actually connected to the Sprite class and cannot be affected. Indifferent

Code:
#==============================================================================
# ** XP Wave Effect - Expanded
#------------------------------------------------------------------------------
#    Revision by DerVVulfman
#    version 1.0 -  12-31-2018 (MM-DD-YYYY)
#    Based on the work by zecomeia
#    version 1.0 -  01-03-2018 (MM-DD-YYYY)
#    For RPGMaker XP / RGSS
#==============================================================================
#
#  INTRODUCTION:
#
#  This is an expanded reproduction of RPGMaker VX's wave effect now made
#  available for RPGMaker XP.   These effects apply to RPGMaker XP objects
#  that have the Sprite class as a parent.
#
#  Certain objects (tileset, fog, viewport, panorama) are not actively part
#  of the Sprite class.  And without these attachments, they are not affected.
#
#   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#  
#  INSTALLATION:
#  
#  Place below Scene_Debug and above Main.  It aliases any affected classes,
#  so please place this script below any others that overwrite key methods
#  within the scripts listed below:
#
#  Game_Picture, Game_Battler, Game_Character, Sprite_Picture, Sprite_Battler,
#  Sprite_Character, Interpreter.
#
#   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
#  COMMANDS:
#  =========
#  A series of commands  have been made  so special effects  can be applied to
#  various sprite-based objects.   More commands can be scripted into personal
#  projects.  These are mere guidelines, and are presented below. In all cases
#  the following values apply:
#
#  Amplitude:  The amplitude of the wave as measured in pixels.  It defaults
#              to 0 if not set, thus disabling the wave effect.
#
#  Length:     The frequency of the wave as measured in pixels.  Its default
#              value is 0 if not set.
#
#  Speed:      The speed of the wave animation, defaulted to 360 if not set.
#
#
#  Thus, certain commands below may disable the wave effect merely by using
#  a command without setting the amplitude, or setting its amplitude to 0.
#
#
#   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
#
#  Charactersets:
#  From within the 'Set Move Route' map event, I was able to apply various
#  commands using the 'Script Call' option (third column, last option). Just
#  set the event, and it will affect the map event specified.
#
#  * self.wave_amp = (amplitude)
#  * self.wave_length = (length)
#  * self.wave_speed = (speed)
#  
#
#  Battlers:
#  Actual Script Commands have been added into the Interpreter class for ease
#  of use.  You define the amplitude, length and speed of the wave effect for
#  each battler, defined either by the actor's ID or the enemy's index posi-
#  tion within its troop.  If an actor is not specified, or if an enemy is not
#  specified, it assumes the whole party or troop is affected.
#
#  * actor_wave_amp(amplitude [, actor] )
#  * actor_wave_length(length [, actor] )
#  * actor_wave_speed(speed [, actor] )
#  * enemy_wave_amp(amplitude [, enemy] )
#  * enemy_wave_length(length [, enemy] )
#  * enemy_wave_speed(speed [, enemy] )
#
#  Pictures:
#  Actual Script Commands have been added into the Interpreter class for ease
#  of use.  You define the amplitude, length and speed of the wave effect for
#  each picture identified by the number used when using the SHOW PICTURE map
#  event.  It is not optional, and the commands will not function without.
#  However, it should be noted that the ERASE PICTURE map event will reset
#  the wave effect for later use.
#
#  * picture_wave_amp(picture [, amplitude] )
#  * picture_wave_length(picture [, length] )
#  * picture_wave_speed(picture [, speed] )
#
#
#==============================================================================
#
#  COMPATIBILITY:
#
#  Fairly compatible for RPGMaker XP systems. It doesn't rewrite any methods
#  in the system.
#
#------------------------------------------------------------------------------
#
#  CREDITS AND THANKS:
#
#  This was clearly based upon the work of zecomeia whilst it was a request
#  by Soul from ZetaformGames.   Entertainingly, zecomeia's initial release
#  affected all on-screen sprites and did not allow one to apply affects to
#  individual sprites.  Thus, this altered version was borne.
#
#------------------------------------------------------------------------------
#
#  TERMS OF USE:
#
#  Free for use, even in commercial games.  Only due credit for myaelf and
#  those others within 'Credits and Thanks' is required.
#
#
#==============================================================================



#==============================================================================
# ** Math
#------------------------------------------------------------------------------
# A module that performs mathematical operations.  Not part of the MACL.
#==============================================================================

module Math
  #--------------------------------------------------------------------------
  # * Convert degree to radian
  #     deg : degree
  #--------------------------------------------------------------------------
  def Math.deg_to_rad(deg)
    return (deg * PI) / 180.0
  end
end



#==============================================================================
# ** Sprite
#------------------------------------------------------------------------------
# This is the Parent class for the RPG::Sprite class that adds various effects
# handling options to graphics within RPGXP.
#==============================================================================

class Sprite  
  #--------------------------------------------------------------------------
  # * Convert degree to radian
  #--------------------------------------------------------------------------
  include Math
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias initialize default_initialize rescue nil
  alias default_initialize initialize
  alias update default_update rescue nil
  alias default_update update
  #--------------------------------------------------------------------------
  # * Convert degree to radian
  #--------------------------------------------------------------------------
  attr_accessor   :wave_amp               # amplitude of wave effect
  attr_accessor   :wave_length            # frequency of wave effect
  attr_accessor   :wave_speed             # speed of wave effect  
  attr_accessor   :wave_phase             # phase of wave effect
  attr_accessor   :wave_bitmap
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     viewport : Viewport
  #--------------------------------------------------------------------------
  def initialize(viewport=nil)
    # Set default wave effects
    @wave_amp     = 0
    @wave_length  = 0
    @wave_speed   = 360
    @wave_phase   = 0.25
    # Original update
    default_initialize(viewport)
    @wave_bitmap  = nil
  end
  #--------------------------------------------------------------------------
  # * Set wave amplitude
  #     value : wave amplitude value
  #--------------------------------------------------------------------------  
  def wave_amp=(value)
    @wave_amp = (value.nil?) ? 0 : value
  end
  #--------------------------------------------------------------------------
  # * Set wave frequency
  #     value : wave frequency value
  #--------------------------------------------------------------------------  
  def wave_length=(value)
    @wave_length = (value.nil?) ? 0 : value
  end
  #--------------------------------------------------------------------------
  # * Set wave speed
  #     value : wave speed value
  #--------------------------------------------------------------------------  
  def wave_speed=(value)
    @wave_speed = (value.nil?) ? 360 : value
  end
  #--------------------------------------------------------------------------
  # * Set wave phase
  #     value : wave phase value
  #--------------------------------------------------------------------------  
  def wave_phase=(value)
    @wave_phase = (value.nil?) ? 0.25 : value
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update()
    # Perform wave effect for valid value above zero amplitude
    #unless @wave_amp.nil?
      wave_effect if @wave_amp > 0
    #end
    # Original update
    default_update()
  end
  #--------------------------------------------------------------------------
  # * Get Sprite Width
  #--------------------------------------------------------------------------
  def width()
    return (self.bitmap.width - @wave_amp * 2)
  end
  #--------------------------------------------------------------------------
  # * Wave Effect
  #--------------------------------------------------------------------------
  def wave_effect()
    # Exit if no valid bitmap
    return if self.bitmap.nil?
    # Set temporary bitmap if not already performed
    @wave_bitmap = self.bitmap if @wave_bitmap.nil?
    # Obtain bitmap size
    cw = @wave_bitmap.width + (@wave_amp * 2)
    ch = @wave_bitmap.height
    # Follow the VX wave effect, each horizontal line  has 8 pixel of height.
    # This device provides less lag in game.
    divisions = @wave_bitmap.height / 8
    divisions += 1 if @wave_bitmap.height % 8 != 0
    self.bitmap = Bitmap.new(cw, ch)
    for i in 0..divisions
      x = @wave_amp * Math.sin(i * 2 * PI / (@wave_length / 8).to_i + Math.deg_to_rad(@wave_phase))
      src_rect = Rect.new(0, i*8, @wave_bitmap.width, 8)
      dest_rect = Rect.new(@wave_amp + x, i * 8, @wave_bitmap.width, 8)
      self.bitmap.stretch_blt(dest_rect, @wave_bitmap, src_rect)
    end
    # Frame rate differences between engines: VX = 60 | XP = 40
    # If the wave speed differences between  VX to XP: wave_speed * 60/40
    # Then: wave_speed * 1.5
    @wave_phase += @wave_speed * 1.5 / @wave_length
    @wave_phase -= 360 if @wave_phase > 360
    @wave_phase += 360 if @wave_phase < 0
  end
end



#==============================================================================
# ** Game_Picture
#------------------------------------------------------------------------------
#  This class handles the picture. It's used within the Game_Screen class
#  ($game_screen).
#==============================================================================

class Game_Picture
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :wave_amp                 # amplitude of wave effect
  attr_accessor :wave_length              # frequency of wave effect
  attr_accessor :wave_speed               # speed of wave effect
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  alias wavefx_game_picture_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     number : picture number
  #--------------------------------------------------------------------------
  def initialize(number)
    wavefx_game_picture_initialize(number)
    @wave_amp     = 0
    @wave_length  = 0
    @wave_speed   = 360
  end
end



#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :wave_amp                 # amplitude of wave effect
  attr_accessor :wave_length              # frequency of wave effect
  attr_accessor :wave_speed               # speed of wave effect
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  alias wavefx_game_battler_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # The original call
    wavefx_game_battler_initialize
    @wave_amp     = 0
    @wave_length  = 0
    @wave_speed   = 360
  end
end



#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :wave_amp                 # amplitude of wave effect
  attr_accessor :wave_length              # frequency of wave effect
  attr_accessor :wave_speed               # speed of wave effect
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  alias wavefx_game_character_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # The original call
    wavefx_game_character_initialize
    @wave_amp     = 0
    @wave_length  = 0
    @wave_speed   = 360
  end
end



#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
#  This sprite is used to display the character.It observes the Game_Character
#  class and automatically changes sprite conditions.
#==============================================================================

class Sprite_Character < RPG::Sprite
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  alias wavefx_game_character_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # The original call
    wavefx_game_character_update
    # Exit if no character defined
    return if character.nil?
    # Apply wave values (or reset for nil values)
    self.wave_amp    = (character.wave_amp.nil?)    ? 0 : character.wave_amp
    self.wave_length = (character.wave_length.nil?) ? 0 : character.wave_length
    self.wave_speed  = (character.wave_speed.nil?)  ? 360 : character.wave_speed
  end
end



#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
#  This sprite is used to display the battler.It observes the Game_Character
#  class and automatically changes sprite conditions.
#==============================================================================

class Sprite_Battler < RPG::Sprite
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  alias wavefx_game_battler_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # The original call
    wavefx_game_battler_update
    # Exit if no battler defined
    return if @battler.nil?
    # Apply wave values (or reset for nil values)
    self.wave_amp    = (@battler.wave_amp.nil?)    ? 0 : @battler.wave_amp
    self.wave_length = (@battler.wave_length.nil?) ? 0 : @battler.wave_length
    self.wave_speed  = (@battler.wave_speed.nil?)  ? 360 : @battler.wave_speed
  end
end



#==============================================================================
# ** Sprite_Picture
#------------------------------------------------------------------------------
#  This sprite is used to display the picture.It observes the Game_Character
#  class and automatically changes sprite conditions.
#==============================================================================

class Sprite_Picture < Sprite
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  alias wavefx_sprite_picture_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # The original call
    wavefx_sprite_picture_update
    # Exit if no character defined
    return if @picture.nil?
    # Apply wave values (or reset for nil values)
    self.wave_amp    = (@picture.wave_amp.nil?)    ? 0 : @picture.wave_amp
    self.wave_length = (@picture.wave_length.nil?) ? 0 : @picture.wave_length
    self.wave_speed  = (@picture.wave_speed.nil?)  ? 360 : @picture.wave_speed
  end
end



#==============================================================================
# ** Interpreter
#------------------------------------------------------------------------------
#  This interpreter runs event commands. This class is used within the
#  Game_System class and the Game_Event class.
#==============================================================================

class Interpreter
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  alias wavefx_interpreter_command_235 command_235
  #--------------------------------------------------------------------------
  # * Change Wave Amp for Picture
  #     picture : picture ID
  #     value   : wave amplitude
  #--------------------------------------------------------------------------
  def picture_wave_amp(picture, value=0)
    return if picture.nil?
    # Get picture number
    number = 1  + ($game_temp.in_battle ? 50 : 0)
    # Set amplitude
    $game_screen.pictures[number].wave_amp = value
  end
  #--------------------------------------------------------------------------
  # * Change Wave Frequency for Picture
  #     picture : picture ID
  #     value   : wave frequency
  #--------------------------------------------------------------------------
  def picture_wave_length(picture, value=0)
    return if picture.nil?
    # Get picture number
    number = 1  + ($game_temp.in_battle ? 50 : 0)
    # Set Frequency
    $game_screen.pictures[number].wave_length = value
  end
  #--------------------------------------------------------------------------
  # * Change Wave Speed for Picture
  #     picture : picture ID
  #     value   : wave speed
  #--------------------------------------------------------------------------
  def picture_wave_speed(picture, value=360)
    return if picture.nil?
    # Get picture number
    number = 1  + ($game_temp.in_battle ? 50 : 0)
    # Set Frequency
    $game_screen.pictures[number].wave_speed = value
  end
  #--------------------------------------------------------------------------
  # * Erase Picture
  #--------------------------------------------------------------------------
  def command_235
    # Get picture number
    number = @parameters[0] + ($game_temp.in_battle ? 50 : 0)  
    # Reset values
    $game_screen.pictures[number].wave_amp    = 0
    $game_screen.pictures[number].wave_length = 0
    $game_screen.pictures[number].wave_speed  = 360
    # Perform the original call
    effective = wavefx_interpreter_command_235
    return effective
  end
  #--------------------------------------------------------------------------
  # * Change Actor Wave Amplitude
  #     wave_amp : amplitude
  #     actors   : Actor ID in database (or all in party if left empty)
  #--------------------------------------------------------------------------
  def actor_wave_amp(wave_amp, actors=-1)
    # Get operate value
    value = wave_amp
    # Process with iterator
    iterate_actor(actors) do |actor|
      actor.wave_amp = value
    end
  end
  #--------------------------------------------------------------------------
  # * Change Actor Wave Frequency
  #     wave_length : frequency
  #     actors      : Actor ID in database (or all in party if left empty)
  #--------------------------------------------------------------------------
  def actor_wave_length(wave_length, actors=-1)
    # Get operate value
    value = wave_length
    # Process with iterator
    iterate_actor(actors) do |actor|
      actor.wave_length = value
    end
  end
  #--------------------------------------------------------------------------
  # * Change Actor Wave Speed
  #     wave_speed : speed
  #     actors     : Actor ID in database (or all in party if left empty)
  #--------------------------------------------------------------------------
  def actor_wave_speed(wave_speed, actors=-1)
    # Get operate value
    value = wave_length
    # Process with iterator
    iterate_actor(actors) do |actor|
      actor.wave_speed = value
    end
  end  
  #--------------------------------------------------------------------------
  # * Change Enemy Wave Amplitude
  #     wave_amp : amplitude
  #     enemies  : Index of enemy in troop (or all in troop if left empty)
  #--------------------------------------------------------------------------
  def enemy_wave_amp(wave_amp, enemies=-1)
    # Get operate value
    value = wave_amp
    # Process with iterator
    iterate_enemy(enemies) do |enemy|
      enemy.wave_amp = value
    end
  end
  #--------------------------------------------------------------------------
  # * Change Enemy Wave Frequency
  #     wave_length : frequency
  #     enemies     : Index of enemy in troop (or all in troop if left empty)
  #--------------------------------------------------------------------------
  def enemy_wave_length(wave_length, enemies=-1)
    # Get operate value
    value = wave_length
    # Process with iterator
    iterate_enemy(enemies) do |enemy|
      enemy.wave_length = value
    end
  end
  #--------------------------------------------------------------------------
  # * Change Enemy Wave Speed
  #     wave_speed : speed
  #     enemies    : Index of enemy in troop (or all in troop if left empty)
  #--------------------------------------------------------------------------
  def enemy_wave_speed(wave_speed, enemies=-1)
    # Get operate value
    value = wave_length
    # Process with iterator
    iterate_enemy(enemies) do |enemy|
      enemy.wave_speed = value
    end
  end
end
Sorry for the late reply, I've been super busy lately. Thank you for the script. I'll be sure to credit you in my game once it comes out.