Author Topic: [XP] Action Recharge Times (for BABS)  (Read 36138 times)

Offline Moshan

  • Transcended Spirit
  • ***
  • Posts: 135
  • LV: 1
  • Gender: Male
    • View Profile
Re: [XP] Action Recharge Times (for BABS)
« Reply #100 on: June 01, 2014, 10:07:33 PM »
 Hello!
 Sorry for necroposting but I'm having some issues with this script.
 The problem is kinda simple : It laggs very, very much (I'm using many other scripts including higher resolution) but when I have 3-4 spells recharging it's almost unplayable. Is there a way to modify something in the script to make it more smooth? I'm thinking of removing the cooldown bars over the spells, or something similar that may improve performance.
 Thanks in advance!

Offline winkio

  • Epiq
  • Administrator
  • Guardian of Chaos
  • *****
  • Posts: 4506
  • LV: 199
  • Gender: Male
  • I am lying.
    • View Profile
Re: [XP] Action Recharge Times (for BABS)
« Reply #101 on: June 01, 2014, 10:44:26 PM »
yea, removing the graphical part would definitely improve performance

Offline Moshan

  • Transcended Spirit
  • ***
  • Posts: 135
  • LV: 1
  • Gender: Male
    • View Profile
Re: [XP] Action Recharge Times (for BABS)
« Reply #102 on: June 02, 2014, 05:18:32 PM »
 Thanks for reply!
 Looks like I can't figure it out how to solve this.  :'( I think I removed the drawing thing but it still laggs. Even with the VX engine it still drops to 5 fps.
 Is there a possibility to modify blizz's script to draw the countdowns over the hotkeys (only the numbers) like in winkio's script?
Code: [Select]
class BlizzABS::Cache
 
  alias init_recharger_later initialize
  def initialize
    init_recharger_later
    @data['empty_hud_yellow_bar'] = @data['empty_hud_green_bar'].clone
    @data['empty_hud_yellow_bar'].hue_change(-60)
    @data['hud_yellow_bar'] = @data['hud_green_bar'].clone
    @data['hud_yellow_bar'].hue_change(-60)
    #p 1
    #p self.image('hud_yellow_bar')
  end
   
end
 
$BlizzABS = BlizzABS::Processor.new

class Recharger < Sprite
  def initialize
    super
    self.bitmap = Bitmap.new(156, 14)
    color = case BlizzABS::Config::HUD_TYPE
    when 0 then Color.new(255, 255, 255, 192)
    when 1 then Color.new(0, 0, 0, 0)
    end
    self.bitmap.fill_rect(0, 0, 156, 14, color) if color.is_a?(Color)
    self.x = 4
    update
  end
  def update
    super
    now, full = $game_player.recharge
    self.bitmap.gradient_bar_hud(0, 0, 154, now.to_f/full, 'hud_yellow_bar')
    self.dispose if !$game_player.recharging?
  end
end

class Scene_Map
  alias main_recharger_later main
  def main
    @recharge_bar = Recharger.new if $game_player.recharging?
    main_recharger_later
    @recharge_bar.dispose if @recharge_bar != nil
  end
  alias upd_recharger_later update
  def update
    if $game_player.recharging? && @recharge_bar == nil
      @recharge_bar = Recharger.new
    end
    upd_recharger_later
    if @recharge_bar != nil
      if @hud != nil
        @recharge_bar.y = @hud.y + @hud.bitmap.height + 4
      else
        @recharge_bar.y = 4
      end
      @recharge_bar.update
      @recharge_bar = nil if @recharge_bar.disposed?
    end
  end
end

class Map_Battler
  attr_reader :recharge
  alias upd_recharger_later update
  def update
    @recharge[0] -= 1 if recharging?
    upd_recharger_later
  end
  alias freeze_action_recharger_later freeze_action
  def freeze_action
    return (freeze_action_recharger_later || recharging?)
  end
  alias skill_penalty_recharger_later skill_penalty
  def skill_penalty(id)
    re = BlizzABS::Skills.recharge(id)
    @recharge = [re, re]
    return skill_penalty_recharger_later(id)
  end
  alias item_penalty_recharger_later item_penalty
  def item_penalty(id)
    re = BlizzABS::Skills.recharge(id)
    @recharge = [re, re]
    return item_penalty_recharger_later(id)
  end
  def recharging?
    return (@recharge != nil && @recharge[0] > 0)
  end
end

class Map_Actor
  alias attack_penalty_recharger_later attack_penalty
  def attack_penalty
    re = BlizzABS::Weapons.recharge(@battler.weapon_id)
    @recharge = [re, re]
    return attack_penalty_recharger_later
  end
end

class Map_Enemy
  alias attack_penalty_recharger_later attack_penalty
  def attack_penalty
    re = BlizzABS::Enemies.recharge(@battler.weapon_id)
    @recharge = [re, re]
    return attack_penalty_recharger_later
  end
end

module BlizzABS
  module Weapons
    def self.recharge(id)
      case id
      when 1 then return 40
      end
      return 40
    end
  end
  module Skills
    def self.recharge(id)
      case id
      when 1 then return 40
      end
      return 40
    end
  end
  module Items
    def self.recharge(id)
      case id
      when 1 then return 40
      end
      return 40
    end
  end
  module Enemies
    def self.recharge(id)
      case id
      when 1 then return 40
      end
      return 40
    end
  end
end
I'm refering to this script.
 Thanks in advance!
 
« Last Edit: June 03, 2014, 05:49:41 PM by adytza001 »