Sideview Battler Actor Death Help, Please!

Discussion in 'RGSSx Script Support' started by captainproton, Jan 28, 2014.

Thread Status:
Not open for further replies.
  1. captainproton

    captainproton Dangerously Nifty Veteran

    Messages:
    1,281
    Likes Received:
    580
    Location:
    Missouri
    First Language:
    english
    Hi!  I couldn't find this topic posted anywhere already, so I hope someone here will be able to help. 

    I found a great script by Yanfly (all hail Yanfly) for sideview battles.  The only problem I'm having with it is when an Actor dies, the sprite remains on the battlefield, running in place like the others. 

    Being an admitted novice with Ace and programming in general, I'm not sure how to fix this.  I've tried creating common events which change the character's sprite to the coffin spriteset when the Death state is applied,but nothing seems to happen when I battletest the characters against high-level monsters. 

    Yanfly (all hail Yanfly) did post a script specifically for death events, but there are next to no instructions on how to use it. 

    I don't think what I'm looking for is all that elaborate, is it?  Just something to indicate, outside the status menu, that SoAndSo is dead.  If this carried forward onto the field, even better. 

    Help?
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,644
    Likes Received:
    6,584
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    please link to all scripts you're using - we can't help you without knowing what scripts you have in your project.
     
    #2
  3. Little Paw

    Little Paw Veteran Veteran

    Messages:
    710
    Likes Received:
    293
    First Language:
    English
    #3
  4. captainproton

    captainproton Dangerously Nifty Veteran

    Messages:
    1,281
    Likes Received:
    580
    Location:
    Missouri
    First Language:
    english
    @littlepaw: I actually used jet's before I tried yanfly's and found it even harder to work with.

    @andar: do you need all scripts I'm using or just battle scripts?
     
    #4
  5. Little Paw

    Little Paw Veteran Veteran

    Messages:
    710
    Likes Received:
    293
    First Language:
    English
    Well you're not going to get the functionality you want out of Yanfly's because it simply does not have the ability to do that.
     
    #5
  6. captainproton

    captainproton Dangerously Nifty Veteran

    Messages:
    1,281
    Likes Received:
    580
    Location:
    Missouri
    First Language:
    english
    Okay, so I gave Jet's another try, and this is apparently an updated version of the script I used before, so, it is less restrictive. And when my characters die in battle, they do vanish from the field, which is a plus. In the script, though, it does mention state-related sprite changes. I followed the instructions as stated, and the sprite doesn't change. It does still vanish upon death, which I'll take, though.

    I'd still like to be able to signify a character is dead when walking around the map, though. I like the effect, and it's a good reminder to revive fallen characters, especially if you just saved and quit after a boss battle and restarted later on.

    Common events still refuse to accomplish this, so if anyone knows of a way to change a character's sprite upon death, please share your wisdom!
     
    #6
  7. captainproton

    captainproton Dangerously Nifty Veteran

    Messages:
    1,281
    Likes Received:
    580
    Location:
    Missouri
    First Language:
    english
    Bump!
     
    #7
  8. Zoltor

    Zoltor Veteran Veteran

    Messages:
    1,550
    Likes Received:
    209
    First Language:
    English
    Perhaps you're doing something wrong.

    How is your common event setup?

    In each troop's event box, can't you just set it to turn on a switch if a char dies, then have a autorun Common event set to go off if said switch is on, then it changes char sprite+turns off switch.

    Then just have the priest or whatnot change it back when they revive your char.
     
    Last edited by a moderator: Feb 9, 2014
    #8
  9. captainproton

    captainproton Dangerously Nifty Veteran

    Messages:
    1,281
    Likes Received:
    580
    Location:
    Missouri
    First Language:
    english
    I hadn't thought of putting the event in the troop tabs. Really, all i'd done, being the admitted novice I am, was to create a common event with a conditional branch like: "IF Cordelia's hp = 0, change sprite to $Cordelia_death; ELSE (nothing)" or somesuch.

    When I used this event with yanfly's script, nothing happened. The dead char was still walking in place like nothing happened. With Jet's updated script, the char did vanish, but didn't change. I noticed, though, when I went to use a revive item on the dead char, the coffin sprite did blink into being when i highlighted the dead char, but that was it. Upon leaving the battle, character sprites were unchanged.

    I'll try the troop tab thing and report back on my progress, but if anyone else has any advice, I welcome it!
     
    #9
  10. Uzuki

    Uzuki Kawaii on the streets, Senpai in the sheets Veteran

    Messages:
    1,844
    Likes Received:
    1,258
    Location:
    Georgia
    First Language:
    English
    Primarily Uses:
    RMMV
    Actually there's a easy solution to this problem. I remember having this same problem and after tinkling around I found a solution. I would put a picture up but I'm such a noob when it comes to forums I'll just put the steps up.

    1. In Common Events, create a conditional branch that that checks to see if Bob (He shall be named Bob for this tutorial) is in the party.

    2. In the first conditional branch add another one that checks if Bob has the Death state inflicted on him.

    3. In the second conditional branch put in "Change Actor Graphic", and have it change Bob to Coffin.

    4. Now in the same conditional branch go to Else and add another "Change Actor Graphic" so Bob can change back to his good ol' self when not inflicted with Death.

    5. Make sure the event is Parallel Process activate it with a switch and your ready to role.

    Repeat Steps 1-4 for any other actors and place them in the same Common Event, but UNDERNEATH the first Conditional Branch. Let me know if this works or not.
     
    #10
  11. captainproton

    captainproton Dangerously Nifty Veteran

    Messages:
    1,281
    Likes Received:
    580
    Location:
    Missouri
    First Language:
    english
    I thought about using the parallel process function on the CE, but the switch part threw me. Don't switches just change in events? Or is there a way to get switches to change in battles?
     
    #11
  12. Uzuki

    Uzuki Kawaii on the streets, Senpai in the sheets Veteran

    Messages:
    1,844
    Likes Received:
    1,258
    Location:
    Georgia
    First Language:
    English
    Primarily Uses:
    RMMV
    Switches can be activated in battle, but for this event we want it to ALWAYS be active. What I do is make a blank map that has  one event that activates switches, gives items, etc. Then you can transport the player to a different map.

    What you want to do is have the switch activate at the beginning of the game and never turn it off. That way while the event is in parallel process you won't have to worry about it. Mind you this won't change the character's graphic in battle, but it will do it in the map.
     
    #12
  13. captainproton

    captainproton Dangerously Nifty Veteran

    Messages:
    1,281
    Likes Received:
    580
    Location:
    Missouri
    First Language:
    english
    Hmmm.... So, could I just plant the Coffin Switch somewhere in my opening cutscene, then?
     
    #13
  14. Uzuki

    Uzuki Kawaii on the streets, Senpai in the sheets Veteran

    Messages:
    1,844
    Likes Received:
    1,258
    Location:
    Georgia
    First Language:
    English
    Primarily Uses:
    RMMV
    E-yup. Did it work?
     
    #14
  15. captainproton

    captainproton Dangerously Nifty Veteran

    Messages:
    1,281
    Likes Received:
    580
    Location:
    Missouri
    First Language:
    english
    Like a charm! Thanks!

    But is there a way to send dead chars to the back of the line? So the party isn't being led by a mobile coffin?
     
    #15
  16. Uzuki

    Uzuki Kawaii on the streets, Senpai in the sheets Veteran

    Messages:
    1,844
    Likes Received:
    1,258
    Location:
    Georgia
    First Language:
    English
    Primarily Uses:
    RMMV
    Well that's one part I wasn't able to figure out.......

    I just pretend that the other characters are pushing it until they get to a hospital or something. Takes you out of the game a little bit, but you barely notice it. If you have any other questions I'm always free to help.
     
    #16
  17. captainproton

    captainproton Dangerously Nifty Veteran

    Messages:
    1,281
    Likes Received:
    580
    Location:
    Missouri
    First Language:
    english
    XD that is actually an awesome idea.

    And one of the key elements of the game is reading books, so I can have a book say something about carrying the dead character's body to a temple for revival.

    Thanks!
     
    #17
  18. captainproton

    captainproton Dangerously Nifty Veteran

    Messages:
    1,281
    Likes Received:
    580
    Location:
    Missouri
    First Language:
    english
    Oh! And if Ihappen to work it out, I'll let you know!
     
    #18
  19. Uzuki

    Uzuki Kawaii on the streets, Senpai in the sheets Veteran

    Messages:
    1,844
    Likes Received:
    1,258
    Location:
    Georgia
    First Language:
    English
    Primarily Uses:
    RMMV
    It's been so long I completely forgot I had modified the original yanfly script. This modification will make the actor inflicted with the death state stop moving in fall over in battle.

    #==============================================================================
    #
    # ¥ Yanfly Engine Ace - Visual Battlers v1.01
    # -- Last Updated: 2012.07.24
    # -- Level: Easy
    # -- Requires: n/a
    #
    # ¥ Modified by:
    # -- Yami
    # -- Kread-Ex
    # -- Archeia_Nessiah
    #==============================================================================

    $imported = {} if $imported.nil?
    $imported["YEA-VisualBattlers"] = true

    #==============================================================================
    # ¥ Updates
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # 2012.12.18 - Added preset views and able to change direction in-game.
    # 2012.07.24 - Finished Script.
    # 2012.01.05 - Started Script.
    #
    #==============================================================================
    # ¥ Introduction
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # This script provides a visual for all actors by default charsets. The actions
    # and movements are alike Final Fantasy 1, only move forward and backward when
    # start and finish actions.
    #
    #==============================================================================
    # ¥ Instructions
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # To change the player direction in-game, use the snippet below in a script
    # call:
    #
    # $game_system.party_direction = n
    #
    # To install this script, open up your script editor and copy/paste this script
    # to an open slot below ¥ Materials but above ¥ Main. Remember to save.
    #
    #==============================================================================
    # ¥ Compatibility
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
    # it will run with RPG Maker VX without adjusting.
    #
    #==============================================================================

    module YEA
    module VISUAL_BATTLERS

    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Party Location Setting -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # These settings are adjusted for Party Location. Each Actor will have
    # coordinates calculated by below formula. There are two samples coordinates
    # below, change PARTY_DIRECTION to the base index you want to use.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    PARTY_DIRECTION = 6 # This direction is opposite from actual direction.

    PARTY_LOCATION_BASE_COORDINATES ={
    # Index => [base_x, base_y, mod_x, mod_y],
    2 => [ 250, 290, 40, 0], #UP
    4 => [ 150, 280, 20, -20], #LEFT
    3 => [ 460, 280, 30, -10], #RIGHT
    6 => [ 460, 230, 20, 20], #DEFAULT RIGHT
    8 => [ 260, 230, 40, 0], #DOWN
    } # Do not remove this.

    PARTY_LOCATION_FORMULA_X = "base_x + index * mod_x"
    PARTY_LOCATION_FORMULA_Y = "base_y + index * mod_y"

    end # VISUAL_BATTLERS
    end # YEA

    #==============================================================================
    # ¥ Editting anything past this point may potentially result in causing
    # computer damage, incontinence, explosion of user's head, coma, death, and/or
    # halitosis so edit at your own risk.
    #==============================================================================

    #==============================================================================
    # ? ¥ Direction
    #==============================================================================

    module Direction

    #--------------------------------------------------------------------------
    # self.correct
    #--------------------------------------------------------------------------
    def self.correct(direction)
    case direction
    when 1; return 4
    when 3; return 6
    when 7; return 4
    when 9; return 6
    else; return direction
    end
    end

    #--------------------------------------------------------------------------
    # self.opposite
    #--------------------------------------------------------------------------
    def self.opposite(direction)
    case direction
    when 1; return 6
    when 2; return 8
    when 3; return 4
    when 4; return 6
    when 6; return 4
    when 7; return 6
    when 8; return 2
    when 9; return 4
    else; return direction
    end
    end

    end # Direction

    #==============================================================================
    # ? ¥ Game_System
    #==============================================================================

    class Game_System; attr_accessor :party_direction; end

    #==============================================================================
    # ? ¥ Game_BattleCharacter
    #==============================================================================

    class Game_BattleCharacter < Game_Character

    #--------------------------------------------------------------------------
    # initialize
    #--------------------------------------------------------------------------
    def initialize(actor)
    super()
    setup_actor(actor)
    @move_x_rate = 0
    @move_y_rate = 0
    end
    #—
    def step_anime=(step_anime)
    @step_anime = step_anime
    end
    #—
    #--------------------------------------------------------------------------
    # setup_actor
    #--------------------------------------------------------------------------
    def setup_actor(actor)
    @actor = actor
    @step_anime = true
    set_graphic(@actor.character_name, @actor.character_index)
    setup_coordinates
    dr = $game_system.party_direction || YEA::VISUAL_BATTLERS::pARTY_DIRECTION
    direction = Direction.opposite(dr)
    set_direction(Direction.correct(direction))
    end

    #--------------------------------------------------------------------------
    # sprite=
    #--------------------------------------------------------------------------
    def sprite=(sprite)
    @sprite = sprite
    end

    #--------------------------------------------------------------------------
    # setup_coordinates
    #--------------------------------------------------------------------------
    def setup_coordinates
    location = ($game_system.party_direction ||
    YEA::VISUAL_BATTLERS::pARTY_DIRECTION)
    base_x = YEA::VISUAL_BATTLERS::pARTY_LOCATION_BASE_COORDINATES[location][0]
    base_y = YEA::VISUAL_BATTLERS::pARTY_LOCATION_BASE_COORDINATES[location][1]
    mod_x = YEA::VISUAL_BATTLERS::pARTY_LOCATION_BASE_COORDINATES[location][2]
    mod_y = YEA::VISUAL_BATTLERS::pARTY_LOCATION_BASE_COORDINATES[location][3]
    @actor.screen_x = eval(YEA::VISUAL_BATTLERS::pARTY_LOCATION_FORMULA_X)
    @actor.screen_y = eval(YEA::VISUAL_BATTLERS::pARTY_LOCATION_FORMULA_Y)
    @actor.origin_x = @actor.screen_x
    @actor.origin_y = @actor.screen_y
    @actor.create_move_to(screen_x, screen_y, 1)
    end

    #--------------------------------------------------------------------------
    # index
    #--------------------------------------------------------------------------
    def index
    return @actor.index
    end

    #--------------------------------------------------------------------------
    # screen_x
    #--------------------------------------------------------------------------
    def screen_x
    return @actor.screen_x
    end

    #--------------------------------------------------------------------------
    # screen_y
    #--------------------------------------------------------------------------
    def screen_y
    return @actor.screen_y
    end

    #--------------------------------------------------------------------------
    # screen_z
    #--------------------------------------------------------------------------
    def screen_z
    return @actor.screen_z
    end

    end # Game_BattleCharacter

    #==============================================================================
    # ? ¥ Game_Battler
    #==============================================================================

    class Game_Battler < Game_BattlerBase

    #--------------------------------------------------------------------------
    # public instance variables
    #--------------------------------------------------------------------------
    attr_accessor :moved_back
    attr_accessor :origin_x
    attr_accessor :origin_y
    attr_accessor :screen_x
    attr_accessor :screen_y
    attr_accessor :started_turn

    #--------------------------------------------------------------------------
    # alias method: execute_damage
    #--------------------------------------------------------------------------
    alias game_battler_execute_damage_vb execute_damage
    def execute_damage(user)
    game_battler_execute_damage_vb(user)
    if @result.hp_damage > 0
    move_backward(24, 6) unless @moved_back
    @moved_back = true
    end
    end

    #--------------------------------------------------------------------------
    # face_opposing_party
    #--------------------------------------------------------------------------
    def face_opposing_party
    direction = ($game_system.party_direction ||
    YEA::VISUAL_BATTLERS::pARTY_DIRECTION)
    character.set_direction(Direction.correct(direction)) rescue 0
    end

    #--------------------------------------------------------------------------
    # new method: face_coordinate
    #--------------------------------------------------------------------------
    def face_coordinate(destination_x, destination_y)
    x1 = Integer(@screen_x)
    x2 = Integer(destination_x)
    y1 = Graphics.height - Integer(@screen_y)
    y2 = Graphics.height - Integer(destination_y)
    return if x1 == x2 and y1 == y2
    #---
    angle = Integer(Math.atan2((y2-y1),(x2-x1)) * 1800 / Math::pI)
    if (0..225) === angle or (-225..0) === angle
    direction = 6
    elsif (226..675) === angle
    direction = 9
    elsif (676..1125) === angle
    direction = 8
    elsif (1126..1575) === angle
    direction = 7
    elsif (1576..1800) === angle or (-1800..-1576) === angle
    direction = 4
    elsif (-1575..-1126) === angle
    direction = 1
    elsif (-1125..-676) === angle
    direction = 2
    elsif (-675..-226) === angle
    direction = 3
    end
    #---
    character.set_direction(Direction.correct(direction)) rescue 0
    end

    #--------------------------------------------------------------------------
    # create_move_to
    #--------------------------------------------------------------------------
    def create_move_to(destination_x, destination_y, frames = 12)
    @destination_x = destination_x
    @destination_y = destination_y
    frames = [frames, 1].max
    @move_x_rate = [(@screen_x - @destination_x).abs / frames, 2].max
    @move_y_rate = [(@screen_y - @destination_y).abs / frames, 2].max
    end

    #--------------------------------------------------------------------------
    # update_move_to
    #--------------------------------------------------------------------------
    def update_move_to
    @move_x_rate = 0 if @screen_x == @destination_x || @move_x_rate.nil?
    @move_y_rate = 0 if @screen_y == @destination_y || @move_y_rate.nil?
    value = [(@screen_x - @destination_x).abs, @move_x_rate].min
    @screen_x += (@destination_x > @screen_x) ? value : -value
    value = [(@screen_y - @destination_y).abs, @move_y_rate].min
    @screen_y += (@destination_y > @screen_y) ? value : -value
    end

    #--------------------------------------------------------------------------
    # move_forward
    #--------------------------------------------------------------------------
    def move_forward(distance = 24, frames = 12)
    direction = forward_direction
    move_direction(direction, distance, frames)
    end

    #--------------------------------------------------------------------------
    # move_backward
    #--------------------------------------------------------------------------
    def move_backward(distance = 24, frames = 12)
    direction = Direction.opposite(forward_direction)
    move_direction(direction, distance, frames)
    end

    #--------------------------------------------------------------------------
    # move_direction
    #--------------------------------------------------------------------------
    def move_direction(direction, distance = 24, frames = 12)
    case direction
    when 1; move_x = distance / -2; move_y = distance / 2
    when 2; move_x = distance * 0; move_y = distance * 1
    when 3; move_x = distance / -2; move_y = distance / 2
    when 4; move_x = distance * -1; move_y = distance * 0
    when 6; move_x = distance * 1; move_y = distance * 0
    when 7; move_x = distance / -2; move_y = distance / -2
    when 8; move_x = distance * 0; move_y = distance * -1
    when 9; move_x = distance / 2; move_y = distance / -2
    else; return
    end
    destination_x = @screen_x + move_x
    destination_y = @screen_y + move_y
    create_move_to(destination_x, destination_y, frames)
    end

    #--------------------------------------------------------------------------
    # forward_direction
    #--------------------------------------------------------------------------
    def forward_direction
    return ($game_system.party_direction ||
    YEA::VISUAL_BATTLERS::pARTY_DIRECTION)
    end

    #--------------------------------------------------------------------------
    # move_origin
    #--------------------------------------------------------------------------
    def move_origin
    create_move_to(@origin_x, @origin_y)
    face_coordinate(@origin_x, @origin_y)
    @moved_back = false
    end

    #--------------------------------------------------------------------------
    # moving?
    #--------------------------------------------------------------------------
    def moving?
    return false if dead? || !exist?
    return @move_x_rate != 0 || @move_y_rate != 0
    end

    end # Game_Battler

    #==============================================================================
    # ? ¥ Game_Actor
    #==============================================================================

    class Game_Actor < Game_Battler

    #--------------------------------------------------------------------------
    # overwrite method: use_sprite?
    #--------------------------------------------------------------------------
    def use_sprite?
    return true
    end

    #--------------------------------------------------------------------------
    # new method: screen_x
    #--------------------------------------------------------------------------
    def screen_x
    return @screen_x rescue 0
    end

    #--------------------------------------------------------------------------
    # new method: screen_y
    #--------------------------------------------------------------------------
    def screen_y
    return @screen_y rescue 0
    end

    #--------------------------------------------------------------------------
    # new method: screen_z
    #--------------------------------------------------------------------------
    def screen_z
    return 100
    end

    #--------------------------------------------------------------------------
    # new method: sprite
    #--------------------------------------------------------------------------
    def sprite
    index = $game_party.battle_members.index(self)
    return SceneManager.scene.spriteset.actor_sprites[index]
    end

    #--------------------------------------------------------------------------
    # new method: character
    #--------------------------------------------------------------------------
    def character
    return sprite.character_base
    end

    #--------------------------------------------------------------------------
    # face_opposing_party
    #--------------------------------------------------------------------------
    def face_opposing_party
    dr = $game_system.party_direction || YEA::VISUAL_BATTLERS::pARTY_DIRECTION
    direction = Direction.opposite(dr)
    character.set_direction(Direction.correct(direction)) rescue 0
    end

    #--------------------------------------------------------------------------
    # forward_direction
    #--------------------------------------------------------------------------
    def forward_direction
    return Direction.opposite(($game_system.party_direction ||
    YEA::VISUAL_BATTLERS::pARTY_DIRECTION))
    end

    end # Game_Actor

    #==============================================================================
    # ? ¥ Game_Enemy
    #==============================================================================

    class Game_Enemy < Game_Battler

    #--------------------------------------------------------------------------
    # new method: sprite
    #--------------------------------------------------------------------------
    def sprite
    return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
    end

    #--------------------------------------------------------------------------
    # new method: character
    #--------------------------------------------------------------------------
    def character
    return sprite
    end

    end # Game_Enemy

    #==============================================================================
    # ? ¥ Game_Troop
    #==============================================================================

    class Game_Troop < Game_Unit

    #--------------------------------------------------------------------------
    # alias method: setup
    #--------------------------------------------------------------------------
    alias game_troop_setup_vb setup
    def setup(troop_id)
    game_troop_setup_vb(troop_id)
    set_coordinates
    end

    #--------------------------------------------------------------------------
    # new method: set_coordinates
    #--------------------------------------------------------------------------
    def set_coordinates
    for member in members
    member.origin_x = member.screen_x
    member.origin_y = member.screen_y
    member.create_move_to(member.screen_x, member.screen_y, 1)
    end
    end

    end # Game_Troop

    #==============================================================================
    # ? ¥ Sprite_Battler
    #==============================================================================

    class Sprite_Battler < Sprite_Base

    #--------------------------------------------------------------------------
    # public instance_variable
    #--------------------------------------------------------------------------
    attr_accessor :character_base
    attr_accessor :character_sprite

    #--------------------------------------------------------------------------
    # alias method: dispose
    #--------------------------------------------------------------------------
    alias sprite_battler_dispose_vb dispose
    def dispose
    dispose_character_sprite
    sprite_battler_dispose_vb
    end

    #--------------------------------------------------------------------------
    # new method: dispose_character_sprite
    #--------------------------------------------------------------------------
    def dispose_character_sprite
    @character_sprite.dispose unless @character_sprite.nil?
    end

    #--------------------------------------------------------------------------
    # alias method: update
    #--------------------------------------------------------------------------
    alias sprite_battler_update_vb update
    def update
    sprite_battler_update_vb
    return if @battler.nil?
    update_move_to
    update_character_base
    update_character_sprite
    end

    #--------------------------------------------------------------------------
    # new method: update_character_base
    #--------------------------------------------------------------------------
    def update_character_base
    return if @character_base.nil?
    @character_base.update
    end

    #--------------------------------------------------------------------------
    # new method: update_character_sprite
    #--------------------------------------------------------------------------
    def update_character_sprite
    return if @character_sprite.nil?
    @character_sprite.update
    end

    #--------------------------------------------------------------------------
    # new method: update_move_to
    #--------------------------------------------------------------------------
    def update_move_to
    @battler.update_move_to
    end

    #--------------------------------------------------------------------------
    # new method: moving?
    #--------------------------------------------------------------------------
    def moving?
    return false if @battler.nil?
    return @battler.moving?
    end

    end # Sprite_Battler

    #==============================================================================
    # ? ¥ Sprite_BattleCharacter
    #==============================================================================

    class Sprite_BattleCharacter < Sprite_Character

    #--------------------------------------------------------------------------
    # initialize
    #--------------------------------------------------------------------------
    def initialize(viewport, character = nil)
    super(viewport, character)
    character.sprite = self
    end

    end # Sprite_BattleCharacter

    #==============================================================================
    # ? ¥ Spriteset_Battle
    #==============================================================================

    class Spriteset_Battle

    #--------------------------------------------------------------------------
    # public instance_variable
    #--------------------------------------------------------------------------
    attr_accessor :actor_sprites
    attr_accessor :enemy_sprites

    #--------------------------------------------------------------------------
    # overwrite method: create_actors
    #--------------------------------------------------------------------------
    def create_actors
    total = $game_party.max_battle_members
    @current_party = $game_party.battle_members.clone
    @actor_sprites = Array.new(total) { Sprite_Battler.new(@viewport1) }
    for actor in $game_party.battle_members
    @actor_sprites[actor.index].battler = actor
    create_actor_sprite(actor)
    end
    end

    #--------------------------------------------------------------------------
    # new method: create_actor_sprite
    #--------------------------------------------------------------------------
    def create_actor_sprite(actor)
    character = Game_BattleCharacter.new(actor)
    character_sprite = Sprite_BattleCharacter.new(@viewport1, character)
    @actor_sprites[actor.index].character_base = character
    @actor_sprites[actor.index].character_sprite = character_sprite
    actor.face_opposing_party
    end

    #--------------------------------------------------------------------------
    # alias method: update_actors
    #--------------------------------------------------------------------------
    alias spriteset_battle_update_actors_vb update_actors
    def update_actors
    #—
    for actor in $game_party.battle_members
    if $game_party.battle_members[actor.index].death_state?
    @actor_sprites[actor.index].character_sprite.angle = -90
    @actor_sprites[actor.index].character_base.step_anime = false
    else
    @actor_sprites[actor.index].character_sprite.angle = 0
    @actor_sprites[actor.index].character_base.step_anime = true
    end
    end
    #—
    if @current_party != $game_party.battle_members
    dispose_actors
    create_actors
    end
    spriteset_battle_update_actors_vb
    end

    #--------------------------------------------------------------------------
    # new method: moving?
    #--------------------------------------------------------------------------
    def moving?
    return battler_sprites.any? {|sprite| sprite.moving? }
    end

    end # Spriteset_Battle

    #==============================================================================
    # ? ¥ Scene_Battle
    #==============================================================================

    class Scene_Battle < Scene_Base

    #--------------------------------------------------------------------------
    # public instance variables
    #--------------------------------------------------------------------------
    attr_accessor :spriteset

    #--------------------------------------------------------------------------
    # alias method: process_action_end
    #--------------------------------------------------------------------------
    alias scene_battle_process_action_end_vb process_action_end
    def process_action_end
    start_battler_move_origin
    scene_battle_process_action_end_vb
    end

    #--------------------------------------------------------------------------
    # alias method: execute_action
    #--------------------------------------------------------------------------
    alias scene_battle_execute_action_vb execute_action
    def execute_action
    start_battler_move_forward
    scene_battle_execute_action_vb
    end

    #--------------------------------------------------------------------------
    # new method: start_battler_move_forward
    #--------------------------------------------------------------------------
    def start_battler_move_forward
    return if @subject.started_turn
    @subject.started_turn = true
    @subject.move_forward
    wait_for_moving
    end

    #--------------------------------------------------------------------------
    # new method: start_battler_move_origin
    #--------------------------------------------------------------------------
    def start_battler_move_origin
    @subject.started_turn = nil
    move_battlers_origin
    wait_for_moving
    @subject.face_opposing_party rescue 0
    end

    #--------------------------------------------------------------------------
    # new method: move_battlers_origin
    #--------------------------------------------------------------------------
    def move_battlers_origin
    for member in all_battle_members
    next if member.dead?
    next unless member.exist?
    member.move_origin
    end
    end

    #--------------------------------------------------------------------------
    # new method: wait_for_moving
    #--------------------------------------------------------------------------
    def wait_for_moving
    update_for_wait
    update_for_wait while @spriteset.moving?
    end

    end # Scene_Battle

    #==============================================================================
    #
    # ¥ End of File
    #
    #==============================================================================
    Just replace this with the orignal script and you're good to go. I think we can probably close this thread after this.
     
    #19
    Culai03 likes this.
  20. captainproton

    captainproton Dangerously Nifty Veteran

    Messages:
    1,281
    Likes Received:
    580
    Location:
    Missouri
    First Language:
    english
    This is actually the script I've been using before the updated version of jet's was suggested.
     
    #20
Thread Status:
Not open for further replies.

Share This Page