Quantcast
Channel: RGSS3 Scripts (RMVX Ace) Latest Topics
Viewing all articles
Browse latest Browse all 416

RSSBSACE: Reedo's Simple Side Battle System Ace Edition

$
0
0

Reedo's Simple Side Battle System Ace Edition (RSSBSACE)
Version 1.7b
September 30, 2013
By Reedo

 
References
None. This is an original script by Reedo.
 
Description
This script is a recreation of the original RSSBS created for VX back at the end of 2009.  The script has been completely reworked for ACE.

 

RSSBSACE offers a simple, plug-and-play, side-view-battle-system with no additional resource requirements.  This script is only a visual modification to the battle system and does not add any game-play mechanics.  RSSBSACE is designed for a high-degree of compatibility with other scripts.

Features
This simple SBS provides a classic "FF"-style side-battle experience.
 
This script will:

  • Draw the party on the right side of the screen, facing left, using the actor graphic specified in the database and in a formation fitting the Ace battle background layout, or in a traditional angled line if the ACTOR_STAGGER option is set to false (v1.7b).
  • Place a shadow on the ground beneath living actors.
  • Show the actor's stepping animation on their turn and when acting, if able to take actions.
  • Make the actor step toward the enemy when taking an action other than guarding.
  • Show animations for all actor actions as defined in the database for the particular action being performed.
  • Show animations for all enemy actions as defined in the database, or a default animation if none is defined (e.g. normal attack)
  • Flash the actor red when they successfully receive a hostile action.
  • Show dead actors as faded, whitened, and rotated to lay on their back.
  • Make living actors perform a "victory dance" when the battle ends (they jump and spin).
  • Optionally "mirror" enemy images to make them face to the right.

       Version 1.2

  • Make actors step back when guarding.
  • Make actors start facing backward and jump when surprised.
  • Make actors start facing down and flashing white on preemptive strike.

       Version 1.4

  • Make actors face right and take half a step when attempting to escape from battle.

       Version 1.6

  • Show weapon or skill icon as moving (swinging, punching, or pulsing) graphic during actions.
  • Now compatible with "battle test" from within the database.

       Version 1.7

  • Provides options for weapon icons to punch, pulse or do nothing instead of swinging.
  • Ensures animations play only on the RSSBSACE on-screen actors

 

As an additional feature, the script will force the game to attempt to load a tile-based battle background for any map type, not just maps using the field tile set.  Some of the floor tiles in the other tile sets will work to generate a battle background, so this allows you to use tile-based backgrounds in more of your maps.
 
Options
There are a few options at the top of the script which can be modified to change the positioning and movement of the actors, specify the mirrored enemies, and disable the forced tile-based battle backgrounds.  In most cases there will be no need to modify any of these options, other than the list of enemies to mirror.  This option looks like:

FLIP_ENEMY = [                2, 3, 4, 5, 8, 10, 12, 13, 14, 16, 17,                18, 19, 21, 22, 23, 25, 28, 29,]

And each number is simply the ID of the enemy to flip.  This is the number preceding the enemy name in the Enemies tab of the database.
 
Screen Shots

(battle begins)

post-20483-0-44133000-1379427535_thumb.j
 

(player attacks)

post-20483-0-73386200-1379427544_thumb.j
 

(player is hit)

post-20483-0-47029900-1379427557_thumb.j
 

(victory dance)
post-20483-0-90671400-1379427568_thumb.j
 
Known Bugs
None.

Please report any found.

 

9/18 - v1.4 - Corrected crash bug on escape command.  Thanks go to Lankaino for discovering this.

9/28 - v1.7 - Corrected lock-up bug on escape failure.  Thanks go to Macatlas for discovering this.

9/29 - v1.7a - Corrected deep-copy issue with YEA Victory Aftermath. Thanks go to xdrahcir for discovering this.

9/30 - v1.7b - Corrected crash bug when actor had no weapon equipped. Thanks to comprisedpuma for finding this.
 
Requirements
None.  This is a stand-alone script.
 
Installation
Plug-and-Play
 
Just insert a new script directly under Materials, name it RSSBSACE, and paste in the script code.

 

For compatibility purposes it is typically best to insert RSSBSACE above all other scripts*.

* Note that when using Yanfly YEA Battle Engine, this script must be below the Yanfly script.
 
Configuration
The only configuration necessary will be to arrange the troops such that the enemies are on the left-hand side of the screen.
 
Go into the Troops tab of the database, select each troop used in your game and drag the enemy images to arrange them to your liking on the left side of the screen.
 
All other configuration is optional via the "User Options" section at the top of the script.
 
Compatibility

Should be compatible with most other scripts.
 
Obviously any other script which also modifies the battle scene may not be compatible, but this should mostly relate to visuals such as the placement of animations.  Any battle-addon which affect mechanics and not visuals should be compatible.
 
The original RSSBS for VX was highly compatible with other scripts.  This version follows a similar design pattern so I expect it to also be highly compatible with other scripts. 

 
A Note About YanFly Scripts
We had a good deal of success between our scripts in the past so if this one turns out to have any issues I will do my best to set some time aside to correct my script and ensure as much compatibility with Miss YanFly's as possible.

 

-Update-

According to some of the posts below, YanFly's Ace engine may already provide a side-battle system.  If so, this script would not be necessary when using YanFly's engine.

 

-Better Update!!-

This script is now confirmed compatible with Yanfly YEA Battle Engine!

 

Be sure to install this script beneath the Yanfly script.

 

9/29 - Now compatible with YEA Victory Aftermath.
 
Script
Here is the complete RSSBSACE script:
 

#################################################################################  RSSBSACE - Reedo's Simple Side Battle System (for VX ACE)##  Version 1.7b##  September 30, 2013##  By Reedo#################################################################################  REFERENCES####  None.  This is an original script by Reedo.#################################################################################  FEATURES####  + Draw the party on the right side of the screen, facing left, using the actor graphic specified in the database and in a formation fitting the Ace battle background layout.##  + Place a shadow on the ground beneath living actors.##  + Show the actor's stepping animation on their turn and when acting if able to take actions.##  + Make the actor step toward the enemy when taking an action other than guarding.##  + Show animations for all actor actions as defined in the database for the particular action being performed.##  + Show animations for all enemy actions as defined in the database, or a default animation if none is defined (e.g. normal attack)##  + Flash the actor red when they successfully receive a hostile action.##  + Show dead actors as faded, whitened, and rotated to lay on their back.##  + Make living actors perform a "victory dance" when the battle ends (they jump and spin).##  + Optionally "mirror" enemy images to make them face to the right.##    = Version 1.2 =##  + Actors step back when guarding.##  + Actors start facing backward and jump when surprised.##  + Actors start facing down and flashing white on preemptive strike.##   = Version 1.4 =##  + Actors turn and move half a step to the right when attempting to flee.##    = Version 1.6 =##  + Show weapon or skill icon as moving (swinging, punching or pulsing) graphic during actions.##    (by popular demand!)##  + Now compatible with "battle test" from within the database.##    = Version 1.7 =##  + Additional options for weapon icon movement by weapon type.##  + Corrected animations to only play on RSSBS visual battlers.##  + Corrected bug on escape (caught by Macatlas - thanks!).##  + Corrected bug on no weapon equipped (caught by comprisedpuma).###################################################################################  COMPATIBILITY####  Should be compatible with most other scripts.####  OVERWRITES (1)##    Spriteset_Battle.update_actors####  STATE CHANGES (1)##    Map scroll position (display_x, display_y) is stored and set to 0,0 when##    battle begins, and then is restored when battle ends.#################################################################################  REQUIREMENTS####  None for installation and operation.####  However, enemy troops will need to be repositioned manually in the database##  editor. This script may work best with all custom enemy images designed for##  side-battle view.#################################################################################  INSTALLATION####  Plug-and-play.####  Insert below Materials, above other add-on scripts.#################################################################################  RIGHTS & RESTRICTIONS####  As with most Reedo scripts, this script is free to re-use, as-is, ##  in personal, educational, and commercial RPGVX Ace development projects, ##  providing that:  this script is credited in writing displayed readily ##  to the user of the final compiled code assembly.####  Reedo retains all rights of intellect and ownership.##  You forego all rights of warranty by utilizing this script.################################################################################################################################################################  USER OPTIONS###############################################################################module REEDO_SBS  ACTOR_START_TOP = 6.2     # Top position (in tiles) for first actor in party  ACTOR_START_LEFT = 14.5   # Left position (in tiles) for first actor in party  ACTOR_STAGGER = true      # Enables staggered layout. Set false and chance start left to 12 for angled line.  ACTOR_STAGGER_HORZ = 1.0  # The amount to recess each actor to the right (in tiles)  ACTOR_STAGGER_VERT = 0.5  # The vertical spacing between characters (in tiles)  ACTOR_STEPS_IN_OUT = 10   # The number of steps to take when moving to attack  ACTOR_STEP_DISTANCE = 0.1 # The distance to move with each step (in tiles)    ACTOR_DEATH_OPACITY = 125   # Transparency of dead actors  ACTOR_DEATH_TONE = Tone.new(128, 128, 128, 0)  # Overlay color of dead actors  ACTOR_DEATH_ANGLE = 270     # Rotation angle of dead actor sprite  ACTOR_DEATH_OFFSET_X = -0.6 # Offset in tiles for dead actors  ACTOR_DEATH_OFFSET_Y = -0.2 # Offset in tiles for dead actors    VICTORY_DANCE_ENABLED = true      # Actors spin and jump on victory if alive and movable  VICTORY_DANCE_JUMP_HEIGHT = 1.3   # The number of tiles an actor moves upward  VICTORY_DANCE_JUMP_HOVER = 4      # The number of frames to wait in the air  VICTORY_DANCE_JUMP_WAIT = 70      # The number of frames before jumping again    ACTOR_SHADOW_IMAGE = "Shadow"       # The name of the system image to use  ACTOR_SHADOW_CUSTOM_PICTURE = nil   # The name of a resource picture to use instead; nil to use system image    PREEMPTIVE_TIME = 120   # The number of frames to flash white on preemptive strike  SURPRISE_TIME = 90      # The number of frames to jump facing backward on surprise  DAMAGE_RED_TIME = 15    # Number of frames actor turns red when damaged   ATTACK_SKILL_ID = 1     # The Id in the database for the skill used as the default attack  ENEMY_DEFAULT_ATTACK = 7    # AnimationId for enemy actions with no animation  ACTION_SPRITE_INCREMENT = 5 # The amount of movement for swinging or pulsing action icons    UNARMED_ICON = 175    # The icon to use if the actor has no weapon equipped.  UNARMED_STYLE = 2     # The style to use when there is no weapon equipped.  PUNCH_SPEED = 0.4  PUNCH_DISTANCE = 32  PULSE_WEAPON_TYPES = []         # Weapons with these weapon type ids will pulse like items or skills  NO_MOVE_WEAPON_TYPES = []       # Weapons with these weapon type ids will show without moving  PUNCH_WEAPON_TYPES = [2, 6, 10] # Weapons with these weapon type ids will move toward the enemy and back                                  # All other weapon type ids will swing    # Specify the ID of enemies who should have their image flipped in battle  FLIP_ENEMY = [                2, 3, 4, 5, 8, 10, 12, 13, 14, 16, 17,                 18, 19, 21, 22, 23, 25, 28, 29,                               ]    FORCE_AUTOTILE_BACKGROUND = true # attempt to use tile-based background on all mapsend#################################################################################  MAIN SCRIPT#################################################################################  EDITS BEYOND THIS POINT ARE AT YOUR OWN RISK!!!###############################################################################module BattleManager  class << self    alias reedo_sbs_bm_process_victory process_victory    alias reedo_sbs_bm_process_escape process_escape    alias reedo_sbs_bm_gain_exp gain_exp  end    def self.gain_exp    if $imported && $imported["YEA-VictoryAftermath"]       tmp_gc = []      $game_party.all_members.each do |actor|        tmp_gc.push(actor.reedo_sbs_gc)        actor.reedo_sbs_gc = nil if actor.reedo_sbs_gc      end      reedo_sbs_bm_gain_exp      $game_party.all_members.each_with_index do |actor, i|        actor.reedo_sbs_gc = tmp_gc[i]       end    else      reedo_sbs_bm_gain_exp    end  end    def self.process_victory    SceneManager.scene.reedo_victory_dance = true if REEDO_SBS::VICTORY_DANCE_ENABLED    reedo_sbs_bm_process_victory  end    def self.process_escape    SceneManager.scene.reedo_turn_and_run    SceneManager.scene.reedo_cancel_run if !reedo_sbs_bm_process_escape  end    def self.reedo_preemptive?    @preemptive  end    def self.reedo_surprise?    @surprise  end    def self.reedo_get_actor_index    return @actor_index  endendclass Game_Action  def reedo_guard?    return item == $data_skills[subject.guard_skill_id]  endendclass Game_Actor  attr_accessor :reedo_sbs_gc  attr_accessor :reedo_damage_time  attr_accessor :reedo_is_acting    alias reedo_sbs_ga_initialize initialize  def initialize(actor_id)    reedo_sbs_ga_initialize(actor_id)    @reedo_damage_time = 0    @reedo_is_acting = false  end    alias reedo_sbs_ga_perform_damage_effect perform_damage_effect  def perform_damage_effect    @reedo_damage_time = REEDO_SBS::DAMAGE_RED_TIME    reedo_sbs_ga_perform_damage_effect  endendclass Game_Character  attr_accessor :opacity  attr_accessor :priority_type  attr_accessor :reedo_start_top  attr_accessor :reedo_jump_delta  attr_accessor :reedo_shadow_sprite  attr_accessor :reedo_is_dead  attr_accessor :reedo_action_sprite  attr_accessor :reedo_action_sprite_increment  attr_accessor :reedo_action_style    def reedo_step_on    cmd = RPG::MoveCommand.new(Game_Character::ROUTE_STEP_ANIME_ON)    process_move_command(cmd)  end    def reedo_step_off    cmd = RPG::MoveCommand.new(Game_Character::ROUTE_STEP_ANIME_OFF)    process_move_command(cmd)  end    def reedo_create_action_sprite(view)    @reedo_action_style = 1    @reedo_action_sprite_increment = REEDO_SBS::ACTION_SPRITE_INCREMENT    @reedo_action_sprite = Sprite_Base.new(view)    @reedo_action_sprite.bitmap = Bitmap.new(24, 24)    @reedo_action_sprite.src_rect = Rect.new(0, 0, 24, 24)    @reedo_action_sprite.ox = 24    @reedo_action_sprite.oy = 24    @reedo_action_sprite.x = (self.x * 32) - 28    @reedo_action_sprite.y = (self.y * 32) + 18    @reedo_action_sprite.z = (self.priority_type * 100) + 1    @reedo_action_sprite.visible = false  end    def reedo_create_shadow_sprite(view)    @reedo_shadow_sprite = Sprite_Base.new(view)    bmp = Cache.picture(REEDO_SBS::ACTOR_SHADOW_CUSTOM_PICTURE) if REEDO_SBS::ACTOR_SHADOW_CUSTOM_PICTURE != nil    bmp = Cache.system(REEDO_SBS::ACTOR_SHADOW_IMAGE) if bmp == nil    @reedo_shadow_sprite.bitmap = bmp    @reedo_shadow_sprite.src_rect = Rect.new(0, 0, bmp.width, bmp.height)    @reedo_shadow_sprite.x = (self.x * 32)     @reedo_shadow_sprite.y = (self.y * 32)     @reedo_shadow_sprite.z = (self.priority_type * 100) - 1  end    alias reedo_sbs_gc_update update  def update    reedo_sbs_gc_update    @shadow_sprite.update if @shadow_sprite != nil  end    def reedo_draw_icon(icon_index)    @reedo_action_sprite.bitmap.clear    @reedo_action_sprite.visible = (icon_index > 0)    return if icon_index < 0    bitmap = Cache.system("Iconset")    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)    @reedo_action_sprite.bitmap.blt(0, 0, bitmap, rect, 255)  endendclass Spriteset_Battle  alias reedo_sbs_ssb_initialize initialize  def initialize    @reedo_dance_wait = 0    reedo_sbs_ssb_initialize  end    alias reedo_sbs_ssb_dispose dispose  def dispose    for actor in $game_party.battle_members      actor.reedo_sbs_gc.reedo_action_sprite.dispose      actor.reedo_sbs_gc.reedo_shadow_sprite.dispose      actor.reedo_sbs_gc = nil    end    @reedo_sprite_chars.each {|sprite| sprite.dispose }    reedo_sbs_ssb_dispose  end    alias reedo_sbs_ssb_create_actors create_actors  def create_actors    dispose_actors if @actor_sprites != nil    reedo_sbs_ssb_create_actors    @reedo_game_chars = []    @reedo_sprite_chars = []    @actor_sprites = []    @reedo_surprise_time = 0    @reedo_preemptive_time = 0        i = 1    for actor in $game_party.battle_members      gc = Game_Character.new      gc.set_graphic(actor.character_name, actor.character_index)      if BattleManager.reedo_surprise?        gc.set_direction(6)        @reedo_surprise_time = REEDO_SBS::SURPRISE_TIME      elsif BattleManager.reedo_preemptive?        @reedo_preemptive_time = REEDO_SBS::PREEMPTIVE_TIME        @reedo_preemptive_tone = 0        @reedo_preemptive_delta = 10        gc.set_direction(2)      else        gc.set_direction(4)      end      gc.priority_type = i      bc = Sprite_Character.new(@viewport1, gc)      sb = Sprite_Battler.new(@viewport1, actor)      top = REEDO_SBS::ACTOR_START_TOP + (i * REEDO_SBS::ACTOR_STAGGER_VERT)      left = REEDO_SBS::ACTOR_START_LEFT      if REEDO_SBS::ACTOR_STAGGER        left += REEDO_SBS::ACTOR_STAGGER_HORZ if i % 2 == 0      else        left += REEDO_SBS::ACTOR_STAGGER_HORZ * i      end      gc.reedo_is_dead = false      gc.reedo_start_top = top      gc.reedo_jump_delta = -0.1      gc.moveto(left, top)      gc.reedo_create_shadow_sprite(@viewport1)      gc.reedo_create_action_sprite(@viewport1)      bc.update      @actor_sprites.push(sb)         @reedo_sprite_chars.push(bc)      @reedo_game_chars.push(gc)      actor.reedo_sbs_gc = gc      i += 1    end  end    alias reedo_sbs_ssb_create_enemies create_enemies  def create_enemies    reedo_sbs_ssb_create_enemies    for sprite in @enemy_sprites      sprite.mirror = true if REEDO_SBS::FLIP_ENEMY.include?(sprite.battler.enemy_id)    end  end    alias reedo_sbs_ssb_create_blurry_background_bitmap create_blurry_background_bitmap  def create_blurry_background_bitmap    if REEDO_SBS::FORCE_AUTOTILE_BACKGROUND && !$BTEST      tryName1 = battleback1_name      return reedo_sbs_ssb_create_blurry_background_bitmap if tryName1 == nil      wall = Cache.battleback1(tryName1)      tryName2 = battleback2_name      bitmap = Bitmap.new(640, 480)      bitmap.blt(0, 0, wall, wall.rect)      if tryName2 != nil        floor = Cache.battleback2(tryName2)        bitmap.blt(0, 320, floor, floor.rect)      end      bitmap    else      reedo_sbs_ssb_create_blurry_background_bitmap    end  end    def reedo_update_victory_dance    if @reedo_dance_wait == 0      @actor_sprites.each_with_index do |sprite, i|        if sprite.battler.alive? && sprite.battler.movable?          gc = @reedo_game_chars[i]          gc.moveto(gc.x, gc.y + gc.reedo_jump_delta)          if gc.y < gc.reedo_start_top - REEDO_SBS::VICTORY_DANCE_JUMP_HEIGHT            gc.reedo_jump_delta = 0.1            @reedo_dance_wait = REEDO_SBS::VICTORY_DANCE_JUMP_HOVER          end          if gc.y > gc.reedo_start_top            gc.reedo_jump_delta = -0.1            gc.set_direction(4)            @reedo_dance_wait = REEDO_SBS::VICTORY_DANCE_JUMP_WAIT          end          if ((gc.y - REEDO_SBS::VICTORY_DANCE_JUMP_HEIGHT) * 10).to_int % (REEDO_SBS::VICTORY_DANCE_JUMP_HEIGHT / 4 * 10).to_int == 0            if @reedo_dance_wait == 0              case gc.direction                when 4; gc.set_direction(2)                when 2; gc.set_direction(6)                when 6; gc.set_direction(8)                when 8; gc.set_direction(4)              end            end          end        end      end    else      @reedo_dance_wait -= 1    end  end    def reedo_update_surprise    @actor_sprites.each_with_index do |sprite, i|      if sprite.battler.alive? && sprite.battler.movable?        gc = @reedo_game_chars[i]        if @reedo_surprise_time > 1          gc.moveto(gc.x, gc.y + gc.reedo_jump_delta)          if gc.y < gc.reedo_start_top - REEDO_SBS::VICTORY_DANCE_JUMP_HEIGHT            gc.reedo_jump_delta = 0.1          end          if gc.y > gc.reedo_start_top            gc.reedo_jump_delta = -0.1          end        else          gc.moveto(gc.x, gc.reedo_start_top)          gc.set_direction(4)          end      end    end    @reedo_surprise_time -= 1  end    def reedo_update_preemptive    @actor_sprites.each_with_index do |sprite, i|      if sprite.battler.alive? && sprite.battler.movable?        sc = @reedo_sprite_chars[i]        if @reedo_preemptive_time > 1          sc.tone.set(@reedo_preemptive_tone,@reedo_preemptive_tone,@reedo_preemptive_tone)          @reedo_preemptive_tone += @reedo_preemptive_delta          @reedo_preemptive_delta *= -1 if @reedo_preemptive_tone >= 255          @reedo_preemptive_delta *= -1 if @reedo_preemptive_tone <= 0        else          sc.tone.set(0,0,0)          @reedo_game_chars[i].set_direction(4)        end      end    end    @reedo_preemptive_time -= 1  end    def update_actors    dance = false    run = false    if SceneManager.scene.is_a?(Scene_Battle)      run = SceneManager.scene.reedo_run_away      dance = SceneManager.scene.reedo_victory_dance      reedo_update_victory_dance if dance    end    reedo_update_surprise if @reedo_surprise_time > 0    reedo_update_preemptive if @reedo_preemptive_time > 0    @actor_sprites.each_with_index do |sprite, i|      gc = @reedo_game_chars[i]      sc = @reedo_sprite_chars[i]      if sprite.battler.movable?  && (BattleManager.reedo_get_actor_index == i || sprite.battler.reedo_is_acting || dance || run)        gc.reedo_step_on      else        gc.reedo_step_off      end            if gc.reedo_action_sprite.visible then        if gc.reedo_action_style == 0 # swing          gc.reedo_action_sprite.angle += gc.reedo_action_sprite_increment          gc.reedo_action_sprite_increment *= -1 if (gc.reedo_action_sprite.angle > 90) || (gc.reedo_action_sprite.angle < 0)        elsif gc.reedo_action_style == 1 # pulse          gc.reedo_action_sprite.zoom_x += (gc.reedo_action_sprite_increment * 0.01)          gc.reedo_action_sprite.zoom_y += (gc.reedo_action_sprite_increment * 0.01)          gc.reedo_action_sprite_increment *= -1 if (gc.reedo_action_sprite.zoom_x > 2.0) || (gc.reedo_action_sprite.zoom_x < 1.0)        elsif gc.reedo_action_style == 2 # punch          gc.reedo_action_sprite.x += (gc.reedo_action_sprite_increment * REEDO_SBS::PUNCH_SPEED)          gc.reedo_action_sprite_increment *= -1 if (gc.reedo_action_sprite.x < gc.reedo_shadow_sprite.x - REEDO_SBS::PUNCH_DISTANCE) || (gc.reedo_action_sprite.x > gc.reedo_shadow_sprite.x)        end        gc.reedo_action_sprite.update      else        gc.reedo_action_sprite.angle = 0        gc.reedo_action_sprite.zoom_x = 1.0        gc.reedo_action_sprite.zoom_y = 1.0        gc.reedo_action_sprite.x = gc.reedo_shadow_sprite.x      end            if sprite.battler.dead?        if gc.reedo_is_dead == false          gc.moveto(gc.x + REEDO_SBS::ACTOR_DEATH_OFFSET_X, gc.y + REEDO_SBS::ACTOR_DEATH_OFFSET_Y)          gc.reedo_shadow_sprite.visible = false          gc.opacity = REEDO_SBS::ACTOR_DEATH_OPACITY          sc.angle = REEDO_SBS::ACTOR_DEATH_ANGLE          sc.tone.set(REEDO_SBS::ACTOR_DEATH_TONE)          gc.reedo_is_dead = true        end      else        if gc.reedo_is_dead == true          gc.moveto(gc.x - REEDO_SBS::ACTOR_DEATH_OFFSET_X, gc.y - REEDO_SBS::ACTOR_DEATH_OFFSET_Y)          gc.reedo_shadow_sprite.visible = true          gc.opacity = 255          sc.angle = 0          sc.tone.set(0,0,0)          gc.reedo_is_dead = false        end        if sprite.battler.reedo_damage_time > 0          sc.tone.set(255,0,0) if sc.tone.red == 0          sprite.battler.reedo_damage_time -= 1        else          sc.tone.set(0,0,0) if sc.tone.red == 255        end      end      sc.update      gc.update      sprite.update    end  end    def reedo_game_char(index)    @reedo_game_chars[index]  end    def reedo_sprite_char(index)    @reedo_sprite_chars[index]  end    def reedo_actor_sprites    @actor_sprites  endendclass Scene_Battle  attr_accessor :reedo_victory_dance  attr_accessor :reedo_run_away  attr_reader :subject      alias reedo_sbs_sb_start start  def start    @reedo_victory_dance = false    @reedo_run_away = false    if !$BTEST      @reedo_map_x = $game_map.display_x      @reedo_map_y = $game_map.display_y      $game_map.set_display_pos(0, 0)    else      $game_map = Game_Map.new      $game_map.setup(1)    end    reedo_sbs_sb_start  end    alias reedo_sbs_sb_terminate terminate  def terminate    if !$BTEST      $game_map.set_display_pos(@reedo_map_x, @reedo_map_y)    end    reedo_sbs_sb_terminate  end    alias reedo_sbs_sb_execute_action execute_action  def execute_action    if @subject.is_a?(Game_Actor)      @subject.reedo_is_acting = true      @spriteset.update_actors      wait(15)      if !@subject.current_action.reedo_guard?        reedo_move_inout(-REEDO_SBS::ACTOR_STEP_DISTANCE)        gc = @subject.reedo_sbs_gc        iconidx = -1        if @subject.current_action.item.is_a?(RPG::Skill)          if @subject.current_action.item.id == REEDO_SBS::ATTACK_SKILL_ID            iconidx = @subject.weapons[0].icon_index if @subject.weapons[0]            iconidx = REEDO_SBS::UNARMED_ICON if iconidx < 0            if iconidx == REEDO_SBS::UNARMED_ICON               gc.reedo_action_style = REEDO_SBS::UNARMED_STYLE            elsif REEDO_SBS::NO_MOVE_WEAPON_TYPES.include?(@subject.weapons[0].wtype_id)              gc.reedo_action_style = 3 #none            elsif REEDO_SBS::PUNCH_WEAPON_TYPES.include?(@subject.weapons[0].wtype_id)              gc.reedo_action_style = 2 #punch            elsif REEDO_SBS::PULSE_WEAPON_TYPES.include?(@subject.weapons[0].wtype_id)              gc.reedo_action_style = 1 #pulse            else              gc.reedo_action_style = 0 #swing            end          else            iconidx = @subject.current_action.item.icon_index            gc.reedo_action_style = 1 #pulse          end        elsif @subject.current_action.item.is_a?(RPG::Item)          iconidx = @subject.current_action.item.icon_index          gc.reedo_action_style = 1        end        gc.reedo_draw_icon(iconidx)       else        reedo_move_inout(REEDO_SBS::ACTOR_STEP_DISTANCE / 2)      end    end    reedo_sbs_sb_execute_action    if @subject.is_a?(Game_Actor)      if !@subject.current_action.reedo_guard?        gc = @subject.reedo_sbs_gc        gc.reedo_draw_icon(-1)        reedo_move_inout(REEDO_SBS::ACTOR_STEP_DISTANCE)      else        reedo_move_inout(-(REEDO_SBS::ACTOR_STEP_DISTANCE / 2))      end      @subject.reedo_is_acting = false    end  end    alias reedo_sbs_sb_show_animation show_animation  def show_animation(targets, animation_id)    oktargets = []    targets.each do |sprite|      if sprite.is_a?(Game_Actor)        if animation_id == -1          sprite.reedo_sbs_gc.animation_id = REEDO_SBS::ENEMY_DEFAULT_ATTACK        else          sprite.reedo_sbs_gc.animation_id = animation_id        end      else        oktargets.push(sprite)      end    end     reedo_sbs_sb_show_animation(oktargets, animation_id)  end    def reedo_move_inout(dist)    i = 0    while i < REEDO_SBS::ACTOR_STEPS_IN_OUT      gc = @subject.reedo_sbs_gc      gc.moveto(gc.x + dist, gc.y)      gc.reedo_shadow_sprite.x = (gc.x * 32)      update_for_wait      i += 1    end      end    def reedo_turn_and_run    @reedo_run_away = true    @spriteset.update_actors    wait(15)    @spriteset.reedo_actor_sprites.each_with_index do |sprite, i|      gc = @spriteset.reedo_game_char(i)      gc.set_direction(6)      gc.moveto(gc.x + 0.5, gc.y)      gc.reedo_shadow_sprite.x = (gc.x * 32)    end  end    def reedo_cancel_run    @reedo_run_away = false    @spriteset.reedo_actor_sprites.each_with_index do |sprite, i|      gc = @spriteset.reedo_game_char(i)      gc.set_direction(4)      gc.moveto(gc.x - 0.5, gc.y)      gc.reedo_shadow_sprite.x = (gc.x * 32)    end    return false  endend

 

Summary

With this script you can quickly and easily show your party on screen during battle with animations and effects and no special configuration beyond rearranging the enemy layout in your troops.

 

Comments and suggestions are welcome.

 

* End Note

Special thanks to Vlue for pointing out proper way to alias a static method on a module.

 

Also, special thanks to Macatlas for a bug find, but more, for contributing the necessary information and resources for the Yanfly compatibility fix!


Viewing all articles
Browse latest Browse all 416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>