Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

ACBS - Atoa Custom Battle System 3.2

@Atoa
Hitting battlers during their actions would be bad since it would break the battler actions and would cause a lot of glitches.
Ouch, just as I thought...
So it's impossible to hit the enemies while they're walking? Too bad...

Well, thanks for the response anyway, that helped clear a lot of things
 
@Atoa
Really? Is that possible?
Thanks, this is really make my hopes up, since the one I really need is for them to be able to hit their enemies while the enemies are walking!

I'll wait for the said version to be released then, thank you~
 

Atoa

Member

Code:
# V3.2 | 19 - 02 - 2011

#  • Bug Fixes.

#  • Removed the setting for Auto States from the Add | Enemy Advanced Status,

#    these settings are now on an separated add-on.

#  • New basic settings:

#    - Make enemies use another actions if the selected one isn't available,

#      avoid it's losing the turn. (Enemy_Dont_Skip_Action)

#    - Hide SP value for skills that cost 0 SP. (Hide_Zero_SP)

#    - Random move for damage pop (Randon_Move)

#    - Movimento aleatório para exibição de dano (Random_Move)

#    - Set Base critical rate (Base_Critical_Rate)

#    - Set Base critical damage rate (Base_Critical_Damage)

#    - Pose for Evade when in Danger (Danger_Evade_Pose)

#    - Pose for Critical Physical Skill (Critical_Skill_Pose)

#    - Allows battler to act even if it's another battler target(Allow_Enemy_Target)

#    - Allows battler to act even if it's targets are active (Allow_Active_Target)

#  • Changes on the Add | Custom Window Settings:

#    - Hide_Zero_SP removed and added to the basic settings

#  • Changes on Add | Skill Scan:

#    - Scan_Window_Position, Scan_Window_Dimension, Scan_Border_Opacity,

#      Scan_Back_Opacity removed and replaced by Scan_Window_Settings.

#  • New Advanced Settings:

#    - Ignore move settings of the weapon for physical skills ("IGNOREWEAPONMOVE")

#    - Add weapon element for skill damage. ("WEAPONELEMENT")

#    - Add weapon added effects for skill damage. ("WEAPONSTATES")

#    - Add weapon damage variance for skill damage. ("WEAPONVARIANCE")

#    - Battler moves intantly to the target spot ("TELEPORTTOTARGET")

#    - Update movement during combos ("MOVEINCOMBO")

#    - Clear target battler list between hits ("CLEARRANDOM")

#    - Action don't show any animation ("NOANIMATION")

#    - Show animations in actions with multiple hits ("HITSANIMATION")

#    - Shows different animations based on the target or battler direction

#     ("ANIMDIRECTIONCASTER/**", "ANIMDIRECTIONTARGET/**", "ANIMDIRECTIONPOSITION/**")

#    - Centralize screen animations on the targets ("ANIMCENTERTARGET")

#    - Invert animations based on the target or battler direction

#      ("ANIMMIRRORTARGET/**", "ANIMMIRRORCASTER/**")

#    - New critical settings for skills ("CRITICAL/**", "WEAPONCRITICAL/**" ,

#      "CRITICALDAMAGE/**", "CRITICALWEAPONDAMAGE/**")

#

#  • Scripts Updated:

#    - ACBS | Config 1 - Basic

#    - ACBS | Config 2 - Advanced

#    - ACBS | Object

#    - ACBS | RPG::

#    - ACBS | RPG::Sprite

#    - ACBS | Sprite Damage

#    - ACBS | Sprite Battler

#    - ACBS | Spriteset Battle

#    - ACBS | Game Battler

#    - ACBS | Game Actor

#    - ACBS | Game Enemy

#    - ACBS | Game Party

#    - ACBS | Arrow Class

#    - ACBS | Scene Battle 1

#    - ACBS | Scene Battle 2

#    - ACBS | Scene Battle 3

#    - ACBS | Scene Battle 4

#

#  • New Add-Ons

#    - Add | Counter Attack

#    - Add | Custom Damage

#    - Add | States Graphic

#    - Add | Enemy Auto States

#

#  • New Utility/Patches

#    - Utility | FFVIII Draw

#

#  • Add-Ons Updated:

#    - Add | Atoa CTB

#    - Add | Atoa ATB

#    - Add | Status Limit

#    - Add | Equipment Multi Slots

#    - Add | New Status

#    - Add | Two Hands

#    - Add | Advanced Weapons

#    - Add | New Resistenca System

#    - Add | Equipment with Skills

#    - Add | Enemy Advanced Status

#    - Add | Individual Battle Commands

#    - Add | Enemy Name Window

#    - Add | Automatic Actions

#    - Add | Skill Drain

#    - Add | Skill Charge

#    - Add | Skill Blitz

#    - Add | Skill Scan

#    - Add | Skill Combination

#    - Add | Battle Advantages

#    - Add | Atoa Bestiary

#    - Add | Equipment Sprite

#    - Add | Battle Camera

#    - Add | Legaia Combo

#    - Add | Combo Display

#    - Add | Damage Limit

#

#  • Patchs/Utilitátios Updated:

#    - Ultility | Victory Window FF7

#    - Patch | Megalukes Interactive Rotational Arrow

English version updated to Version 3.2

Please if anyone find a bug, provide detailed information about it so i can fix.
 
I hate to bother you, Atoa, but is there any plans soon for any patches for Fantasists Transition Pack? I was using that Kingdom Hearts Transition I made to start battles.
 
I'll do you one better:

Code:
#==============================================================================

# ** Transition Pack

#------------------------------------------------------------------------------

# by Fantasist

# Version: 1.1

# Date: 23-August-2009

#------------------------------------------------------------------------------

# Version History:

#

#   1.0 - First released version

#   1.1 - Added code to make battle scene use the transitions

#------------------------------------------------------------------------------

# Description:

#

#     This script adds some exotic transitions which can't be attained by

#   regular transition graphics.

#------------------------------------------------------------------------------

# Compatibility:

#

#     It should be compatible with most scripts.

#==============================================================================

# Instructions:

#

#     Place this script below Scene_Debug and above Main. To use this, instead

#   of calling a scene directly like this:

#

#           $scene = Scene_Something.new)

#

#   call it like this:

#

#           $scene = Transition.new(Scene_Something.new)

#

#     Before calling it, you can change "$game_temp.transition_type" to

#   activate the transiton.

#

#     As of version 1.1 and above, the battle scene automatically uses the

#   transition effect, so all you have to do is call the battle using the event

#   command.

#

#     You can also call a certain effect like this:

#

#           Transition.new(NEXT_SCENE, EFFECT_TYPE, EFFECT_TYPE_ARGUMENTS)

#

#

#   Here is the list of transitions (as of version 1.0):

#

#     0 - Zoom In

#     1 - Zoom Out

#     2 - Shred Horizontal

#     3 - Shred Vertical

#     4 - Fade

#     5 - Explode

#     6 - Explode (Chaos Project Style)

#     7 - Transpose (by Blizzard)

#     8 - Shutter

#     9 - Drop Off

#

#   For Scripters:

#

#     For adding new transitions, check the method Transition#call_effect.

#   Simply add a new case for "type" and add your method. Don't forget to

#   add the *args version, it makes it easier to pass arguments when calling

#   transitions. Check out the call_effect method for reference.

#------------------------------------------------------------------------------

# Configuration:

#

#     Scroll down a bit and you'll see the configuration.

#

#   Explosion_Sound: Filename of the SE for Explosion transitions

#       Clink_Sound: Filename of the SE for Drop Off transition

#------------------------------------------------------------------------------

# Issues:

#

#     None that I know of.

#------------------------------------------------------------------------------

# Credits and Thanks:

#

#   Fantasist, for making this script

#   Blizzard, for the Transpose effect

#   shdwlink1993, for keeping the demo for so long

#   Ryexander, for helping me with an important scripting aspect

#------------------------------------------------------------------------------

# Notes:

#

#     If you have any problems, suggestions or comments, you can find me at:

#

#  - forum.chaos-project.com

#

#   Enjoy ^_^

#==============================================================================

 

#==============================================================================

# ** Screen Module

#------------------------------------------------------------------------------

#  This module handles taking screenshots for the transitions.

#==============================================================================

module Screen

  

  @screen = Win32API.new 'screenshot.dll', 'Screenshot', %w(l l l l p l l), ''

  @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'

  @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'

  #--------------------------------------------------------------------------

  # * Snap (take screenshot)

  #--------------------------------------------------------------------------

  def self.snap(file_name='Data/scrn_tmp', file_type=0)

    game_name = "\0" * 256

    @readini.call('Game', 'Title', '', game_name, 255, '.\Game.ini')

    game_name.delete!('\0')

    window = @findwindow.call('RGSS Player', game_name)

    @screen.call(0, 0, 640, 480, file_name, window, file_type)

  end

end

 

#==============================================================================

# ** Wait()

#==============================================================================

def update_basic

  Graphics.update

  #@khbattlestart.bitmap = RPG::Cache.clear 

end

def wait(duration)

  for i in 0...duration do update_basic end 

end

#==============================================================================

# ** Cache ()

#==============================================================================

module RPG::Cache

  def self.battlestart(filename, hue = 0)

    self.load_bitmap('Graphics/BattleStart/', filename, hue)

  end

end

 

#==============================================================================

# ** Transition

#------------------------------------------------------------------------------

#  This scene handles transition effects while switching to another scene.

#==============================================================================

class Transition

  

  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  # * CONFIG BEGIN

  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  Explosion_Sound = nil

      Clink_Sound = nil

  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  # * CONFIG END

  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  

  #--------------------------------------------------------------------------

  # * Call Effect

  #     type : Transition type

  #     args : Arguments for specified transition type

  #--------------------------------------------------------------------------

  def call_effect(type, args)

    # Call appropriate method with or without arguments depending

    # on values of type and args.

    no_args = args.nil? || args == []

    if no_args

      case type

      when 0 then zoom_in

      when 1 then zoom_out

      when 2 then shred_h

      when 3 then shred_v

      when 4 then fade

      when 5 then explode

      when 6 then explode_cp

      when 7 then transpose

      when 8 then shutter

      when 9 then drop_off

      when 10 then kingdomhearts

      end

    else

      case type

      when 0 then zoom_in(*args)

      when 1 then zoom_out(*args)

      when 2 then shred_h(*args)

      when 3 then shred_v(*args)

      when 4 then fade(*args)

      when 5 then explode(*args)

      when 6 then explode_cp(*args)

      when 7 then transpose(*args)

      when 8 then shutter(*args)

      when 9 then drop_off(*args)

      when 10 then kingdomhearts(*args)

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Initialize

  #     next_scene : Instance of the scene to transition into

  #           type : Transition type

  #          *args : Arguments for specified transition type

  #--------------------------------------------------------------------------

  def initialize(next_scene=Scene_Menu.new, type=nil, *args)

    @next_scene = next_scene

    @args = args

    # If transition type is specified, use it.

    # Otherwise, use default.

    @type = type.nil? ? $game_temp.transition_type : type

  end

  #--------------------------------------------------------------------------

  # * Main

  #--------------------------------------------------------------------------

  def main

    # Take screenshot and prepare sprite

    Screen.snap

    @sprite = Sprite.new

    @sprite.bitmap = Bitmap.new('Data/scrn_tmp')

    @sprite.x = @sprite.ox = @sprite.bitmap.width / 2

    @sprite.y = @sprite.oy = @sprite.bitmap.height / 2

    # Activate effect

    Graphics.transition(0)

    call_effect(@type, @args)

    # Freeze screen and clean up and switch scene

    if @type < 10 then

      Graphics.freeze

      @sprite.bitmap.dispose unless @sprite.bitmap.nil?

      @sprite.dispose unless @sprite.nil?

      File.delete('Data/scrn_tmp')

      $scene = @next_scene

      Graphics.transition(20)

    end

  end

  #--------------------------------------------------------------------------

  # * Play SE

  #     filename : Filename of the SE file in Audio/SE folder

  #        pitch : Pitch of sound (50 - 100)

  #       volume : Volume of sound (0 - 100)

  #--------------------------------------------------------------------------

  def play_se(filename, pitch=nil, volume=nil)

    se = RPG::AudioFile.new(filename)

    se.pitch  = pitch unless pitch.nil?

    se.volume = volume unless volume.nil?

    Audio.se_play('Audio/SE/' + se.name, se.volume, se.pitch)

  end

  

  #==========================================================================

  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  # ** Effect Library

  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  #==========================================================================

  

  #--------------------------------------------------------------------------

  # * Zoom In

  #     frames : Effect duration in frames

  #   max_zoom : The max amount the screen zooms out

  #--------------------------------------------------------------------------

  def zoom_in(frames=20, max_zoom=12)

    # Calculate difference b/w current and target

    # zooms (1 and max_zoom)

    zoom_diff = max_zoom - 1

    # Calculate unit values

    unit_zoom = zoom_diff.to_f / frames

    unit_opacity = (255.0 / frames).ceil

    # Apply unit values to sprite

    frames.times do

      @sprite.zoom_x += unit_zoom

      @sprite.zoom_y += unit_zoom

      @sprite.opacity -= unit_opacity

      Graphics.update

    end

  end

  #--------------------------------------------------------------------------

  # * Zoom Out

  #     frames : Effect duration in frames

  #--------------------------------------------------------------------------

  def zoom_out(frames=20)

    # Calculate unit values

    unit_zoom = 1.0 / frames

    unit_opacity = (255.0 / frames).ceil

    # Apply unit values to sprite

    frames.times do

      @sprite.zoom_x -= unit_zoom

      @sprite.zoom_y -= unit_zoom

      @sprite.opacity -= unit_opacity

      Graphics.update

    end

  end

  #--------------------------------------------------------------------------

  # * Shred Horizontal

  #      thickness : Shred thickness

  #       slowness : How slow the screens move out

  #    start_speed : Speed of first step in pixels

  #--------------------------------------------------------------------------

  def shred_h(thickness=4, slowness=4, start_speed=8)

    t = thickness

    # Shred screen

    sprite2 = Sprite.new

    sprite2.bitmap = Bitmap.new(@sprite.bitmap.width, @sprite.bitmap.height)

    sprite2.x = sprite2.ox = sprite2.bitmap.width / 2

    sprite2.y = sprite2.oy = sprite2.bitmap.height / 2

    for i in 0..(480/t)

      sprite2.bitmap.blt(0, i*t*2, @sprite.bitmap, Rect.new(0, i*t*2, 640, t))

      @sprite.bitmap.fill_rect(0, i*t*2, 640, t, Color.new(0, 0, 0, 0))

    end

    # Make sure starting step is not zero

    start_speed = slowness if start_speed < slowness

    # Move sprites

    dist = 640 - @sprite.x + start_speed

    loop do

      x_diff = (dist - (640 - @sprite.x)) / slowness

      @sprite.x += x_diff

      sprite2.x -= x_diff

      Graphics.update

      break if @sprite.x >= 640 + 320

    end

    sprite2.bitmap.dispose

    sprite2.dispose

  end

  #--------------------------------------------------------------------------

  # * Shred Vertical

  #      thickness : Shred thickness

  #       slowness : How slow the screens move out

  #    start_speed : Speed of first step in pixels

  #--------------------------------------------------------------------------

  def shred_v(thickness=4, slowness=4, start_speed=8)

    t = thickness

    # Shred screen

    sprite2 = Sprite.new

    sprite2.bitmap = Bitmap.new(@sprite.bitmap.width, @sprite.bitmap.height)

    sprite2.x = sprite2.ox = sprite2.bitmap.width / 2

    sprite2.y = sprite2.oy = sprite2.bitmap.height / 2

    # Shred bitmap

    for i in 0..(640/t)

      sprite2.bitmap.blt(i*t*2, 0, @sprite.bitmap, Rect.new(i*t*2, 0, t, 480))

      @sprite.bitmap.fill_rect(i*t*2, 0, t, 480, Color.new(0, 0, 0, 0))

    end

    # Make sure starting step is not zero

    start_speed = slowness if start_speed < slowness

    # Move sprites

    dist = 480 - @sprite.y + start_speed

    loop do

      y_diff = (dist - (480 - @sprite.y)) / slowness

      @sprite.y += y_diff

      sprite2.y -= y_diff

      Graphics.update

      break if @sprite.y >= 480 + 240

    end

    sprite2.bitmap.dispose

    sprite2.dispose

  end

  #--------------------------------------------------------------------------

  # * Fade

  #     target_color : Color to fade to

  #           frames : Effect duration in frames

  #--------------------------------------------------------------------------

  def fade(target_color=Color.new(255, 255, 255), frames=10)

    loop do

      r = (@sprite.color.red   * (frames - 1) + target_color.red)   / frames

      g = (@sprite.color.green * (frames - 1) + target_color.green) / frames

      b = (@sprite.color.blue  * (frames - 1) + target_color.blue)  / frames

      a = (@sprite.color.alpha * (frames - 1) + target_color.alpha) / frames

      @sprite.color.red   = r

      @sprite.color.green = g

      @sprite.color.blue  = b

      @sprite.color.alpha = a

      frames -= 1

      Graphics.update

      break if frames <= 0

    end

    Graphics.freeze

  end

  #--------------------------------------------------------------------------

  # * Explode

  #     explosion_sound : The SE filename to use for explosion sound

  #--------------------------------------------------------------------------

  def explode(explosion_sound=Explosion_Sound)

    shake_count = 2

    shakes = 40

    tone = 0

    shakes.times do

      @sprite.ox = 320 + (rand(2) == 0 ? -1 : 1) * shake_count

      @sprite.oy = 240 + (rand(2) == 0 ? -1 : 1) * shake_count

      shake_count += 0.2

      tone += 128/shakes

      @sprite.tone.set(tone, tone, tone)

      Graphics.update

    end

    @sprite.ox, @sprite.oy = 320, 240

    Graphics.update

    bitmap = @sprite.bitmap.clone

    @sprite.bitmap.dispose

    @sprite.dispose

    # Slice bitmap and create nodes (sprite parts)

    hor = []

    20.times do |i|

      ver = []

      15.times do |j|

        # Set node properties

        s = Sprite.new

        s.ox, s.oy = 8 + rand(25), 8 + rand(25)

        s.x, s.y = s.ox + 32 * i, s.oy + 32 * j

        s.bitmap = Bitmap.new(32, 32)

        s.bitmap.blt(0, 0, bitmap, Rect.new(i * 32, j * 32, 32, 32))

        s.tone.set(128, 128, 128)

        # Set node physics

        angle  = (rand(2) == 0 ? -1 : 1) * (4 + rand(4) * 10)

        zoom_x = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100

        zoom_y = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100

        (zoom_x > zoom_y) ? (zoom_y = -zoom_x) : (zoom_x = -zoom_y)

        x_rand = (2 + rand(2) == 0 ? -2 : 2)

        y_rand = (1 + rand(2) == 0 ? -1 : 1)

        # Store node and it's physics

        ver.push([s, angle, zoom_x, zoom_y, x_rand, y_rand])

      end

      hor.push(ver)

    end

    bitmap.dispose

    # Play sound

    play_se(explosion_sound) if explosion_sound != nil

    # Move pics

    40.times do |k|

      hor.each_with_index do |ver, i|

        ver.each_with_index do |data, j|

          # Get node and it's physics

          s, angle, zoom_x, zoom_y = data[0], data[1], data[2], data[3]

          x_rand, y_rand = data[4], data[5]

          # Manipulate nodes

          s.x += (i - 10) * x_rand

          s.y += (j - 8) * y_rand + (k - 20)/2

          s.zoom_x += zoom_x

          s.zoom_y += zoom_y

          tone = s.tone.red - 8

          s.tone.set(tone, tone, tone)

          s.opacity -= 13 if k > 19

          s.angle += angle % 360

        end

      end

      Graphics.update

    end

    # Dispose

    for ver in hor

      for data in ver

        data[0].bitmap.dispose

        data[0].dispose

      end

    end

    hor = nil

  end

  #--------------------------------------------------------------------------

  # * Explode (Chaos Project Style)

  #     explosion_sound : The SE filename to use for explosion sound

  #--------------------------------------------------------------------------

  def explode_cp(explosion_sound=Explosion_Sound)

    bitmap = @sprite.bitmap.clone

    @sprite.bitmap.dispose

    @sprite.dispose

    # Slice bitmap and create nodes (sprite parts)

    hor = []

    20.times do |i|

      ver = []

      15.times do |j|

        # Set node properties

        s = Sprite.new

        s.ox = s.oy = 16

        s.x, s.y = s.ox + 32 * i, s.oy + 32 * j

        s.bitmap = Bitmap.new(32, 32)

        s.bitmap.blt(0, 0, bitmap, Rect.new(i * 32, j * 32, 32, 32))

        # Set node physics

        angle  = (rand(2) == 0 ? -1 : 1) * rand(8)

        zoom_x = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100

        zoom_y = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100

        # Store node and it's physics

        ver.push([s, angle, zoom_x, zoom_y])

      end

      hor.push(ver)

    end

    bitmap.dispose

    # Play sound

    play_se(explosion_sound) if explosion_sound != nil

    # Move pics

    40.times do |k|

      hor.each_with_index do |ver, i|

        ver.each_with_index do |data, j|

          # Get node and it's physics

          s, angle, zoom_x, zoom_y = data[0], data[1], data[2], data[3]

          # Manipulate node

          s.x += i - 9

          s.y += j - 8 + k

          s.zoom_x += zoom_x

          s.zoom_y += zoom_y

          s.angle += angle % 360

        end

      end

      Graphics.update

    end

    # Dispose

    for ver in hor

      for data in ver

        data[0].bitmap.dispose

        data[0].dispose

      end

    end

    hor = nil

  end

  #--------------------------------------------------------------------------

  # * Transpose (bt Blizzard)

  #     frames : Effect duration in frames

  #   max_zoom : The max amount the screen zooms out

  #      times : Number of times screen is zoomed (times * 3 / 2)

  #--------------------------------------------------------------------------

  def transpose(frames=80, max_zoom=12, times=3)

    max_zoom -= 1 # difference b/w zooms

    max_zoom = max_zoom.to_f / frames / times # unit zoom

    unit_opacity = (255.0 / frames).ceil

    spr_opacity = (255.0 * times / 2 / frames).ceil

    @sprites = []

    (times * 3 / 2).times {

      s = Sprite.new

      s.x, s.y, s.ox, s.oy = 320, 240, 320, 240

      s.bitmap = @sprite.bitmap

      s.blend_type = 1

      s.opacity = 128

      s.visible = false

      @sprites.push(s)}

    count = 0

    loop {

        @sprites[count].visible = true

        count += 1 if count < times * 3 / 2 - 1

        (frames / times / 2).times {

            @sprites.each {|s|

                break if !s.visible

                s.zoom_x += max_zoom

                s.zoom_y += max_zoom

                s.opacity -= spr_opacity}

            @sprite.opacity -= unit_opacity

        Graphics.update}

        break if @sprite.opacity == 0}

    @sprites.each {|s| s.dispose}

  end

  #--------------------------------------------------------------------------

  # * Shutter

  #       open_gap : How much the shutters open before moving away

  #       flip_dir : Whether or not the direction of shutters if reversed

  #       slowness : How slow the screens move out

  #    start_speed : Speed of first step in pixels

  #--------------------------------------------------------------------------

  def shutter(flip_dir=true, open_gap=16, slowness=4, start_speed=8)

    # Shred screen

    sprite2 = Sprite.new

    sprite2.bitmap = Bitmap.new(@sprite.bitmap.width, @sprite.bitmap.height)

    sprite2.x = sprite2.ox = sprite2.bitmap.width / 2

    sprite2.y = sprite2.oy = sprite2.bitmap.height / 2

    if flip_dir

      ver_step = 1

      sprite2.bitmap.blt(0, 240, @sprite.bitmap, Rect.new(0, 240, 640, 240))

      @sprite.bitmap.fill_rect(0, 240, 640, 240, Color.new(0, 0, 0, 0))

    else

      ver_step = -1

      sprite2.bitmap.blt(0, 0, @sprite.bitmap, Rect.new(0, 0, 640, 240))

      @sprite.bitmap.fill_rect(0, 0, 640, 240, Color.new(0, 0, 0, 0))

    end

    # Move the shutters apart

    open_gap.times do

      @sprite.y -= ver_step

      sprite2.y += ver_step

      Graphics.update

    end

    # Make sure starting step is not zero

    start_speed = slowness if start_speed < slowness

    # Move sprites

    dist = 640 - @sprite.x + start_speed

    loop do

      x_diff = (dist - (640 - @sprite.x)) / slowness

      @sprite.x += x_diff

      sprite2.x -= x_diff

      Graphics.update

      break if @sprite.x >= 640 + 320

    end

    sprite2.bitmap.dispose

    sprite2.dispose

  end

  #--------------------------------------------------------------------------

  # * Drop Off

  #     clink_sound : The SE filename to use for clinking sound

  #--------------------------------------------------------------------------

  def drop_off(clink_sound=Clink_Sound)

    bitmap = @sprite.bitmap.clone

    @sprite.bitmap.dispose

    @sprite.dispose

    # Slice bitmap and create nodes (sprite parts)

    max_time = 0

    hor = []

    10.times do |i|

      ver = []

      8.times do |j|

        # Set node properties

        s = Sprite.new

        s.ox = rand(32)

        s.oy = 0

        s.x = s.ox + 64 * i

        s.y = s.oy + 64 * j

        s.bitmap = Bitmap.new(64, 64)

        s.bitmap.blt(0, 0, bitmap, Rect.new(i * 64, j * 64, 64, 64))

        # Set node physics

        angle = rand(4) * 2

        angle *= rand(2) == 0 ? -1 : 1

        start_time = rand(30)

        max_time = start_time if max_time < start_time

        # Store node and it's physics

        ver.push([s, angle, start_time])

      end

      hor.push(ver)

    end

    bitmap.dispose

    # Play sound

    play_se(clink_sound) if clink_sound != nil

    # Move pics

    (40 + max_time).times do |k|

      hor.each_with_index do |ver, i|

        ver.each_with_index do |data, j|

          # Get node and it's physics

          s, angle, start_time = data[0], data[1], data[2]

          # Manipulate node

          if k > start_time

            tone = s.tone.red - 6

            s.tone.set(tone, tone, tone)

            s.y += k - start_time

            s.angle += angle % 360

          elsif k == start_time

            tone = 128

            s.tone.set(tone, tone, tone)

            $game_system.se_play(Clink_Sound) if clink_sound != nil

          end

        end

      end

      Graphics.update

    end

    # Dispose

    for ver in hor

      for data in ver

        data[0].bitmap.dispose

        data[0].dispose

      end

    end

    hor = nil

  end

  #--------------------------------------------------------------------------

  # * KingdomHearts (by Mayor Anime)

  #     frames : Effect duration in frames

  #--------------------------------------------------------------------------

  def kingdomhearts(frames=114)

      Audio.se_play("Audio/SE/KingdomHeartsBattleStart",100)

      @khbattlestart = Sprite.new

      @khbattlestart.z = 9999

      for i in 0..90

        @khbattlestart.bitmap = RPG::Cache.battlestart(sprintf("BattleStart (%0d)", i))

        wait(1)

      end

      Graphics.freeze

      File.delete('Data/scrn_tmp')

      $scene = @next_scene

      Graphics.transition(20)

    wait(1)

    @khbattlestart.dispose

  end

end

#==============================================================================

# ** Game_Temp

#------------------------------------------------------------------------------

#  Added transition_type attribute which controls transition shown.

#==============================================================================

class Game_Temp  

  attr_accessor :transition_type  

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  alias transpack_game_temp_init initialize

  def initialize

    @transition_type = 0

    transpack_game_temp_init

  end

end

#==============================================================================

# ** Scene_Map

#------------------------------------------------------------------------------

#  Scene_Map modded to use the transition effect when battle begins.

#==============================================================================

class Scene_Map

  #--------------------------------------------------------------------------

  # * Battle Call

  #--------------------------------------------------------------------------

  alias transpack_call_battle call_battle

  def call_battle

    transpack_call_battle

    $scene = Transition.new($scene)

  end

end

 
 

Atoa

Member

@MayorAnime
I just tested it, and it doesn't need any patch, just put it bellow the battle system and add-ons.


Oh i just noticed it rewrites one of my methods
Code:
#==============================================================================

# ** Wait()

#==============================================================================

def update_basic

  Graphics.update

  #@khbattlestart.bitmap = RPG::Cache.clear

end

def wait(duration)

  for i in 0...duration do update_basic end

end

You should also delete the
Graphics.transition(20)

delete this one and all should work
 
I'm sorry to say that it doesn't work. Here is what I did:

Code:
#==============================================================================

# ** Transition Pack

#------------------------------------------------------------------------------

# by Fantasist

# Version: 1.1

# Date: 23-August-2009

#------------------------------------------------------------------------------

# Version History:

#

#   1.0 - First released version

#   1.1 - Added code to make battle scene use the transitions

#------------------------------------------------------------------------------

# Description:

#

#     This script adds some exotic transitions which can't be attained by

#   regular transition graphics.

#------------------------------------------------------------------------------

# Compatibility:

#

#     It should be compatible with most scripts.

#==============================================================================

# Instructions:

#

#     Place this script below Scene_Debug and above Main. To use this, instead

#   of calling a scene directly like this:

#

#           $scene = Scene_Something.new)

#

#   call it like this:

#

#           $scene = Transition.new(Scene_Something.new)

#

#     Before calling it, you can change "$game_temp.transition_type" to

#   activate the transiton.

#

#     As of version 1.1 and above, the battle scene automatically uses the

#   transition effect, so all you have to do is call the battle using the event

#   command.

#

#     You can also call a certain effect like this:

#

#           Transition.new(NEXT_SCENE, EFFECT_TYPE, EFFECT_TYPE_ARGUMENTS)

#

#

#   Here is the list of transitions (as of version 1.0):

#

#     0 - Zoom In

#     1 - Zoom Out

#     2 - Shred Horizontal

#     3 - Shred Vertical

#     4 - Fade

#     5 - Explode

#     6 - Explode (Chaos Project Style)

#     7 - Transpose (by Blizzard)

#     8 - Shutter

#     9 - Drop Off

#

#   For Scripters:

#

#     For adding new transitions, check the method Transition#call_effect.

#   Simply add a new case for "type" and add your method. Don't forget to

#   add the *args version, it makes it easier to pass arguments when calling

#   transitions. Check out the call_effect method for reference.

#------------------------------------------------------------------------------

# Configuration:

#

#     Scroll down a bit and you'll see the configuration.

#

#   Explosion_Sound: Filename of the SE for Explosion transitions

#       Clink_Sound: Filename of the SE for Drop Off transition

#------------------------------------------------------------------------------

# Issues:

#

#     None that I know of.

#------------------------------------------------------------------------------

# Credits and Thanks:

#

#   Fantasist, for making this script

#   Blizzard, for the Transpose effect

#   shdwlink1993, for keeping the demo for so long

#   Ryexander, for helping me with an important scripting aspect

#------------------------------------------------------------------------------

# Notes:

#

#     If you have any problems, suggestions or comments, you can find me at:

#

#  - forum.chaos-project.com

#

#   Enjoy ^_^

#==============================================================================

 

#==============================================================================

# ** Screen Module

#------------------------------------------------------------------------------

#  This module handles taking screenshots for the transitions.

#==============================================================================

module Screen

  

  @screen = Win32API.new 'screenshot.dll', 'Screenshot', %w(l l l l p l l), ''

  @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'

  @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'

  #--------------------------------------------------------------------------

  # * Snap (take screenshot)

  #--------------------------------------------------------------------------

  def self.snap(file_name='Data/scrn_tmp', file_type=0)

    game_name = "\0" * 256

    @readini.call('Game', 'Title', '', game_name, 255, '.\Game.ini')

    game_name.delete!('\0')

    window = @findwindow.call('RGSS Player', game_name)

    @screen.call(0, 0, 640, 480, file_name, window, file_type)

  end

end

 

#==============================================================================

# ** Wait()

#==============================================================================

#def update_basic

#  Graphics.update

  #@khbattlestart.bitmap = RPG::Cache.clear 

#end

#def wait(duration)

#  for i in 0...duration do update_basic end 

#end

#==============================================================================

# ** Cache ()

#==============================================================================

module RPG::Cache

  def self.battlestart(filename, hue = 0)

    self.load_bitmap('Graphics/BattleStart/', filename, hue)

  end

end

 

#==============================================================================

# ** Transition

#------------------------------------------------------------------------------

#  This scene handles transition effects while switching to another scene.

#==============================================================================

class Transition

  

  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  # * CONFIG BEGIN

  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  Explosion_Sound = nil

      Clink_Sound = nil

  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  # * CONFIG END

  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  

  #--------------------------------------------------------------------------

  # * Call Effect

  #     type : Transition type

  #     args : Arguments for specified transition type

  #--------------------------------------------------------------------------

  def call_effect(type, args)

    # Call appropriate method with or without arguments depending

    # on values of type and args.

    no_args = args.nil? || args == []

    if no_args

      case type

      when 0 then zoom_in

      when 1 then zoom_out

      when 2 then shred_h

      when 3 then shred_v

      when 4 then fade

      when 5 then explode

      when 6 then explode_cp

      when 7 then transpose

      when 8 then shutter

      when 9 then drop_off

      when 10 then kingdomhearts

      end

    else

      case type

      when 0 then zoom_in(*args)

      when 1 then zoom_out(*args)

      when 2 then shred_h(*args)

      when 3 then shred_v(*args)

      when 4 then fade(*args)

      when 5 then explode(*args)

      when 6 then explode_cp(*args)

      when 7 then transpose(*args)

      when 8 then shutter(*args)

      when 9 then drop_off(*args)

      when 10 then kingdomhearts(*args)

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Initialize

  #     next_scene : Instance of the scene to transition into

  #           type : Transition type

  #          *args : Arguments for specified transition type

  #--------------------------------------------------------------------------

  def initialize(next_scene=Scene_Menu.new, type=nil, *args)

    @next_scene = next_scene

    @args = args

    # If transition type is specified, use it.

    # Otherwise, use default.

    @type = type.nil? ? $game_temp.transition_type : type

  end

  #--------------------------------------------------------------------------

  # * Main

  #--------------------------------------------------------------------------

  def main

    # Take screenshot and prepare sprite

    Screen.snap

    @sprite = Sprite.new

    @sprite.bitmap = Bitmap.new('Data/scrn_tmp')

    @sprite.x = @sprite.ox = @sprite.bitmap.width / 2

    @sprite.y = @sprite.oy = @sprite.bitmap.height / 2

    # Activate effect

    Graphics.transition(0)

    call_effect(@type, @args)

    # Freeze screen and clean up and switch scene

    if @type < 10 then

      Graphics.freeze

      @sprite.bitmap.dispose unless @sprite.bitmap.nil?

      @sprite.dispose unless @sprite.nil?

      File.delete('Data/scrn_tmp')

      $scene = @next_scene

      Graphics.transition(20)

    end

  end

  #--------------------------------------------------------------------------

  # * Play SE

  #     filename : Filename of the SE file in Audio/SE folder

  #        pitch : Pitch of sound (50 - 100)

  #       volume : Volume of sound (0 - 100)

  #--------------------------------------------------------------------------

  def play_se(filename, pitch=nil, volume=nil)

    se = RPG::AudioFile.new(filename)

    se.pitch  = pitch unless pitch.nil?

    se.volume = volume unless volume.nil?

    Audio.se_play('Audio/SE/' + se.name, se.volume, se.pitch)

  end

  

  #==========================================================================

  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  # ** Effect Library

  #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

  #==========================================================================

  

  #--------------------------------------------------------------------------

  # * Zoom In

  #     frames : Effect duration in frames

  #   max_zoom : The max amount the screen zooms out

  #--------------------------------------------------------------------------

  def zoom_in(frames=20, max_zoom=12)

    # Calculate difference b/w current and target

    # zooms (1 and max_zoom)

    zoom_diff = max_zoom - 1

    # Calculate unit values

    unit_zoom = zoom_diff.to_f / frames

    unit_opacity = (255.0 / frames).ceil

    # Apply unit values to sprite

    frames.times do

      @sprite.zoom_x += unit_zoom

      @sprite.zoom_y += unit_zoom

      @sprite.opacity -= unit_opacity

      Graphics.update

    end

  end

  #--------------------------------------------------------------------------

  # * Zoom Out

  #     frames : Effect duration in frames

  #--------------------------------------------------------------------------

  def zoom_out(frames=20)

    # Calculate unit values

    unit_zoom = 1.0 / frames

    unit_opacity = (255.0 / frames).ceil

    # Apply unit values to sprite

    frames.times do

      @sprite.zoom_x -= unit_zoom

      @sprite.zoom_y -= unit_zoom

      @sprite.opacity -= unit_opacity

      Graphics.update

    end

  end

  #--------------------------------------------------------------------------

  # * Shred Horizontal

  #      thickness : Shred thickness

  #       slowness : How slow the screens move out

  #    start_speed : Speed of first step in pixels

  #--------------------------------------------------------------------------

  def shred_h(thickness=4, slowness=4, start_speed=8)

    t = thickness

    # Shred screen

    sprite2 = Sprite.new

    sprite2.bitmap = Bitmap.new(@sprite.bitmap.width, @sprite.bitmap.height)

    sprite2.x = sprite2.ox = sprite2.bitmap.width / 2

    sprite2.y = sprite2.oy = sprite2.bitmap.height / 2

    for i in 0..(480/t)

      sprite2.bitmap.blt(0, i*t*2, @sprite.bitmap, Rect.new(0, i*t*2, 640, t))

      @sprite.bitmap.fill_rect(0, i*t*2, 640, t, Color.new(0, 0, 0, 0))

    end

    # Make sure starting step is not zero

    start_speed = slowness if start_speed < slowness

    # Move sprites

    dist = 640 - @sprite.x + start_speed

    loop do

      x_diff = (dist - (640 - @sprite.x)) / slowness

      @sprite.x += x_diff

      sprite2.x -= x_diff

      Graphics.update

      break if @sprite.x >= 640 + 320

    end

    sprite2.bitmap.dispose

    sprite2.dispose

  end

  #--------------------------------------------------------------------------

  # * Shred Vertical

  #      thickness : Shred thickness

  #       slowness : How slow the screens move out

  #    start_speed : Speed of first step in pixels

  #--------------------------------------------------------------------------

  def shred_v(thickness=4, slowness=4, start_speed=8)

    t = thickness

    # Shred screen

    sprite2 = Sprite.new

    sprite2.bitmap = Bitmap.new(@sprite.bitmap.width, @sprite.bitmap.height)

    sprite2.x = sprite2.ox = sprite2.bitmap.width / 2

    sprite2.y = sprite2.oy = sprite2.bitmap.height / 2

    # Shred bitmap

    for i in 0..(640/t)

      sprite2.bitmap.blt(i*t*2, 0, @sprite.bitmap, Rect.new(i*t*2, 0, t, 480))

      @sprite.bitmap.fill_rect(i*t*2, 0, t, 480, Color.new(0, 0, 0, 0))

    end

    # Make sure starting step is not zero

    start_speed = slowness if start_speed < slowness

    # Move sprites

    dist = 480 - @sprite.y + start_speed

    loop do

      y_diff = (dist - (480 - @sprite.y)) / slowness

      @sprite.y += y_diff

      sprite2.y -= y_diff

      Graphics.update

      break if @sprite.y >= 480 + 240

    end

    sprite2.bitmap.dispose

    sprite2.dispose

  end

  #--------------------------------------------------------------------------

  # * Fade

  #     target_color : Color to fade to

  #           frames : Effect duration in frames

  #--------------------------------------------------------------------------

  def fade(target_color=Color.new(255, 255, 255), frames=10)

    loop do

      r = (@sprite.color.red   * (frames - 1) + target_color.red)   / frames

      g = (@sprite.color.green * (frames - 1) + target_color.green) / frames

      b = (@sprite.color.blue  * (frames - 1) + target_color.blue)  / frames

      a = (@sprite.color.alpha * (frames - 1) + target_color.alpha) / frames

      @sprite.color.red   = r

      @sprite.color.green = g

      @sprite.color.blue  = b

      @sprite.color.alpha = a

      frames -= 1

      Graphics.update

      break if frames <= 0

    end

    Graphics.freeze

  end

  #--------------------------------------------------------------------------

  # * Explode

  #     explosion_sound : The SE filename to use for explosion sound

  #--------------------------------------------------------------------------

  def explode(explosion_sound=Explosion_Sound)

    shake_count = 2

    shakes = 40

    tone = 0

    shakes.times do

      @sprite.ox = 320 + (rand(2) == 0 ? -1 : 1) * shake_count

      @sprite.oy = 240 + (rand(2) == 0 ? -1 : 1) * shake_count

      shake_count += 0.2

      tone += 128/shakes

      @sprite.tone.set(tone, tone, tone)

      Graphics.update

    end

    @sprite.ox, @sprite.oy = 320, 240

    Graphics.update

    bitmap = @sprite.bitmap.clone

    @sprite.bitmap.dispose

    @sprite.dispose

    # Slice bitmap and create nodes (sprite parts)

    hor = []

    20.times do |i|

      ver = []

      15.times do |j|

        # Set node properties

        s = Sprite.new

        s.ox, s.oy = 8 + rand(25), 8 + rand(25)

        s.x, s.y = s.ox + 32 * i, s.oy + 32 * j

        s.bitmap = Bitmap.new(32, 32)

        s.bitmap.blt(0, 0, bitmap, Rect.new(i * 32, j * 32, 32, 32))

        s.tone.set(128, 128, 128)

        # Set node physics

        angle  = (rand(2) == 0 ? -1 : 1) * (4 + rand(4) * 10)

        zoom_x = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100

        zoom_y = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100

        (zoom_x > zoom_y) ? (zoom_y = -zoom_x) : (zoom_x = -zoom_y)

        x_rand = (2 + rand(2) == 0 ? -2 : 2)

        y_rand = (1 + rand(2) == 0 ? -1 : 1)

        # Store node and it's physics

        ver.push([s, angle, zoom_x, zoom_y, x_rand, y_rand])

      end

      hor.push(ver)

    end

    bitmap.dispose

    # Play sound

    play_se(explosion_sound) if explosion_sound != nil

    # Move pics

    40.times do |k|

      hor.each_with_index do |ver, i|

        ver.each_with_index do |data, j|

          # Get node and it's physics

          s, angle, zoom_x, zoom_y = data[0], data[1], data[2], data[3]

          x_rand, y_rand = data[4], data[5]

          # Manipulate nodes

          s.x += (i - 10) * x_rand

          s.y += (j - 8) * y_rand + (k - 20)/2

          s.zoom_x += zoom_x

          s.zoom_y += zoom_y

          tone = s.tone.red - 8

          s.tone.set(tone, tone, tone)

          s.opacity -= 13 if k > 19

          s.angle += angle % 360

        end

      end

      Graphics.update

    end

    # Dispose

    for ver in hor

      for data in ver

        data[0].bitmap.dispose

        data[0].dispose

      end

    end

    hor = nil

  end

  #--------------------------------------------------------------------------

  # * Explode (Chaos Project Style)

  #     explosion_sound : The SE filename to use for explosion sound

  #--------------------------------------------------------------------------

  def explode_cp(explosion_sound=Explosion_Sound)

    bitmap = @sprite.bitmap.clone

    @sprite.bitmap.dispose

    @sprite.dispose

    # Slice bitmap and create nodes (sprite parts)

    hor = []

    20.times do |i|

      ver = []

      15.times do |j|

        # Set node properties

        s = Sprite.new

        s.ox = s.oy = 16

        s.x, s.y = s.ox + 32 * i, s.oy + 32 * j

        s.bitmap = Bitmap.new(32, 32)

        s.bitmap.blt(0, 0, bitmap, Rect.new(i * 32, j * 32, 32, 32))

        # Set node physics

        angle  = (rand(2) == 0 ? -1 : 1) * rand(8)

        zoom_x = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100

        zoom_y = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100

        # Store node and it's physics

        ver.push([s, angle, zoom_x, zoom_y])

      end

      hor.push(ver)

    end

    bitmap.dispose

    # Play sound

    play_se(explosion_sound) if explosion_sound != nil

    # Move pics

    40.times do |k|

      hor.each_with_index do |ver, i|

        ver.each_with_index do |data, j|

          # Get node and it's physics

          s, angle, zoom_x, zoom_y = data[0], data[1], data[2], data[3]

          # Manipulate node

          s.x += i - 9

          s.y += j - 8 + k

          s.zoom_x += zoom_x

          s.zoom_y += zoom_y

          s.angle += angle % 360

        end

      end

      Graphics.update

    end

    # Dispose

    for ver in hor

      for data in ver

        data[0].bitmap.dispose

        data[0].dispose

      end

    end

    hor = nil

  end

  #--------------------------------------------------------------------------

  # * Transpose (bt Blizzard)

  #     frames : Effect duration in frames

  #   max_zoom : The max amount the screen zooms out

  #      times : Number of times screen is zoomed (times * 3 / 2)

  #--------------------------------------------------------------------------

  def transpose(frames=80, max_zoom=12, times=3)

    max_zoom -= 1 # difference b/w zooms

    max_zoom = max_zoom.to_f / frames / times # unit zoom

    unit_opacity = (255.0 / frames).ceil

    spr_opacity = (255.0 * times / 2 / frames).ceil

    @sprites = []

    (times * 3 / 2).times {

      s = Sprite.new

      s.x, s.y, s.ox, s.oy = 320, 240, 320, 240

      s.bitmap = @sprite.bitmap

      s.blend_type = 1

      s.opacity = 128

      s.visible = false

      @sprites.push(s)}

    count = 0

    loop {

        @sprites[count].visible = true

        count += 1 if count < times * 3 / 2 - 1

        (frames / times / 2).times {

            @sprites.each {|s|

                break if !s.visible

                s.zoom_x += max_zoom

                s.zoom_y += max_zoom

                s.opacity -= spr_opacity}

            @sprite.opacity -= unit_opacity

        Graphics.update}

        break if @sprite.opacity == 0}

    @sprites.each {|s| s.dispose}

  end

  #--------------------------------------------------------------------------

  # * Shutter

  #       open_gap : How much the shutters open before moving away

  #       flip_dir : Whether or not the direction of shutters if reversed

  #       slowness : How slow the screens move out

  #    start_speed : Speed of first step in pixels

  #--------------------------------------------------------------------------

  def shutter(flip_dir=true, open_gap=16, slowness=4, start_speed=8)

    # Shred screen

    sprite2 = Sprite.new

    sprite2.bitmap = Bitmap.new(@sprite.bitmap.width, @sprite.bitmap.height)

    sprite2.x = sprite2.ox = sprite2.bitmap.width / 2

    sprite2.y = sprite2.oy = sprite2.bitmap.height / 2

    if flip_dir

      ver_step = 1

      sprite2.bitmap.blt(0, 240, @sprite.bitmap, Rect.new(0, 240, 640, 240))

      @sprite.bitmap.fill_rect(0, 240, 640, 240, Color.new(0, 0, 0, 0))

    else

      ver_step = -1

      sprite2.bitmap.blt(0, 0, @sprite.bitmap, Rect.new(0, 0, 640, 240))

      @sprite.bitmap.fill_rect(0, 0, 640, 240, Color.new(0, 0, 0, 0))

    end

    # Move the shutters apart

    open_gap.times do

      @sprite.y -= ver_step

      sprite2.y += ver_step

      Graphics.update

    end

    # Make sure starting step is not zero

    start_speed = slowness if start_speed < slowness

    # Move sprites

    dist = 640 - @sprite.x + start_speed

    loop do

      x_diff = (dist - (640 - @sprite.x)) / slowness

      @sprite.x += x_diff

      sprite2.x -= x_diff

      Graphics.update

      break if @sprite.x >= 640 + 320

    end

    sprite2.bitmap.dispose

    sprite2.dispose

  end

  #--------------------------------------------------------------------------

  # * Drop Off

  #     clink_sound : The SE filename to use for clinking sound

  #--------------------------------------------------------------------------

  def drop_off(clink_sound=Clink_Sound)

    bitmap = @sprite.bitmap.clone

    @sprite.bitmap.dispose

    @sprite.dispose

    # Slice bitmap and create nodes (sprite parts)

    max_time = 0

    hor = []

    10.times do |i|

      ver = []

      8.times do |j|

        # Set node properties

        s = Sprite.new

        s.ox = rand(32)

        s.oy = 0

        s.x = s.ox + 64 * i

        s.y = s.oy + 64 * j

        s.bitmap = Bitmap.new(64, 64)

        s.bitmap.blt(0, 0, bitmap, Rect.new(i * 64, j * 64, 64, 64))

        # Set node physics

        angle = rand(4) * 2

        angle *= rand(2) == 0 ? -1 : 1

        start_time = rand(30)

        max_time = start_time if max_time < start_time

        # Store node and it's physics

        ver.push([s, angle, start_time])

      end

      hor.push(ver)

    end

    bitmap.dispose

    # Play sound

    play_se(clink_sound) if clink_sound != nil

    # Move pics

    (40 + max_time).times do |k|

      hor.each_with_index do |ver, i|

        ver.each_with_index do |data, j|

          # Get node and it's physics

          s, angle, start_time = data[0], data[1], data[2]

          # Manipulate node

          if k > start_time

            tone = s.tone.red - 6

            s.tone.set(tone, tone, tone)

            s.y += k - start_time

            s.angle += angle % 360

          elsif k == start_time

            tone = 128

            s.tone.set(tone, tone, tone)

            $game_system.se_play(Clink_Sound) if clink_sound != nil

          end

        end

      end

      Graphics.update

    end

    # Dispose

    for ver in hor

      for data in ver

        data[0].bitmap.dispose

        data[0].dispose

      end

    end

    hor = nil

  end

  #--------------------------------------------------------------------------

  # * KingdomHearts (by Mayor Anime)

  #     frames : Effect duration in frames

  #--------------------------------------------------------------------------

  def kingdomhearts(frames=114)

      Audio.se_play("Audio/SE/KingdomHeartsBattleStart",100)

      @khbattlestart = Sprite.new

      @khbattlestart.z = 9999

      for i in 0..90

        @khbattlestart.bitmap = RPG::Cache.battlestart(sprintf("BattleStart (%0d)", i))

        wait(1)

      end

      Graphics.freeze

      File.delete('Data/scrn_tmp')

      $scene = @next_scene

      #Graphics.transition(20)

    wait(1)

    @khbattlestart.dispose

  end

end

#==============================================================================

# ** Game_Temp

#------------------------------------------------------------------------------

#  Added transition_type attribute which controls transition shown.

#==============================================================================

class Game_Temp  

  attr_accessor :transition_type  

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  alias transpack_game_temp_init initialize

  def initialize

    @transition_type = 0

    transpack_game_temp_init

  end

end

#==============================================================================

# ** Scene_Map

#------------------------------------------------------------------------------

#  Scene_Map modded to use the transition effect when battle begins.

#==============================================================================

class Scene_Map

  #--------------------------------------------------------------------------

  # * Battle Call

  #--------------------------------------------------------------------------

  alias transpack_call_battle call_battle

  def call_battle

    transpack_call_battle

    $scene = Transition.new($scene)

  end

end

 

When I try my normal '$game_temp.transition_type = 10' and start a battle it doesn't work at all. It uses the default RMCP battle transition. So is there a part of your code that would overwrite it? What did you use that worked?
 

Atoa

Member

well this one i couldn't test since there was missing files, but the others works fine here

Code:
#       for i in 0..90

#         @khbattlestart.bitmap = RPG::Cache.battlestart(sprintf("BattleStart (%0d)", i))

#         wait(1)

#       end
Try replacing the "wait(1)" with Graphics.update
 
Tried that too. If I just call the transition with the following:

$game_temp.transition_type = 10
$scene = Transition.new(Scene_Map.new)

...it works just fine. However, if I try to call it before a battle:

$game_temp.transition_type = 10
Battle Processing: Shadow Heartless x 1

...it uses the default grayscale transition, like '001-Blind01'.

So is it something in your engine that is causing that to happen?
 

Atoa

Member

@MayorAnime
Are the transtion script bellow all add-ons and battle scripts?
Like i said it's working fine here with all othe transtions.
 
Hi Atoa, I have an advanced question. I am trying to add some extra features to your scripts on my own, but this one is giving me problems.

What I want to do is make an enemy that the player doesn't move to. Some of my enemies are swimming in water or lava, so having the player move to those enemies doesn't make sense, even for attacks that would normally move the player to the enemy. Something that works like LOCKMOVE, except it's a property of the target instead of the attacker.

For an example from Chrono Trigger, go to 3:15 of this video where Crono, Lucca and Marle are in the sewers and are fighting fish. Crono stands still for his normal attacks because the enemies are out of reach. This is the effect I'm trying to duplicate.

It seems to me that the place to do this in your scripts is in the set_action_movement method, and in the battler_can_move method. So I added a few lines to each of these methods. But it doesn't work.

Here's my code:
Code:
 

  def set_action_movement(battler)

    now_action(battler)

    reset_battler_movement(battler)

    battler.movement = battler_can_move(battler)

    battler.action_all = true if check_action_all(battler_action(battler))

    ext = check_extension(battler_action(battler), 'MOVETYPE/')

    ext.slice!('MOVETYPE/') unless ext.nil?

    battler.movement = true if ext == 'MOVETOTARGET'

    battler.step_foward = true if ext == 'STEPFOWARD'

    battler.action_center = true if ext == 'SCREENCENTER'

    if battler.actor? and battler.now_action.is_a?(RPG::Skill) and not

       battler.now_action.magic? and battler.weapons[0] != nil

      ext = check_extension(battler.weapons[0], 'MOVETYPE/')

      ext.slice!('MOVETYPE/') unless ext.nil?

      battler.movement = true if ext == 'MOVETOTARGET'

      battler.step_foward = true if ext == 'STEPFOWARD'

      battler.action_center = true if ext == 'SCREENCENTER'

    end

    ext = check_extension(battler, 'LOCKMOVE/')

    unless ext.nil?

      ext.slice!('LOCKMOVE/')

      battler.movement = (ext != 'NOMOVE' and not battler.skip?)

      battler.action_center = false

      battler.step_foward = ext == 'STEPFOWARD'

    end

    # Next 4 lines added by LockeZ

    for target in battler.target_battlers

      battler.movement = false if check_include(target, 'UNAPPROACHABLE')

      battler.action_center = false if check_include(target, 'UNAPPROACHABLE')

    end

  end

 
Code:
 

  def battler_can_move(battler)

    return false if not Move_to_Attack

    return false if battler.restriction > 3

    return false if battler.skip?

    return false if check_include(battler, 'LOCKMOVE/NOMOVE')

    return false if check_include(battler_action(battler), 'MOVETYPE/NOMOVE')

    return false if battler_action(battler).magic? and not 

      (check_include(battler_action(battler), 'MOVETYPE/STEPFOWARD') or

      check_include(battler_action(battler), 'MOVETYPE/MOVETOTARGET') or

      check_include(battler_action(battler), 'MOVETYPE/SCREENCENTER'))

    # Next 3 lines added by LockeZ

    for target in battler.target_battlers

      return false if check_include(target, 'UNAPPROACHABLE')

    end

    return true

  end

 

And then I gave the UNAPPROACHABLE property to the enemy. This doesn't crash the game, but it doesn't do anything. This is definitely the place where you handle LOCKMOVE, and I can prevent the player from moving by adding different code here (such as unconditionally returning false), but I can't seem to get the current target. It seems that battler.target_battlers is empty at this point. I also tried using @target_battlers instead of battler.target_battlers and it didn't work any better.

I can't check the target for this property if there's no way to query the target. Is there somewhere else I should move my added code to? Or am I handling it entirely wrong?

You are obviously most familiar with this, so I thought I'd ask your advice. I understand if you don't have time to solve this, though. Thanks for the great battle system!
 
Atoa":321cosv9 said:
@MayorAnime
Are the transtion script bellow all add-ons and battle scripts?
Like i said it's working fine here with all othe transtions.

Yes of course. It's before my own other scripts, but after all of yours.


EDIT: Okay, I am dumb. :/ I put it at the VERY VERY end and now it works. Look at me. Duh! :P

Thanks, Atoa, for your help! :D
 
Okay now a different bug-issue coming up. I am replaying the game's opening, and during the first boss fight, the main Hero takes a swing at the first boss. The hit connects, the slip damage pops-up (usually 15 to 17 damage) and then the game crashes with:

16az407.png


When I go to the Scripts, though, no script is selected (it's on the very first script, an empty one you call « Game Objects » and nothing is highlighted.

This Boss does have Battle Events, needed to summon lesser enemies into the fight. Nothing else is unusual.
 
It's funny, i have been using that transitions script now for awhile, and i have had no problems with it, lol.. i even posted the script here a ways back.. of-course the thread i made for it got little or no responses from people, like they either did not care about it, or they were basically taking the script and running lol.. so to speak.. but that's neither here nor there.

But i will say, i'm surprised anyone is having any problems with it, seems fine for me.

Oh and i looked into the default system, and something is not right, it's doing that one problem i was having with my project, where if someone dies they still get XP, maybe it's that one particular battle results script?

I dunno.. it's odd though how it wants to do that, but as soon as i can, i'll check the newest version and see if it's still doing that.
 
Whoa! Update! WOOOOOOOOOOO!

I guess I should take a look at all the new shinies before asking you to help with my problem. Maybe it's been handled already!
 
English version updated to Version 3.2
Wow, that was fast, many thanks Atoa! XD

Tested it, haven't found any bug so far, and that dynamic action settings are awesome, just what I needed! XD
Really love it when the both attackers clash and attack each other at the same time, and the teleport to target add-on XD

Okay, I'll start making the sprites I need when I have time, and you can be sure to be the first one I show the battle video...
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top