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.

Dead Battler Graphics with default battle system

lurk

Member

Hi, this might be a dumb question, but I have searched everywhere and could'nt find a satisfying result. I would like my battlers(player only) to stay visible when killed, maybe replaced with an alternative picture. I tried SephirothSpawn's scripts, but they applied to the enemy too, and I could'nt find out how to correct this. Any help would be greatly appreciated, thanks.

Edit:
I actually almost have it working. Right now, the player's battler stays on screen, with this slight modification to the original script. All I would need now is a way to include the change to a battler_dead picture.
Code:
class RPG::Sprite
  alias_method :seph_dontcollapsebattler_rpgsprite_collapse, :collapse
  def collapse
    if @battler.is_a?(Game_Actor) && @battler_visible && @battler != nil
      return
    end
    seph_dontcollapsebattler_rpgsprite_collapse
    end
end

class Sprite_Battler
  alias_method :seph_dontcollaspebattler_spritecharacter_update, :update
  def update
    collapses =  @battler != nil && @battler_visible && @battler.damage == nil and @battler.dead?
    seph_dontcollaspebattler_spritecharacter_update
    
    if collapses 
      @battler_visible = true
    end
  end
end
 

lurk

Member

I almost managed to reach the desired effect. The problem is, the battler changes BEFORE the attack animation is played, and the amount of damage displayed.
Code:
#-Credits SephirothSpawn
class Game_Battler
  alias_method :seph_deadgraphics_gmbtlr_bn, :battler_name
  def battler_name
    name = seph_deadgraphics_gmbtlr_bn
    name += '_dead' if self.dead? && self.is_a?(Game_Actor)
    return name
  end
end

class RPG::Sprite
  alias_method :seph_dontcollapsebattler_rpgsprite_collapse, :collapse
  def collapse
    if @battler.is_a?(Game_Actor) && @battler_visible && @battler != nil
      return
    end
    seph_dontcollapsebattler_rpgsprite_collapse
    end
end

class Sprite_Battler
  alias_method :seph_dontcollaspebattler_spritecharacter_update, :update
  def update
    collapses =  @battler != nil && @battler_visible && @battler.damage == nil and @battler.dead?
    seph_dontcollaspebattler_spritecharacter_update
    
    if collapses 
      @battler_visible = true
    end
  end
end

Is there anything there I'm not doing properly?
 

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