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.

Make Tibuda Enemy HP Bar compatible with RTAB

Yazus

Member

#--------------------------------------------------------------------------
# ? Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.enabled?('Animated Gradient Bars')
#==========================================================================
class Sprite_Battler
#--------------------------------------------------------------------------
alias_method :tibuda_enbar_spr_battler_update, :update
def update
tibuda_enbar_spr_battler_update
if $scene.is_a?(Scene_Battle) && $scene.spriteset.is_a?(Spriteset_Battle)
if @battler.is_a?(Game_Enemy)
if @hpbar.is_a?(Sprite_ActorHpBar)
@hpbar.visible = @battler_visible
@hpbar.update
else
file = Gradient_Bars::Hp_Bar_Graphic[self.class.to_s]
@hpbar = Sprite_ActorHpBar.new(@battler, self.x-48, self.y, 100, 8, file)
@hpbar.z = self.z - 1
end
end
end
end
#--------------------------------------------------------------------------
alias_method :tibuda_enbar_spr_battler_dispose, :dispose
def dispose
tibuda_enbar_spr_battler_dispose
@hpbar.dispose if @hpbar.is_a?(Sprite_ActorHpBar)
end
#--------------------------------------------------------------------------
end
#==========================================================================

#--------------------------------------------------------------------------
# End SDK Enabled Check
#--------------------------------------------------------------------------
end

Please, make this compatible with RTAB!
 
Working on it right now, but see this line???
Code:
@hpbar = Sprite_ActorHpBar.new(@battler, self.x-48, self.y, 100, 8, [B]file[/B])
there is no 6th value in Sprite_ActorHpBar in the Gradient Bars script, so I had to remove that. Even with the default battlesystem, that caused an error. Without it, I saw a bar under the battler that looked just fine.

And now...
Code:
#--------------------------------------------------------------------------
# ? Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.enabled?('Animated Gradient Bars')
#================================================= =========================
class Sprite_Battler
#--------------------------------------------------------------------------
  alias_method :tibuda_enbar_spr_battler_update, :update
  def update
    tibuda_enbar_spr_battler_update
    if $scene.is_a?(Scene_Battle) && $scene.spriteset.is_a?(Spriteset_Battle)
      if @battler.is_a?(Game_Enemy)
        if @hpbar.is_a?(Sprite_ActorHpBar)
          @hpbar.visible = @battler_visible
          @hpbar.update
        else
          file = Gradient_Bars::Hp_Bar_Graphic[self.class.to_s]
          @hpbar = Sprite_ActorHpBar.new(@battler, self.x-48, self.y, 100, 8)
          @hpbar.z = self.z - 1
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  alias_method :tibuda_enbar_spr_battler_dispose, :dispose
  def dispose
    tibuda_enbar_spr_battler_dispose
    @hpbar.dispose if @hpbar.is_a?(Sprite_ActorHpBar)
  end
  #--------------------------------------------------------------------------
end
#================================================= =========================

#--------------------------------------------------------------------------
# End SDK Enabled Check
#--------------------------------------------------------------------------
end
All I did was remove that one value.

Now, are you using Animated Battlers to convert it into a sideview system, or leaving RTAB as a front-view system? To be truthful, you won't be able to use Trickster's Gradient Bar script with RTAB without Animated Battlers due to some viewport issues that (accidentally) got corrected by Animated Battlers.

So, this will work just fine if you are using RTAB with Animated Battlers, but won't if you're just using RTAB alone.
 

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