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":3hiiy66g said:
It's an add-on to implement an legend of legaia like combo system.

Since the ACBS alread have support for skill sequences, it would be needed only to make the code for manage the sequence. But since legaia haves an relly dynamic system that allows various combos, it's being quite hard do assemble them @.@
http://www.youtube.com/watch?v=CLuyIPfNGKk

That was one of the single greatest RPGs I have ever played.

WOW.

Good luck with that, Atoa!
 
Holy crap, I found another crash-error!

Situation: I had loaded a saved game (am using Law's Custom Save Script, modified to show a PNG instead of a screencap), fought a battle, and as soon as the battle was won, before the EXP was tallied, this came up:

2d73oz.png


I checked to see if I was leveling up. Just had one character in the game. Here is the state of the character right before the battle:

5l19vs.png


He was fighting three enemies, each who give 1 EXP a piece. I have the game set to not divide EXP (does that mean that he would get 3 x 4 = 12 EXP?). Anyway, it didn't look like he was leveling up.

Here is the Save Game Menu script, in case it (somehow) clashes:

Code:
#------------------------------------------------------------------------------

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

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

#======================*Law's Custom Save System*==============================

#=========================Author: The Law G14==================================

#============================Version 1.1=======================================

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

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

 

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

# ** Module_Customization

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

#  This module contains all the customization for the script

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

 

module Customization

  

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

  # * Config Begin

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

  

  # Here you can change the number of save slots that will be in your game

  SLOTS = 8

  # Here you can change the name of the text in the save slots

  SLOT_NAME = "Slot"

  

  # Here you can change what icon will appear next to a filename that isn't empty

  SLOT_ICON_SELECTED = "Keyblade1"

  # Here you can change what icon will appear next to a filename that is empty

  SLOT_ICON_UNSELECTED = "Keyblade2"

  

  # Draw Gold

  DRAW_GOLD = true

  # Draw Playtime

  DRAW_PLAYTIME = true

  # Draw location

  DRAW_LOCATION = true

  # Draw Actor's face

  DRAW_FACE = true

  # Draw Actor's name

  DRAW_NAME = true

    

  # Text inside file info window when empty

  EMPTY_SLOT_TEXT = "~EMPTY~"

  

  # Playtime Text

  PLAYTIME_TEXT = "Play Time: "

  # Gold Text

  GOLD_TEXT = "Money: "

  # Location Text

  LOCATION_TEXT = "Location: "

  

  # Map image border color (R,G,B,Opacity)

  MAP_BORDER = Color.new(0,0,0,200)

  

  # Text for help window when saving. Ex: "Which file would you like to save to?"

  SAVE_TEXT = "Which file would you like to save to?"

  # Text for help window when loading. Ex: "Which file would you like to load?"

  LOAD_TEXT = "Which file would you like to load?"

  

  # All windows' opacity (Lowest 0 - 255 Highest)

  # Use low opacity when having a background.

  WINDOW_OPACITY = 200

  # Background image file name, it must be in the pictures folder.

  # Put '' if you don't want a background.

  BACKGROUND_IMAGE = 'KingdomHeartsTitle'

  # Opacity for background image

  BACKGROUND_IMAGE_OPACITY = 255

    

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

  # * Config End

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

 

end

 

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

# ** Game_Map

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

#  This class handles the map. It includes scrolling and passable determining

#  functions. Refer to "$game_map" for the instance of this class.

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

 

class Game_Map

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

  # * Public Instance Variables

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

  attr_reader   :name

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

  # * Alias Listing

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

  alias law_css_setup setup

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

  # * Setup

  #     map_id : map ID

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

  def setup(*args)

    # Run the original setup

    law_css_setup(*args)

    # Load the name of the map

    @name = load_data("Data/MapInfos.rxdata")[@map_id].name

  end

end

 

 

 

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

# ** Spriteset_Map_Loading_Preview

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

#  This class brings together map screen sprites, tilemaps, etc for the

#   loading screen's preview.

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

 

class Spriteset_Map_Loading_Preview

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

  # * Invariables

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

  RES_WIDTH =  352  # Please insert a number divisible by 32

  RES_HEIGHT = 160   # Please insert a number divisible by 32

  TOP_CORNER_X = 201

  TOP_CORNER_Y = 120

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

  # * Object Initialization

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

  def initialize

    center

    # Make viewports

    @viewport1 = Viewport.new(TOP_CORNER_X, TOP_CORNER_Y, RES_WIDTH, RES_HEIGHT)

    @viewport2 = Viewport.new(TOP_CORNER_X, TOP_CORNER_Y, RES_WIDTH, RES_HEIGHT)

    @viewport3 = Viewport.new(TOP_CORNER_X, TOP_CORNER_Y, RES_WIDTH, RES_HEIGHT)

    @viewport1.z = 9200

    @viewport2.z = 9200

    @viewport3.z = 95000

    # Make tilemap

    @tilemap = Tilemap.new(@viewport1)

    @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)

    for i in 0..6

      autotile_name = $game_map.autotile_names[i]

      @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)

    end

    @tilemap.map_data = $game_map.data

    @tilemap.priorities = $game_map.priorities

    # Make panorama plane

    @panorama = Plane.new(@viewport1)

    @panorama.z = -1000

    # Make fog plane

    @fog = Plane.new(@viewport1)

    @fog.z = 3000

    # Make character sprites

    @character_sprites = []

    for i in $game_map.events.keys.sort

      sprite = Sprite_Character.new(@viewport1, $game_map.events[i])

      @character_sprites.push(sprite)

    end

    @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))

    # Make weather

    @weather = RPG::Weather.new(@viewport1)

    # Make picture sprites

    @picture_sprites = []

    for i in 1..50

      @picture_sprites.push(Sprite_Picture.new(@viewport2,

        $game_screen.pictures[i]))

    end

    # Make timer sprite

    @timer_sprite = Sprite_Timer.new

    # Frame update

    update

  end

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

  # * Dispose

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

  def dispose

    # Dispose of tilemap

    @tilemap.tileset.dispose

    for i in 0..6

      @tilemap.autotiles[i].dispose

    end

    @tilemap.dispose

    # Dispose of panorama plane

    @panorama.dispose

    # Dispose of fog plane

    @fog.dispose

    # Dispose of character sprites

    for sprite in @character_sprites

      sprite.dispose

    end

    # Dispose of weather

    @weather.dispose

    # Dispose of picture sprites

    for sprite in @picture_sprites

      sprite.dispose

    end

    # Dispose of timer sprite

    @timer_sprite.dispose

    # Dispose of viewports

    @viewport1.dispose

    @viewport2.dispose

    @viewport3.dispose

  end

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

  # * Frame Update

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

  def update

    center

    # If panorama is different from current one

    if @panorama_name != $game_map.panorama_name or

       @panorama_hue != $game_map.panorama_hue

      @panorama_name = $game_map.panorama_name

      @panorama_hue = $game_map.panorama_hue

      if @panorama.bitmap != nil

        @panorama.bitmap.dispose

        @panorama.bitmap = nil

      end

      if @panorama_name != ""

        @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)

      end

      Graphics.frame_reset

    end

    # If fog is different than current fog

    if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue

      @fog_name = $game_map.fog_name

      @fog_hue = $game_map.fog_hue

      if @fog.bitmap != nil

        @fog.bitmap.dispose

        @fog.bitmap = nil

      end

      if @fog_name != ""

        @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)

      end

      Graphics.frame_reset

    end

    # Update tilemap

    @tilemap.ox = $game_map.display_x / 4

    @tilemap.oy =  $game_map.display_y / 4

    @tilemap.update

    # Update panorama plane

    @panorama.ox =  $game_map.display_x / 8

    @panorama.oy =  $game_map.display_y / 8

    # Update fog plane

    @fog.zoom_x = $game_map.fog_zoom / 100.0

    @fog.zoom_y = $game_map.fog_zoom / 100.0

    @fog.opacity = $game_map.fog_opacity

    @fog.blend_type = $game_map.fog_blend_type

    @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox

    @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy

    @fog.tone = $game_map.fog_tone

    # Update character sprites

    for sprite in @character_sprites

      sprite.update

    end

    # Update weather graphic

    @weather.type = $game_screen.weather_type

    @weather.max = $game_screen.weather_max

    @weather.ox = $game_map.display_x / 4

    @weather.oy = $game_map.display_y / 4

    @weather.update

    # Update picture sprites

    for sprite in @picture_sprites

      sprite.update

    end

    # Update timer sprite

    @timer_sprite.update

    # Set screen color tone and shake position

    @viewport1.tone = $game_screen.tone

    @viewport1.ox = $game_screen.shake

    # Set screen flash color

    @viewport3.color = $game_screen.flash_color

    # Update viewports

    @viewport1.update

    @viewport3.update

  end

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

  # * Set Map Display Position to Center of Screen

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

  def center

    x = $game_player.real_x

    y = $game_player.real_y

    max_x = [($game_map.width - RES_WIDTH / 32) * 128, RES_WIDTH].max

    max_y = [($game_map.height - RES_HEIGHT / 32) * 128, RES_HEIGHT].max

    center_x = (RES_WIDTH/2 - 16) * 4   # Center screen x-coordinate * 4

    center_y = (RES_HEIGHT/2 - 16) * 4   # Center screen y-coordinate * 4

    $game_map.display_x = [0, [x - center_x, max_x].min].max

    $game_map.display_y = [0, [y - center_y, max_y].min].max

    $game_map.refresh

  end

end

 

 

 

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

# ** Window_SaveFile

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

#  This window displays save files on the save and load screens.

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

 

class Window_SaveFile < Window_Base

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

  # * Public Instance Variables

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

  attr_reader   :filename                 # file name

  attr_reader   :selected                 # selected

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

  # * Object Initialization

  #     file_index : save file index (0-3)

  #     filename   : file name

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

  def initialize(file_index, filename, position)

    super(0, 64 + position * 52, 115, 52)

    self.contents = Bitmap.new(width - 32, height - 32)

    @file_index = file_index

    @filename = Customization::SLOT_NAME + "#{@file_index + 1}.rxdata"

    @time_stamp = Time.at(0)

    @file_exist = FileTest.exist?(@filename)

    if @file_exist

      file = File.open(@filename, "r")

      @time_stamp = file.mtime

      @characters = Marshal.load(file)

      @frame_count = Marshal.load(file)

      @game_system = Marshal.load(file)

      @game_switches = Marshal.load(file)

      @game_variables = Marshal.load(file)

      @total_sec = @frame_count / Graphics.frame_rate

      file.close

    end

    refresh

    @selected = false

  end

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

  # * Refresh

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

  def refresh

    self.contents.clear

    if @file_exist

      # Draw file number

      self.contents.font.color = normal_color

      bitmap = RPG::Cache.icon(Customization::SLOT_ICON_SELECTED)

      @opacity = 255

    else

      self.contents.font.color = disabled_color

      bitmap = RPG::Cache.icon(Customization::SLOT_ICON_UNSELECTED)

      @opacity = 100

    end

    name = Customization::SLOT_NAME + "#{@file_index + 1}"

    self.contents.draw_text(20, -7, 600, 32, name)

    @name_width = contents.text_size(name).width

    self.contents.fill_rect(0, -2, 10, 32, Color.new(0, 0, 0, 0))

    self.contents.blt(0, -2, bitmap, Rect.new(0, 0, 24, 24), opacity)

  end

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

  # * Set Selected

  #     selected : new selected (true = selected, false = unselected)

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

  def selected=(selected)

    @selected = selected

    update_cursor_rect

  end

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

  # * Cursor Rectangle Update

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

  def update_cursor_rect

    if @selected

      self.cursor_rect.set(0, -7, @name_width + 38, 32)

    else

      self.cursor_rect.empty

    end

  end

end

 

 

 

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

# ** Window_FileInfo

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

#  This window displays file information.

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

 

class Window_FileInfo < Window_Base

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

  # * Alias Listing

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

  if @law_save_resume_done_before.nil?

    alias nr_dispose dispose

    @law_save_resume_done_before = true

  end

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

  # * Object Initialization

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

  def initialize

    super(115, 64, 525, 416)

    self.contents = Bitmap.new(width - 32, height - 32)

    refresh($game_temp.last_file_index)

  end

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

  # * Refresh

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

  def refresh(file_index)

    self.contents.clear

    @spriteset.dispose unless @spriteset.nil?

    @spriteset = nil

    @file_index = file_index

    @filename = Customization::SLOT_NAME + "#{@file_index + 1}.rxdata"

    @file_exist = FileTest.exist?(@filename)

    save_data = Customization::SLOTS

    # If save file exists

    if @file_exist

      file = File.open(@filename, "rb")

      $time_stamp =        file.mtime

      $characters =        Marshal.load(file)

      @frame_count =       Marshal.load(file)

      $game_system = Marshal.load(file)

      $game_switches = Marshal.load(file)

      $game_variables = Marshal.load(file)

      $game_self_switches =  Marshal.load(file)

      $game_screen = Marshal.load(file)

      $game_actors = Marshal.load(file)

      $game_party = Marshal.load(file)

      $game_troop = Marshal.load(file)

      $game_map = Marshal.load(file)

      $game_player = Marshal.load(file)

      file.close

      @total_sec = @frame_count / Graphics.frame_rate

      # Draw Screenshot

      begin

        $WORLD = RPG::Cache.picture("#{$game_variables[28]}_World")

        width = 352 + 4

        height = 160 + 4

        x = (self.width - 32 - width) / 2

        y = 54 - 16

        self.contents.blt(x, y, $WORLD, Rect.new(0, 0, width, height))

        #@spriteset = Spriteset_Map_Loading_Preview.new

      end

      # Draw Gold

      if Customization::DRAW_GOLD

        cx = contents.text_size($data_system.words.gold).width

        self.contents.font.color = normal_color

        self.contents.font.size = 25

        self.contents.draw_text(40, 0, 140, 32, $game_party.gold.to_s, 2)

        self.contents.font.color = system_color

        self.contents.draw_text(140, 0, 100, 32, $data_system.words.gold, 2)

        self.contents.draw_text(-20, -1, 100, 32, Customization::GOLD_TEXT, 2)  

      end

      # Draw actor face

      if Customization::DRAW_FACE

        for i in 0...$game_party.actors.size

          actor = $game_party.actors[i]

          draw_actor_face_graphic(actor, i*129, 250)

        end  

      end

      # Draw actor name

      if Customization::DRAW_NAME

        for i in 0...$game_party.actors.size

          self.contents.font.color = system_color

          self.contents.font.size = 25

          actor = $game_party.actors[i]

          draw_actor_name(actor, (i*130) + 25, 350)

        end 

      end

      # Draw play time

      if Customization::DRAW_PLAYTIME

        hour = @total_sec / 60 / 60

        min = @total_sec / 60 % 60

        sec = @total_sec % 60

        time_string = sprintf("%02d:%02d:%02d", hour, min, sec)

        self.contents.font.color = normal_color

        self.contents.font.size = 25

        self.contents.draw_text(380, 0, 100, 32, time_string, 2)

        self.contents.font.color = system_color

        time_string = Customization::PLAYTIME_TEXT

        self.contents.draw_text(230, 0, 150, 32, time_string, 2)

      end

      # Draw Location

      if Customization::DRAW_LOCATION

        self.contents.font.color = system_color

        self.contents.font.size = 25

        self.contents.draw_text(4, 210, 120, 32, Customization::LOCATION_TEXT)

        self.contents.font.color = normal_color

        x = (Customization::LOCATION_TEXT.length * 10) + 5

        self.contents.draw_text(x, 210, 120, 32, $game_map.name.to_s, 2)

      end

    else

      self.contents.draw_text(-20, 50, self.contents.width, self.contents.height - 200, Customization::EMPTY_SLOT_TEXT, 1)

    end

  end

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

  # * Draw Actor Face Graphic

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

  def draw_actor_face_graphic(actor, x, y)

    bitmap = RPG::Cache.picture(actor.id.to_s)

    self.contents.blt(x, y, bitmap, Rect.new(0, 0, bitmap.width, bitmap.height))

  end

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

  # * Dispose Window

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

  def dispose(*args)

    nr_dispose(*args)

    @spriteset.dispose unless @spriteset.nil?

    @spriteset = nil

  end

end

 

 

 

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

# ** Scene_File

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

#  This is a superclass for the save screen and load screen.

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

 

class Scene_File

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

  # * Invariables

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

  CENTER_X = (320 - 16) * 4   # Center screen x-coordinate * 4

  CENTER_Y = (240 - 16) * 4   # Center screen y-coordinate * 4

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

  # * Object Initialization

  #     help_text : text string shown in the help window

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

  def initialize(help_text)

    @help_text = help_text

  end

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

  # * Main Processing

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

  def main

    @cursor_displace = 0

    # Make help window

    @help_window = Window_Help.new

    @help_window.set_text(@help_text)

    @help_window.opacity = Customization::WINDOW_OPACITY

    # Make save file window

    @savefile_windows = []

    for i in 0..Customization::SLOTS - 1

      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))

    end

    # Select last file to be operated

    @file_index = $game_temp.last_file_index

    @savefile_windows[@file_index].selected = true

    for i in @savefile_windows

      i.opacity = Customization::WINDOW_OPACITY

    end

    # Make FileInfo window

    @fileinfo_window = Window_FileInfo.new

    @fileinfo_window.opacity = Customization::WINDOW_OPACITY

    # Make background

    @sprite = Sprite.new

    @sprite.bitmap = RPG::Cache.picture(Customization::BACKGROUND_IMAGE)

    # Execute transition

    Graphics.transition

    # Main loop

    loop do

      # Update game screen

      Graphics.update

      # Update input information

      Input.update

      # Frame update

      update

      # Abort loop if screen is changed

      if $scene != self

        break

      end

    end

    # Prepare for transition

    Graphics.freeze

    # Dispose of windows

    @help_window.dispose

    for i in @savefile_windows

      i.dispose

    end

    @fileinfo_window.dispose

    @sprite.dispose

    @sprite.bitmap.dispose

   # $game_player.center($game_player.x, $game_player.y)

  end

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

  # * Frame Update

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

  def update

    # Update windows

    @help_window.update

    @fileinfo_window.update

    for i in @savefile_windows

      i.update

    end    

    # If C button was pressed

    if Input.trigger?(Input::C)

      # Call method: on_decision (defined by the subclasses)

      on_decision(make_filename(@file_index))

      $game_temp.last_file_index = @file_index

      @fileinfo_window.refresh(@file_index)

      center

      return

    end

    # If B button was pressed

    if Input.trigger?(Input::B)

      # Call method: on_cancel (defined by the subclasses)

      on_cancel

      return

    end

    # If the down directional button was pressed

    if Input.repeat?(Input::DOWN)

      if Input.trigger?(Input::DOWN) or @file_index < Customization::SLOTS - 1

      if @file_index == Customization::SLOTS - 1

        $game_system.se_play($data_system.buzzer_se)

        return

      end

      @cursor_displace = @file_index

      @cursor_displace += 1

      if @cursor_displace == 8

        @cursor_displace = 7

        for i in @savefile_windows

        i.dispose

        end

        @savefile_windows = []

        for i in 0..Customization::SLOTS

        f = i - 6 + @file_index

        name = make_filename(f)

        @savefile_windows.push(Window_SaveFile.new(f, name, i))

        @savefile_windows[i].selected = false

        end

      end

      $game_system.se_play($data_system.cursor_se)

      @file_index = (@file_index + 1)

      if @file_index == 8

        @file_index = 7

      end

      for i in 0..Customization::SLOTS - 1

        @savefile_windows[i].selected = false

      end

      @savefile_windows[@cursor_displace].selected = true

      @fileinfo_window.refresh(@file_index)

      return

      end

    end

    # If the up directional button was pressed

    if Input.repeat?(Input::UP)

      if Input.trigger?(Input::UP) or @file_index > 0

      if @file_index == 0

        $game_system.se_play($data_system.buzzer_se)

        return

      end

      @cursor_displace = @file_index

      @cursor_displace -= 1

      if @cursor_displace == -1

        @cursor_displace = 0

        for i in @savefile_windows

        i.dispose

        end

        @savefile_windows = []

        for i in 0..Customization::SLOTS

        f = i - 1 + @file_index

        name = make_filename(f)

        @savefile_windows.push(Window_SaveFile.new(f, name, i))

        @savefile_windows[i].selected = false

        end

      end

      $game_system.se_play($data_system.cursor_se)

      @file_index = (@file_index - 1)

      if @file_index == -1

        @file_index = 0

      end

      for i in 0..Customization::SLOTS - 1

        @savefile_windows[i].selected = false

      end

      @savefile_windows[@cursor_displace].selected = true

      @fileinfo_window.refresh(@file_index)

      return

      end

    end

  end

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

  # * Make File Name

  #     file_index : save file index (0-3)

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

  def make_filename(file_index)

    return Customization::SLOT_NAME + "#{file_index + 1}.rxdata"

  end

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

  # * Backup Data

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

  def backup_data

    @nr_game_system = $game_system.clone

    @nr_game_switches = $game_switches.clone

    @nr_game_variables = $game_variables.clone

    @nr_game_self_switches = $game_self_switches.clone

    @nr_game_screen = $game_screen.clone

    @nr_game_actors = $game_actors.clone

    @nr_game_party = $game_party.clone

    @nr_game_troop = $game_troop.clone

    @nr_game_map = $game_map.clone

    @nr_game_player = $game_player.clone

  end

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

  # * Load Backup Data

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

  def load_backup_data

    $game_system = @nr_game_system.clone

    $game_switches = @nr_game_switches.clone

    $game_variables = @nr_game_variables.clone

    $game_self_switches = @nr_game_self_switches.clone

    $game_screen = @nr_game_screen.clone

    $game_actors = @nr_game_actors.clone

    $game_party = @nr_game_party.clone

    $game_troop = @nr_game_troop.clone

    $game_map = @nr_game_map.clone

    $game_player = @nr_game_player.clone

  end

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

  # * Set Map Display Position to Center of Screen

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

  def center

    max_x = ($game_map.width - 20) * 128

    max_y = ($game_map.height - 15) * 128

    x = $game_player.x

    y = $game_player.y

    $game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max

    $game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max

  end

end

 

 

 

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

# ** Scene_Save

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

#  This class performs save screen processing.

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

 

class Scene_Save < Scene_File

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

  # * Alias Listing

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

  alias law_css_scene_save_initialize initialize

  alias nr_css_scene_save_on_cancel on_cancel

  alias nr_css_scene_save_on_desision on_decision

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

  # * Object Initialization

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

  def initialize(*args)

    backup_data

    law_css_scene_save_initialize(*args)

    super(Customization::SAVE_TEXT)

  end

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

  # * On Decision

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

  def on_decision(*args)

    load_backup_data

    nr_css_scene_save_on_desision(*args)

    center

  end

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

  # * On Decision

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

  def on_cancel(*args)

    load_backup_data

    nr_css_scene_save_on_cancel(*args)

  end

end

 

 

 

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

# ** Scene_Load

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

#  This class performs load screen processing.

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

 

class Scene_Load < Scene_File

  

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

  # * Alias Listing

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

  if @nr_css_done_before.nil?

    alias law_css_scene_load_initialize initialize

    @nr_css_done_before = true

  end

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

  # * Object Initialization

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

  def initialize(*args)

    law_css_scene_load_initialize(*args)

    super(Customization::LOAD_TEXT)

  end

end

 

 

 

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

# ** Scene_Title

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

#  This class performs title screen processing.

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

 

class Scene_Title

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

  # * Main Processing

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

  def main

    # If battle test

    if $BTEST

      battle_test

      return

    end

    # Load database

    $data_actors        = load_data("Data/Actors.rxdata")

    $data_classes       = load_data("Data/Classes.rxdata")

    $data_skills        = load_data("Data/Skills.rxdata")

    $data_items         = load_data("Data/Items.rxdata")

    $data_weapons       = load_data("Data/Weapons.rxdata")

    $data_armors        = load_data("Data/Armors.rxdata")

    $data_enemies       = load_data("Data/Enemies.rxdata")

    $data_troops        = load_data("Data/Troops.rxdata")

    $data_states        = load_data("Data/States.rxdata")

    $data_animations    = load_data("Data/Animations.rxdata")

    $data_tilesets      = load_data("Data/Tilesets.rxdata")

    $data_common_events = load_data("Data/CommonEvents.rxdata")

    $data_system        = load_data("Data/System.rxdata")

    # Make system object

    $game_system = Game_System.new

    # Make title graphic

    @sprite = Sprite.new

    @sprite.bitmap = RPG::Cache.title($data_system.title_name)

    # Make command window

    s1 = "New Game"

    s2 = "Continue"

    s3 = "Shutdown"

    @command_window = Window_Command.new(192, [s1, s2, s3])

    @command_window.back_opacity = 160

    @command_window.x = 320 - @command_window.width / 2

    @command_window.y = 288

    # Continue enabled determinant

    # Check if at least one save file exists

    # If enabled, make @continue_enabled true; if disabled, make it false

    @continue_enabled = false

    for i in 0..Customization::SLOTS

      if FileTest.exist?(Customization::SLOT_NAME + "#{i + 1}.rxdata")

        @continue_enabled = true

      end

    end

    # If continue is enabled, move cursor to "Continue"

    # If disabled, display "Continue" text in gray

    if @continue_enabled

      @command_window.index = 1

    else

      @command_window.disable_item(1)

    end

    # Play title BGM

    $game_system.bgm_play($data_system.title_bgm)

    # Stop playing ME and BGS

    Audio.me_stop

    Audio.bgs_stop

    # Execute transition

    Graphics.transition

    # Main loop

    loop do

      # Update game screen

      Graphics.update

      # Update input information

      Input.update

      # Frame update

      update

      # Abort loop if screen is changed

      if $scene != self

        break

      end

    end

    # Prepare for transition

    Graphics.freeze

    # Dispose of command window

    @command_window.dispose

    # Dispose of title graphic

    @sprite.bitmap.dispose

    @sprite.dispose

  end

end
 

Atoa

Member

@MayorAnime
The Victory Windows were all changed (due to changes on the the battle) and i've got no errors with them.
BTW.: i'm already translating all the script (for the ones that don't know, my native language isn't english, and i first make the script on it to lonly then translate to english)

(does that mean that he would get 3 x 4 = 12 EXP?)
Removing the EXP division simply makes all actors gain the same exp as it set on database.
If a monster is set to give 16 exp, it will give 16 exp to all actors regradless to the party size.

If you set to divide the exp, an monster that gives 16 exp, will give 16 / current party size.
If the party has only one member, it mas no diference at all. (16 / 1 = 16)
 
Atoa":3e4kvogn said:
@MayorAnime
The Victory Windows were all changed (due to changes on the the battle) and i've got no errors with them.
BTW.: i'm already translating all the script (for the ones that don't know, my native language isn't english, and i first make the script on it to lonly then translate to english)

So that means that the next update will fix that error, correct?

I have noticed something else, and it could be me configuring things incorrectly, but the enemies I've fought so far only have 1EXP, and yet my character gets 2 EXP for them. I've searched the scripts, but is there an EXP multiplier I am not seeing? Thanks again!
 
Is the "Force Action" event command not usable with the ATB? I've been trying to create a boss and the Force Action command is ignored entirely or the game freezes if I have "Execute Now" enabled.
 

Atoa

Member

@Lurker77
Humm... i didn't never tested the Force Action + ATB. This glitch happens only if "Wait_Action_End = true" in any case the changes of structure i've made on the system fixed this error (i just tested it now).
 
I think im going to use this combat script for my game, its trully impressive. But for my projects i have scripted a lot for the default battle system, and some thing or ideas you don't have(others yes). I will start porting/doing all the things to your engine, but if complete this i dont have any problem in make public my own addons to the engine.
¿any sugerence or problem? ¿its internally a lot different that the default?

I will try to make it all my scripts fully compatible.

pd: something is wrong. Menuequipleft and menustats dont work well before drawing the name and level.

I only added this before main:
class Font
alias font_fix_initialize initialize
def initialize
font_fix_initialize
self.name = "Arial" # Nombre de la fuente
self.size = 25 # Tamaño
end
end
 

Atoa

Member

@gerrtunk
The next update will break most of the chains that ties the ACBS with the default battle system.
There's already a lot of CBS with the structure of default system, so i'm going on an different path. Compatibility with system for default system will be really low since i'm rewritting most of the battle structure.
On the other hand, it already have a lot of built in features and tons of add-ons, currently it haves 37 add-ons, 3 utilities (scripts from other authors modified to work with the battle) and 3 patchs. And this number will only increase.

Anything for the engine would be welcome : D
It would be good if more people made add-ons for the acbs, but since i don't comment the script it's really hard for people to do that '-'/
If you need any help porting any system to the ACBS i will gladly help.
 
Hey atoa,I'm trying to use blitz on another game. at first blitz worked .
but now..........:
when i use the skill blitz add-on and i put the skill there,nothing happens(no blitz).
When i use the old one of my older project,i get the blitz but the buttons are different then the ones in the script for some reason.

(skill 125,156)

New script:
#==============================================================================
# Skill Blitz
# By Atoa
# Based on Claimh Blitz Script
#==============================================================================
# With this script, you must make an command input before the skills
#
# When the input fail, the skill may fail or have the damage reduce.
# (it can be set individually for each skill)
#==============================================================================

module Atoa

# Keyborard setting (don't change unless you know what you doing)
A = Input::A # Keyborard:Z
B = Input::B # Keyborard:X
C = Input::C # Keyborard:C
X = Input::X # Keyborard:A
Y = Input::Y # Keyborard:S
Z = Input::Z # Keyborard:D
L = Input::L # Keyborard:Q
R = Input::R # Keyborard:W
UP = Input::UP
DOWN = Input::DOWN
LEFT = Input::LEFT
RIGHT = Input::RIGHT

# Time for each input
Key_Sec = 1.0

# Configuration of the input exhibition.
Keyboard_Type = true
# true = keyboard exhibition (Ex.: X = keyboard X)
# false = input exhibition (Ex.: X = keyboard A)

# Settings for command input for skill with cast time
# Works only with the scripts Atoa ATB our Atoa CTB
Blitz_Aftercast = false
# true = Command Input is made after cast time
# false = Command Input is made before cast time

# Graphic file name of the Blitz Bar, must be on the Graphic/Windowskins folder
Blitz_Bar_Name = 'BLITZMeter'

# Type of Bar advance.
Bar_Advance_Type = 0
# 0 = the bar increase
# 1 = the bar decrease

# Input display position
Input_Display_Position = 0
# 0 = Default, not centralized
# 1 = Default, centralized
# 2 = Customized

# Postion of the input display if Input_Display_Position = 2
Custom_Diplay_Postion = [[320,180],[320,180],[320,180],[320,180]]

# Sound file used when the input fails
Input_Fail_Sound = '003-System03'

# Sound file used when the input succeceds
Input_Success_Sound = '007-System07'

# Message shown when the input fails
Input_Fail_Message = 'Failed'

# Message shown when the input succeceds
Input_Success_Message = 'Success!'

# ID of the animation used when the input fails
Input_Fail_Anim = 4

# Skill setting
Blitz_Skill = {
# Skill ID => [[Key 1, Key 2,...], Cancel, Power)]
# Skill_ID: ID of the Skill
# Key 1, Key 2,...: Input order.
# Cancel: set if the skill will canceled
# true = the skill isn't used if the input fail
# false = the skill is used even if the input fail
# Power: Power rate if the input fail, only valid if Cancel = false
125 => [[UP,DOWN], true, 50],
126 => [[X,C,Z], true, 50],
9 => [[DOWN,X,A,B], true, 50],
10 => [[LEFT,UP], true, 50],
11 => [[L,X,R], true, 50],
12 => [[X,C,RIGHT,R], true, 50],
13 => [[UP,RIGHT], true, 50],
14 => [[L,Z,A], true, 50],
15 => [[R,X,X,DOWN], true, 50],
16 => [[DOWN, RIGHT], true, 50],
17 => [[A,B,C], true, 50],
18 => [[Y,X,DOWN,B], true, 50],
19 => [[LEFT,DOWN], true, 50],
20 => [[Z,Y,A], true, 50],
21 => [[B,C,X,L], true, 50],
22 => [[RIGHT,DOWN], true, 50],
23 => [[A,B,R], true, 50],
24 => [[X,Y,LEFT,R], true, 50],
25 => [[LEFT,RIGHT], true, 50],
26 => [[X,L,B], true, 50],
27 => [[LEFT,X,C,Z], true, 50],
28 => [[LEFT,DOWN], true, 50],
29 => [[C,X,A], true, 50],
30 => [[X,Z,C,UP], true, 50],
31 => [[UP,DOWN,X], true, 50],
32 => [[LEFT,RIGHT,L,R], true, 50],
57 => [[A, C], true, 50],
58 => [[C, X, UP], true, 50],
59 => [[A, UP, RIGHT, A], true, 50],
60 => [[Z, C, A, B], true, 50],
61 => [[X, C], true, 50],
62 => [[UP, X, DOWN], true, 50],
63 => [[LEFT, C, Y, A], true, 50],
64 => [[X, C, Y, A], true, 50],
65 => [[Y, A], true, 50],
66 => [[RIGHT, B, A], true, 50],
67 => [[LEFT, UP, Z, A], true, 50],
68 => [[Y, B, Y, A], true, 50],
69 => [[LEFT, A], true, 50],
70 => [[A, C, A], true, 50],
71 => [[B, B, A, A], true, 50],
72 => [[A, B, X, Y], true, 50],
73 => [[X, A], true, 50],
74 => [[Y, A, B], true, 50],
75 => [[LEFT, RIGHT, Y, A], true, 50],
76 => [[A, C, L, A], true, 50],
77 => [[R, X], true, 50],
78 => [[L, C, R], true, 50],
79 => [[LEFT, L, RIGHT, R], true, 50],
80 => [[C, C, Z, RIGHT], true, 50],
}

end

#==============================================================================
# ■ Atoa Module
#==============================================================================
$atoa_script = {} if $atoa_script.nil?
$atoa_script['Atoa Blitz'] = true

#==============================================================================
# ■ Input
#==============================================================================
module Input
#--------------------------------------------------------------------------
module_function
#--------------------------------------------------------------------------
def n_trigger?(num)
if trigger?(num)
return false
elsif trigger?(A) or trigger?(B) or trigger?(C) or
trigger?(X) or trigger?(Y) or trigger?(Z) or
trigger?(L) or trigger?(R) or
trigger?(UP) or trigger?(DOWN) or trigger?(RIGHT) or trigger?(LEFT)
return true
end
return false
end
#--------------------------------------------------------------------------
def key_converter(key)
if Atoa::Keyboard_Type
case key
when A
return 'Z'
when B
return 'X'
when C
return 'C'
when X
return 'A'
when Y
return 'S'
when Z
return 'D'
when L
return 'Q'
when R
return 'W'
end
else
case key
when A
return 'A'
when B
return 'B'
when C
return 'C'
when X
return 'X'
when Y
return 'Y'
when Z
return 'Z'
when L
return 'R'
when R
return 'L'
end
end
case key
when UP
return '↑'
when DOWN
return '↓'
when LEFT
return '←'
when RIGHT
return '→'
end
end
end

#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
attr_accessor :blitz_flag
#--------------------------------------------------------------------------
alias atoa_initialize_blitz initialize
def initialize
atoa_initialize_blitz
@blitz_flag = false
end
#--------------------------------------------------------------------------
alias atoa_skill_effect_blitz skill_effect
def skill_effect(user, skill)
set_tatic_hp(user)
result = atoa_skill_effect_blitz(user, skill)
set_blitz_damage(user, skill)
return result
end
#--------------------------------------------------------------------------
def set_tatic_hp(user)
if $scene.is_a?(Scene_Battle) and user.blitz_flag
@hp_blitz = self.hp
@sp_blitz = self.sp
end
end
#--------------------------------------------------------------------------
def set_blitz_damage(user, skill)
if $scene.is_a?(Scene_Battle) and user.blitz_flag
self.damage = (self.damage * Blitz_Skill[skill.id][2]) / 100
self.hp = @hp_blitz - self.damage unless self.sp_damage
self.sp = @sp_blitz - self.damage if self.sp_damage
end
end
end

#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
alias atoa_update_phase4_step2_blitz update_phase4_step2
def update_phase4_step2
atoa_update_phase4_step2_blitz
@active_battler.blitz_flag = false
if @active_battler.actor? and @active_battler.current_action.kind == 1 and
Blitz_Skill[@active_battler.current_action.skill_id] != nil
if ($atoa_script['Atoa ATB'] or $atoa_script['Atoa CTB'])
return if Blitz_Aftercast and @active_battler.casting
return if !Blitz_Aftercast and !@active_battler.casting
end
result = make_blitz_result
if result and Blitz_Skill[@active_battler.current_action.skill_id][1]
blitz_fail_anime
@phase4_step = 6
if $atoa_script['Atoa ATB']
@active_battler.cast_action = nil
elsif $atoa_script['Atoa CTB']
@active_battler.cast_action = nil
@action_cost = No_Action_Cost
end
end
end
end
#--------------------------------------------------------------------------
def blitz_fail_anime
unless Input_Fail_Anim == 0
@active_battler.animation_id = Input_Fail_Anim
@active_battler.animation_hit = true
wait($data_animations[Input_Fail_Anim].frame_max * 2)
end
end
#--------------------------------------------------------------------------
def make_blitz_result
blitz_skill = Blitz_Skill[@active_battler.current_action.skill_id][0]
time = Key_Sec * blitz_skill.size * Graphics.frame_rate
key_count = 0
@active_battler.blitz_flag = true
case Input_Display_Position
when 0
actor_x = (@active_battler.index * 156) - (@active_battler.index * 38)
actor_y = 192
when 1
actor_x = (((640 / Max_Party) * ((4 - $game_party.actors.size)/2.0 + @active_battler.index)).floor) - (@active_battler.index * 40)
actor_y = 192
when 2
actor_x = Custom_Diplay_Postion[@active_battler.index][0]
actor_y = Custom_Diplay_Postion[@active_battler.index][0]
end
img = RPG::Cache.windowskin(Blitz_Bar_Name)
imgw = img.width
img.dispose
skill_name = $data_skills[ @active_battler.current_action.skill_id].name
window_keycount = Window_KeyCount.new(blitz_skill, @active_battler.name, skill_name)
window_counter = Window_KeyCounter.new(actor_x, actor_y + 80, imgw + 32, 64)
window_keycount.x = actor_x
window_keycount.y = actor_y
for i in 0...time
if Input.trigger?(blitz_skill[key_count])
key_count += 1
window_keycount.key_in(@active_battler.name, skill_name)
elsif Input.n_trigger?(blitz_skill[key_count])
break
end
if key_count >= blitz_skill.size
window_keycount.text_in(Input_Success_Message, @active_battler.name, skill_name)
Audio.se_play('Audio/SE/' + Input_Success_Sound)
@active_battler.blitz_flag = false
break
end
window_counter.refresh((i * imgw / time), imgw)
update_basic
end
if @active_battler.blitz_flag
window_keycount.text_in(Input_Fail_Message, @active_battler.name, skill_name)
Audio.se_play('Audio/SE/' + Input_Fail_Sound)
end
wait(10)
window_keycount.dispose
window_counter.dispose
return @active_battler.blitz_flag
end
end

#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
def draw_counter_bar(x, y, current)
bitmap = RPG::Cache.windowskin(Blitz_Bar_Name)
cw = bitmap.width
ch = bitmap.height / 2
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x, y, bitmap, src_rect)
cw = bitmap.width * current / bitmap.width
src_rect = Rect.new(0, ch, cw, ch)
self.contents.blt(x, y, bitmap, src_rect)
end
end

#==============================================================================
# ■ Window_KeyCounter
#==============================================================================
class Window_KeyCounter < Window_Base
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.z = 4000
refresh(0, width - 32)
end
#--------------------------------------------------------------------------
def refresh(current, w)
self.contents.clear
draw_counter_bar(0, 0, current) if Bar_Advance_Type == 0
draw_counter_bar(0, 0, w - current) if Bar_Advance_Type == 1
end
end

#==============================================================================
# ■ Window_KeyCount
#==============================================================================
class Window_KeyCount < Window_Base
#--------------------------------------------------------------------------
def initialize(key, battler_name, skill_name)
super(0, 0, 280, 128)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = Base_Opacity
self.z = 4000
@key = key
@key_count = 0
refresh(battler_name, skill_name)
end
#--------------------------------------------------------------------------
def refresh(battler_name, skill_name)
self.contents.clear
self.contents.draw_text(0, 0, 240, 32, battler_name)
self.contents.font.color = system_color
self.contents.draw_text(0, 24, 240, 32, skill_name)
for i in 0...@key.size
x = i * 32
if i < @key_count
self.contents.font.color = knockout_color
else
self.contents.font.color = normal_color
end
self.contents.draw_text(x, 48, 100, 32, Input.key_converter(@key))
end
end
#--------------------------------------------------------------------------
def key_in(battler_name, skill_name)
@key_count += 1
refresh(battler_name, skill_name)
end
#--------------------------------------------------------------------------
def text_in(text, battler_name, skill_name)
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 240, 32, battler_name)
self.contents.font.color = system_color
self.contents.draw_text(0, 24, 240, 32, skill_name)
self.contents.font.color = text == Input_Success_Message ? crisis_color : knockout_color
self.contents.draw_text(0, 48, 240, 32, text)
end
end


Old script:

#==============================================================================
# Skill Blitz
# By Atoa
# Based on Claimh Blitz Script
#==============================================================================
# With this script, you must make an command input before the skills
#
# When the input fail, the skill may fail or have the damage reduce.
# (it can be set individually for each skill)
#==============================================================================

module Atoa

# Keyborard setting (don't change unless you know what you doing)
A = Input::A # Keyborard:Z
B = Input::B # Keyborard:X
C = Input::C # Keyborard:C
X = Input::X # Keyborard:A
Y = Input::Y # Keyborard:S
Z = Input::Z # Keyborard:D
L = Input::L # Keyborard:Q
R = Input::R # Keyborard:W
UP = Input::UP
DOWN = Input::DOWN
LEFT = Input::LEFT
RIGHT = Input::RIGHT

# Time for each input
Key_Sec = 0.35

# Configuration of the input exhibition.
Keyboard_Type = true
# true = keyboard exhibition (Ex.: X = keyboard X)
# false = input exhibition (Ex.: X = keyboard A)

# Settings for command input for skill with cast time
# Works only with the scripts Atoa ATB our Atoa CTB
Blitz_Aftercast = true
# true = Command Input is made after cast time
# false = Command Input is made before cast time

# Graphic file name of the Blitz Bar, must be on the Graphic/Windowskins folder
Blitz_Bar_Name = 'BLITZMeter'

# Type of Bar advance.
Bar_Advance_Type = 0
# 0 = the bar increase
# 1 = the bar decrease

# Input display position
Input_Display_Position = 0
# 0 = Default, not centralized
# 1 = Default, centralized
# 2 = Customized

# Postion of the input display if Input_Display_Position = 2
Custom_Diplay_Postion = [[320,180],[320,180],[320,180],[320,180]]

# Sound file used when the input fails
Input_Fail_Sound = '003-System03'

# Sound file used when the input succeceds
Input_Success_Sound = '007-System07'

# Message shown when the input fails
Input_Fail_Message = 'Failed'

# Message shown when the input succeceds
Input_Success_Message = 'Success!'

# ID of the animation used when the input fails
Input_Fail_Anim = 4

# Skill setting
Blitz_Skill = {
# Skill ID => [[Key 1, Key 2,...], Cancel, Power)]
# Skill_ID: ID of the Skill
# Key 1, Key 2,...: Input order.
# Cancel: set if the skill will canceled
# true = the skill isn't used if the input fail
# false = the skill is used even if the input fail
# Power: Power rate if the input fail, only valid if Cancel = false

1 => [[C, Z, RIGHT], true, 50],
2 => [[X, Z, UP], true, 50],
3 => [[X, Z, UP,DOWN], true, 50],
4 => [[X, Z, UP,DOWN], true, 50],
5 => [[C, X, Z, UP,DOWN,], true, 50],
6 => [[UP,DOWN,LEFT,RIGHT], true, 50],
8 => [[X,C,Z], true, 50],
9 => [[DOWN,UP], true, 50],
10 => [[LEFT,UP], true, 50],
11 => [[L,X,R], true, 50],
12 => [[X,Z], true, 50],
13 => [[X,Z], true, 50],
14 => [[L,Z,A], true, 50],
15 => [[R,X,X,DOWN], true, 50],
16 => [[DOWN, RIGHT], true, 50],
17 => [[A,B,C], true, 50],
18 => [[Y,X,DOWN,B], true, 50],
19 => [[LEFT,DOWN], true, 50],
20 => [[Z,Y,A], true, 50],
21 => [[B,C,X,L], true, 50],
22 => [[RIGHT,DOWN], true, 50],
23 => [[A,B,R], true, 50],
24 => [[X,Y,LEFT,R], true, 50],
25 => [[LEFT,RIGHT], true, 50],
26 => [[X,L,B], true, 50],
27 => [[LEFT,X,C,Z], true, 50],
28 => [[LEFT,DOWN], true, 50],
29 => [[C,X,A], true, 50],
30 => [[X,Z,C,UP], true, 50],
31 => [[UP,DOWN,X], true, 50],
32 => [[LEFT,RIGHT,L,R], true, 50],
57 => [[A, C], true, 50],
58 => [[C, X, UP], true, 50],
59 => [[A, UP, RIGHT, A], true, 50],
60 => [[Z, C, A, B], true, 50],
61 => [[X, C], true, 50],
62 => [[UP, X, DOWN], true, 50],
63 => [[LEFT, C, Y, A], true, 50],
64 => [[X, C, Y, A], true, 50],
65 => [[Y, A], true, 50],
66 => [[RIGHT, B, A], true, 50],
67 => [[LEFT, UP, Z, A], true, 50],
68 => [[Y, B, Y, A], true, 50],
69 => [[LEFT, A], true, 50],
70 => [[A, C, A], true, 50],
71 => [[B, B, A, A], true, 50],
72 => [[A, B, X, Y], true, 50],
73 => [[X, A], true, 50],
74 => [[Y, A, B], true, 50],
75 => [[LEFT, RIGHT, Y, A], true, 50],
76 => [[A, C, L, A], true, 50],
77 => [[R, X], true, 50],
78 => [[L, C, R], true, 50],
79 => [[LEFT, L, RIGHT, R], true, 50],
80 =>[[C, C, Z, RIGHT], true, 50],

}

end

#==============================================================================
# ■ Atoa Module
#==============================================================================
$atoa_script = {} if $atoa_script.nil?
$atoa_script['Atoa Blitz'] = true

#==============================================================================
# ■ Input
#==============================================================================
module Input
#--------------------------------------------------------------------------
module_function
#--------------------------------------------------------------------------
def n_trigger?(num)
if trigger?(num)
return false
elsif trigger?(A) or trigger?(B) or trigger?(C) or
trigger?(X) or trigger?(Y) or trigger?(Z) or
trigger?(L) or trigger?(R) or
trigger?(UP) or trigger?(DOWN) or trigger?(RIGHT) or trigger?(LEFT)
return true
end
return false
end
#--------------------------------------------------------------------------
def key_converter(key)
if Atoa::Keyboard_Type
case key
when A
return 'Z'
when B
return 'X'
when C
return 'C'
when X
return 'A'
when Y
return 'S'
when Z
return 'D'
when L
return 'Q'
when R
return 'W'
end
else
case key
when A
return 'A'
when B
return 'B'
when C
return 'C'
when X
return 'X'
when Y
return 'Y'
when Z
return 'Z'
when L
return 'R'
when R
return 'L'
end
end
case key
when UP
return '↑'
when DOWN
return '↓'
when LEFT
return '←'
when RIGHT
return '→'
end
end
end

#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
attr_accessor :blitz_flag
#--------------------------------------------------------------------------
alias atoa_initialize_blitz initialize
def initialize
atoa_initialize_blitz
@blitz_flag = false
end
#--------------------------------------------------------------------------
alias atoa_skill_effect_blitz skill_effect
def skill_effect(user, skill)
set_tatic_hp(user)
result = atoa_skill_effect_blitz(user, skill)
set_blitz_damage(user, skill)
return result
end
#--------------------------------------------------------------------------
def set_tatic_hp(user)
if $scene.is_a?(Scene_Battle) and user.blitz_flag
@hp_blitz = self.hp
@sp_blitz = self.sp
end
end
#--------------------------------------------------------------------------
def set_blitz_damage(user, skill)
if $scene.is_a?(Scene_Battle) and user.blitz_flag
self.damage = (self.damage * Blitz_Skill[skill.id][2]) / 100
self.hp = @hp_blitz - self.damage unless self.sp_damage
self.sp = @sp_blitz - self.damage if self.sp_damage
end
end
end

#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
alias atoa_update_phase4_step2_blitz update_phase4_step2
def update_phase4_step2
atoa_update_phase4_step2_blitz
@active_battler.blitz_flag = false
if @active_battler.actor? and @active_battler.current_action.kind == 1 and
Blitz_Skill[@active_battler.current_action.skill_id] != nil
if ($atoa_script['Atoa ATB'] or $atoa_script['Atoa CTB'])
return if Blitz_Aftercast and @active_battler.casting
return if !Blitz_Aftercast and !@active_battler.casting
end
result = make_blitz_result
if result and Blitz_Skill[@active_battler.current_action.skill_id][1]
blitz_fail_anime
@phase4_step = 6
if $atoa_script['Atoa ATB']
@active_battler.cast_action = nil
elsif $atoa_script['Atoa CTB']
@active_battler.cast_action = nil
@action_cost = No_Action_Cost
end
end
end
end
#--------------------------------------------------------------------------
def blitz_fail_anime
unless Input_Fail_Anim == 0
@active_battler.animation_id = Input_Fail_Anim
@active_battler.animation_hit = true
wait($data_animations[Input_Fail_Anim].frame_max * 2)
end
end
#--------------------------------------------------------------------------
def make_blitz_result
blitz_skill = Blitz_Skill[@active_battler.current_action.skill_id][0]
time = Key_Sec * blitz_skill.size * Graphics.frame_rate
key_count = 0
@active_battler.blitz_flag = true
case Input_Display_Position
when 0
actor_x = (@active_battler.index * 156) - (@active_battler.index * 38)
actor_y = 192
when 1
actor_x = (((640 / Max_Party) * ((4 - $game_party.actors.size)/2.0 + @active_battler.index)).floor) - (@active_battler.index * 40)
actor_y = 192
when 2
actor_x = Custom_Diplay_Postion[@active_battler.index][0]
actor_y = Custom_Diplay_Postion[@active_battler.index][0]
end
img = RPG::Cache.windowskin(Blitz_Bar_Name)
imgw = img.width
img.dispose
skill_name = $data_skills[ @active_battler.current_action.skill_id].name
window_keycount = Window_KeyCount.new(blitz_skill, @active_battler.name, skill_name)
window_counter = Window_KeyCounter.new(actor_x, actor_y + 80, imgw + 32, 64)
window_keycount.x = actor_x
window_keycount.y = actor_y
for i in 0...time
if Input.trigger?(blitz_skill[key_count])
key_count += 1
window_keycount.key_in(@active_battler.name, skill_name)
elsif Input.n_trigger?(blitz_skill[key_count])
break
end
if key_count >= blitz_skill.size
window_keycount.text_in(Input_Success_Message, @active_battler.name, skill_name)
Audio.se_play('Audio/SE/' + Input_Success_Sound)
@active_battler.blitz_flag = false
break
end
window_counter.refresh((i * imgw / time), imgw)
update_basic
end
if @active_battler.blitz_flag
window_keycount.text_in(Input_Fail_Message, @active_battler.name, skill_name)
Audio.se_play('Audio/SE/' + Input_Fail_Sound)
end
wait(10)
window_keycount.dispose
window_counter.dispose
return @active_battler.blitz_flag
end
end

#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
def draw_counter_bar(x, y, current)
bitmap = RPG::Cache.windowskin(Blitz_Bar_Name)
cw = bitmap.width
ch = bitmap.height / 2
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x, y, bitmap, src_rect)
cw = bitmap.width * current / bitmap.width
src_rect = Rect.new(0, ch, cw, ch)
self.contents.blt(x, y, bitmap, src_rect)
end
end

#==============================================================================
# ■ Window_KeyCounter
#==============================================================================
class Window_KeyCounter < Window_Base
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.z = 4000
refresh(0, width - 32)
end
#--------------------------------------------------------------------------
def refresh(current, w)
self.contents.clear
draw_counter_bar(0, 0, current) if Bar_Advance_Type == 0
draw_counter_bar(0, 0, w - current) if Bar_Advance_Type == 1
end
end

#==============================================================================
# ■ Window_KeyCount
#==============================================================================
class Window_KeyCount < Window_Base
#--------------------------------------------------------------------------
def initialize(key, battler_name, skill_name)
super(0, 0, 280, 128)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = Base_Opacity
self.z = 4000
@key = key
@key_count = 0
refresh(battler_name, skill_name)
end
#--------------------------------------------------------------------------
def refresh(battler_name, skill_name)
self.contents.clear
self.contents.draw_text(0, 0, 240, 32, battler_name)
self.contents.font.color = system_color
self.contents.draw_text(0, 24, 240, 32, skill_name)
for i in 0...@key.size
x = i * 32
if i < @key_count
self.contents.font.color = knockout_color
else
self.contents.font.color = normal_color
end
self.contents.draw_text(x, 48, 100, 32, Input.key_converter(@key))
end
end
#--------------------------------------------------------------------------
def key_in(battler_name, skill_name)
@key_count += 1
refresh(battler_name, skill_name)
end
#--------------------------------------------------------------------------
def text_in(text, battler_name, skill_name)
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 240, 32, battler_name)
self.contents.font.color = system_color
self.contents.draw_text(0, 24, 240, 32, skill_name)
self.contents.font.color = text == Input_Success_Message ? crisis_color : knockout_color
self.contents.draw_text(0, 48, 240, 32, text)
end
end
 

Atoa

Member

@dylstew
Use the tag code when posting scripts, it's really a paint to read them with the spoiler code...
In any case, the version 3.0 is at hand, i just need finish some translations and small adjusts. So you can simply forget about the glitches on version 2.0.
All scripts were changed.
 
Atoa":q9oihrug said:
@dylstew
Use the tag code when posting scripts, it's really a paint to read them with the spoiler code...
In any case, the version 3.0 is at hand, i just need finish some translations and small adjusts. So you can simply forget about the glitches on version 2.0.
All scripts were changed.

Huzzah!

So I take it that we'll be doing complete replaces of old scripts and stuff? Will the config parts of the scripts need to be replaced and redone as well?

Thanks for everything so far, Atoa! :)
 

Atoa

Member

Script Updated to Version 3.0

Please Report Any bug found.

# Version History:
#
# V3.0 Beta 1 | 08 - 01 - 2010
# • Total reformulation on the system.
#
# • New Basic Setting:
# - Dynamic Actions
# - Custom Algorithms
# - Battle Animtions position
# - New Extra Default Pose (Danger_Defense_Pose)
#
# • New Advanced Settings:
# - Battle Animation based on the battler direction ("ANIMATIONDIRECTION/**")
# - Move options during attacks ("JUMP/**", "LIFT/**", "FALL")
# - Move options when recive damage ("DMGIMPACT/**" , "DMGBOUNCE/**", "DMGRISE/**",
# "DMGSHAKE/**", "DMGWAIT/**", "DMGSMASH", "DMGFREEZE", "DMGRELASE", "DMGANIMTIME/**")
# - Backgroun image during actions ("ACTIONPLANE/**")
# - Sounds Effects syncronized with poses (Pose_Battle_Cry)
# - Battle Animations syncronized with poses (Pose_Animation)
# - Battler graphics relative 'Center' ('Center')
#
# • Changes on the Advanced Settings:
# - Total reformulation on the settings of the "THROW" type.
# - New hide battler options ("HIDE/**")
# - New settings for the "mirage" effect ("MIRAGEADVANCE/**",
# "MIRAGERETURN/**", "MIRAGEACTION/**")
# - New settings for the custom pose ("ANIME/**", "CAST/**")
#
# • New Add-OnsNovos Add-Ons
# - Camera Movement
# - Equipment Sprite
# - Battle Advantage
# - Skills Condition
# - Automatic Actions
# - Animated Battler Sprite on Windows
#
# • Scripts Updated
# - All
 
Downloaded so fast, I think I got younger...

Looks like a total redux.

@Atoa
Will have to copy over everything, yes?
And I'll be contacting you soon about stuff, like we talked over e-mail.

Thanks a ton! Will get to bug-testing!
 

Atoa

Member

@MayorAnime
Yes all add-ons had some changes, but most of them didn't have any change on the settings, the one that had are really visible.

What you can try is to just change the code, then if it returns any "Unitialized Constant" erro, then you check the settings to see if there's any difference.
The ones i'm 100% that had chages on settings:
Atoa ATB
Atoa CTB
Skill Reflect
Skill Overdrive

These ones will really need an revision on the settings. The other changes are small.



BTW.: There was an small gitch on the demo i posted early, regading to the custom pose script calls.(this glitch occurs on the battle against Celcius). IT's already fixed now.
 
Hmmm...already have a problem integrating it into my KH game.

When I go into a battle, the Kingdom Hearts transition didn't work. The screen just faded to black and then into the battle engine. So I moved this transition script BELOW your engine scripts and ABOVE main:

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

 

Now when the battle starts, the Kingdom Hearts battle trans happens, but then engine looks like this:

2dmau5g.png


No actors, enemies, and the background is skewed badly.

Any ideas, Atoa?

EDIT: Another thing. If I hit the up, down, any arrows, nothing happens. The menu items don't move or anything. Hitting enter won't select anything. Input is not working at all.
 

Atoa

Member

@MayorAnime
Like i said, the compatibilty would be lower now.
So i suggest you to first add the battle system, then the other scripts, so you can map wich ones is causing bugs.

Since you're helping a lot with the bug fixes i can make compatibilities patchs for the scripts you're using.


Version 3.0.1 Data
ACBS 3 DATA.rar

To make things easier for people to get updates for minor bug fixes, i will provide only the data folder, so people don't need to download the whole demo again.
 
@Atoa

That is more than fair. I move the scripts below the Battle Engine, and ran the game. I tried to go into a battle from a saved file, saw the opening transition, and got this error:

x537tv.png


Here are the plugins that I have and their order. Please let me know if I have to post any code for any or all of them. I'm not shy. ;)

hrijyd.png


Thanks again for all your help. Will start posting bugs as soon as I get a free moment to test.
 

Atoa

Member

@MayorAnime
Old saves won't work anymore.
There was too many changes and most of them are initialized only when you start an new game.
 
Atoa":3pay28kg said:
@MayorAnime
Old saves won't work anymore.
There was too many changes and most of them are initialized only when you start an new game.

Okay, so when I start a new game, the same thing as before happens. The transition goes into battle, and then this:

2dmau5g.png


No actors, enemies, and the background is skewed badly. If I hit the up, down, any arrows, nothing happens. The menu items don't move or anything. Hitting enter won't select anything. Input is not working at all.

So it's the same problem as before. Is the transition plugin causing this?
 

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