Center Actor Battler- Compatible with KGC

Started by Daxisheart, March 01, 2009, 04:00:02 pm

Previous topic - Next topic

Daxisheart

Okay first of all, I want to center the actor battler. The defeult RTP scripts don't have this, center the battlers on the battle screen.

Second, please don't refer me to Tons of Addons. I'm almost certain that Tons of addons isn't compatible with KGC stuff.

Third, please don't refer me to a script that uses SDK...

I'm pretty sure everyone knows the kind of script I'm asking for... I love this kind of plug and play script, but strangely, I find no one ever uses it...
"Oh hey look godless stuff": ShowHide
What is really, really interesting is that while Abrahamic Christians give so much importance to their own free will, by their very definition of their God they deprive Him of free will.
The concept that He is not human and thus not derive the same morals as us really does not work. If his idea of morality, good or evil, is beyond us, is beyond our comprehension, why should we care? If he judges that not saving a woman from being raped a murdered a moral decision, then we should still trust him?
god i am such an atheist asshole.

I am on such a coolkid atheist rampage this week.

Aqua


shdwlink1993

KGC is a Japanese Scripter who writes a ton of scripts for both XP and VX. Which raises the critical question: What KGC script are you trying to make this compatible with? Tons should work, and if it as a whole doesn't work, then you could just take that one section out of Tons and use it.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Daxisheart

KGC SOFTWARE. Google it. Probably the best rmxp AND rmvx scripter EVER. Dare I say it? Yeah, probably even better than Blizzard. PROFESSIONAL LEVEL SCRIPTING.

Unfortunately, he's japanese... The script's still in english, but there's absolutely no instructions for me to read, and so I'm able to use like, 5% of all his scripts... If I knew how to code, I could probably figure it out, but I don't know jack about scripting...
"Oh hey look godless stuff": ShowHide
What is really, really interesting is that while Abrahamic Christians give so much importance to their own free will, by their very definition of their God they deprive Him of free will.
The concept that He is not human and thus not derive the same morals as us really does not work. If his idea of morality, good or evil, is beyond us, is beyond our comprehension, why should we care? If he judges that not saving a woman from being raped a murdered a moral decision, then we should still trust him?
god i am such an atheist asshole.

I am on such a coolkid atheist rampage this week.

Daxisheart

March 01, 2009, 04:10:44 pm #4 Last Edit: March 01, 2009, 04:16:20 pm by Daxisheart
Sorry, shadowlink, I posted just after you posted...

Anyhoo, I can take the script out of tons of addons? I didn't really know that... I'll test it out...


EDIT: Okay, I remember why I said that tons of addons isn't compatible with KGC: IT centers the battler picture, yes... but not the bars and the stats. IT moves the battler to the center, but the bars and command stuff aren't centered at all...

Can any get a script to move those things as well?
"Oh hey look godless stuff": ShowHide
What is really, really interesting is that while Abrahamic Christians give so much importance to their own free will, by their very definition of their God they deprive Him of free will.
The concept that He is not human and thus not derive the same morals as us really does not work. If his idea of morality, good or evil, is beyond us, is beyond our comprehension, why should we care? If he judges that not saving a woman from being raped a murdered a moral decision, then we should still trust him?
god i am such an atheist asshole.

I am on such a coolkid atheist rampage this week.

Viviatus

Which KGC Bar script are you using? If it's only the Overdrivebar I might be able to help you, but if it's the usual HPSP bars, well... then good luck finding someone who will help you. I've been messing around with the KGC scripts ever since I lay my hands on rmxp the first time and I've been editing the bar scrips (well it IS true KGC offers awesome scripts, and esp the HPSP/Overdrive bars simply rock! But every KGC script is horribly incompatible with any other non-KGC-script. Blizzards scripts aren't that incompatible at all.)
And after I don't know how many years I've made the overdrivebar to be displayed whereever I want it to be... but as for the other bars, I gave it up.

Daxisheart

Yup, using the HP/SP KGC bars as well... it's the flowing, I absolutely love the flowing... Yeah, I figured it was going to be tough... I've got the overdrive(FINALLY, I've figured out how overdrive works), HP/SP Bars, and the Active count battle, with that flowing gauge as well...
"Oh hey look godless stuff": ShowHide
What is really, really interesting is that while Abrahamic Christians give so much importance to their own free will, by their very definition of their God they deprive Him of free will.
The concept that He is not human and thus not derive the same morals as us really does not work. If his idea of morality, good or evil, is beyond us, is beyond our comprehension, why should we care? If he judges that not saving a woman from being raped a murdered a moral decision, then we should still trust him?
god i am such an atheist asshole.

I am on such a coolkid atheist rampage this week.

Viviatus

Yeah, that 'flowing' is the best thing those bars have... that makes them unique. I was hoping blizzy would do something like that someday.

Blizzard

March 03, 2009, 04:59:01 pm #8 Last Edit: March 03, 2009, 05:07:15 pm by Blizzard
That's actually easy enough to make. It's just that even my optimized version will probably cause some lag. :/ IDK, I might just make them.

Quote from: Daxisheart on March 01, 2009, 04:09:45 pm
KGC SOFTWARE. Google it. Probably the best rmxp AND rmvx scripter EVER. Dare I say it? Yeah, probably even better than Blizzard. PROFESSIONAL LEVEL SCRIPTING.


Are you kidding me?! Professionals don't code like that. The code is messy, unorganized and unoptimized. Sure, KGC has some nice scripts, but they are NIGHTMARES, extremely unextensible without major changes and extremely incompatible with many other scripts. Is that how you rate GOOD and PROFESSIONAL? Seriously, I wouldn't hire that guy for more than a minimum salary. And then I'd probably give him stupid tasks that need to be done which I am too lazy to do myself. Why? Because I will end up fixing his code in the end anyway. I was actually being nice to him since I gave him work so I can pay him. He should be thankful.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Calintz

Is it possible to create anything, and create 100% compatibility to everything!?

Blizzard

Of course not. There are simply scripts that are semantically incompatible (i.e. Center Battler and ABS). But if KGC coded his scripts with just a little bit more concern about compatibility, it would probably work with 3 times as many scripts as it does now.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Landith

@Calitnz: Yupp, that would be called the SDK :V:

I agree with blizzard though, his scripts are good but they have really bad incompatibility issues when using them. I would suggest to request a completely new script with the features you want, or see how he made them and make them yourself.

Blizzard

Wait, I have some simple overdrive script with way less lines of code somewhere around. Let me just go get it.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Calintz

Haha, I was just wondering, but screw the SDK, Lmao.. .. ..

Blizzard

March 03, 2009, 06:12:35 pm #14 Last Edit: March 03, 2009, 06:21:03 pm by Blizzard
I couldn't find it so I made a new one. Here. Took me roughly an hour to make it. It's simple, easy to use and compatible as hell.

Spoiler: ShowHide
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Easy Overdrive System by Blizzard
# Version: 2.0
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

module BlizzCFG
 
  MAX_RATE = false
  OVERDRIVE_RATE = 1000
  DRAW_OVERDRIVE = true
  DRAW_BAR = true
  OVERDRIVE_NAME = 'OD'
  OVERDRIVE_COMMAND_NAME = 'Overdrive'
  OVERDRIVE_COLOR = Color.new(0, 128, 255)
  OVERDRIVE_KIND = 11
 
end

#==============================================================================
# Game_Battler
#==============================================================================

class Game_Battler
 
  alias hp_is_equal_to_overdrive_later hp=
  def hp=(val)
    last_hp = self.hp
    hp_is_equal_to_overdrive_later(val)
    if self.is_a?(Game_Actor)
      if self.dead?
        self.overdrive = 0
      elsif self.hp < last_hp
        self.overdrive += (last_hp - self.hp) * BlizzCFG::OVERDRIVE_RATE /
            [last_hp, self.hp].min
      end
    end
  end
 
end

#==============================================================================
# Game_Actor
#==============================================================================

class Game_Actor
 
  attr_reader :overdrive
  attr_reader :overdrive_skills
 
  alias setup_overdrive_later setup
  def setup(actor_id)
    @overdrive = 0
    @overdrive_skills = []
    setup_overdrive_later(actor_id)
  end
 
  def overdrive=(val)
    @overdrive = val
    @overdrive = 0 if @overdrive < 0
    @overdrive = 1000 if @overdrive > 1000
  end
 
  def learn_overdrive(skill_id)
    if skill_id > 0 && !@overdrive_skills.include?(skill_id)
      @overdrive_skills.push(skill_id)
      @overdrive_skills.sort!
    end
  end
 
  def forget_overdrive(skill_id)
    @overdrive_skills.delete(skill_id)
  end
 
  def overdrive_can_use?(id)
    return (self.overdrive / 10 >= $data_skills[id].sp_cost)
  end
 
  def overdrive_text
    return "#{@overdrive/10}.#{@overdrive%10}%"
  end
 
end

#==============================================================================
# Window_Base
#==============================================================================

class Window_Base
 
  def draw_actor_overdrive(actor, x, y, w = 144)
    w = 120 if !$scene.is_a?(Scene_Menu)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y-16, width, 64, BlizzCFG::OVERDRIVE_NAME)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, w, 32, actor.overdrive_text, 2)
  end
 
  def draw_actor_overdrive_with_bar(actor, x, y, w = 148)
    w -= 12
    rate = actor.overdrive.to_f / 1000
    color1 = Color.new(80, 0, 0, 192)
    color2 = Color.new(240, 0, 0, 192)
    color3 = Color.new(80, 0, 0, 192)
    self.contents.gradient_bar(x, y, w, color1, color2, color3, rate)
    if $scene.is_a?(Scene_Battle)
      draw_actor_overdrive(actor, x, y, w)
    else
      draw_actor_overdrive(actor, x, y)
    end
  end
 
end

#==============================================================================
# Window_BattleStatus
#==============================================================================

class Window_BattleStatus
 
  alias refresh_overdrive_later refresh
  def refresh(number = 0)
    if !BlizzCFG::DRAW_OVERDRIVE
      refresh_overdrive_later
      return
    end
    self.contents.clear
    if $fontface != nil
      self.contents.font.name = $fontface
      self.contents.font.size = $fontsize
    elsif $defaultfonttype != nil
      self.contents.font.name = $defaultfonttype
      self.contents.font.size = $defaultfontsize
    end
    $game_party.actors.each_index {|i|
        if $tons_version != nil && $tons_version >= 4.82 &&
            $game_system.CENTER_BATTLER
          actor_x = case $game_party.actors.size
          when 1 then 4 + 240
          when 2 then 4 + 80 + i * 320
          when 3 then 4 + 80 + i * 160
          when 4 then 4 + i * 160
          end
        else
          actor_x = i * 160 + 4
        end
        draw_actor_name($game_party.actors[i], actor_x, -8)
        draw_actor_hp($game_party.actors[i], actor_x, 14, 120)
        draw_actor_sp($game_party.actors[i], actor_x, 44, 120)
        if BlizzCFG::DRAW_BAR && $tons_version != nil && $tons_version >= 4.82
          draw_actor_overdrive_with_bar($game_party.actors[i], actor_x, 74, 120)
        else
          draw_actor_overdrive($game_party.actors[i], actor_x, 74, 120)
        end
        if @level_up_flags[i]
          self.contents.font.color = normal_color
          self.contents.draw_text(actor_x, 100, 120, 32, 'LEVEL UP!')
        else
          draw_actor_state($game_party.actors[i], actor_x, 100)
        end}
  end
 
end

#==============================================================================
# Window_Command
#==============================================================================

class Window_Command
 
  attr_accessor :commands
 
  alias initialize_overdrive_later initialize
  def initialize(width, commands)
    initialize_overdrive_later(width, commands)
    @command2 = BlizzCFG::OVERDRIVE_COMMAND_NAME
  end
 
  def swap_commands
    @commands[1], @command2 = @command2, @commands[1]
    refresh
  end
 
  alias refresh_overdrive_later refresh
  def refresh
    refresh_overdrive_later
    if $fontface != nil
      self.contents.font.name = $fontface
      self.contents.font.size = $fontsize
    elsif $defaultfonttype != nil
      self.contents.font.name = $defaultfonttype
      self.contents.font.size = $defaultfontsize
    end
    if self.index != 1 || @commands[1] != BlizzCFG::OVERDRIVE_COMMAND_NAME
      draw_item(1, normal_color)
      self.contents.draw_text(4, 31, width-40, 32, '››', 2)
    elsif @commands[1] == BlizzCFG::OVERDRIVE_COMMAND_NAME
      self.contents.font.color = BlizzCFG::OVERDRIVE_COLOR
      (0...6).each {|j|
          self.contents.fill_rect(0, 32, width-32, 32, Color.new(0, 0, 0, 0))
          rect = Rect.new(164-j * 32, 32, width-40, 32)
          self.contents.draw_text(rect, @commands[1])
          Graphics.update}
    end
  end
 
end

#==============================================================================
# Window_Overdrive
#==============================================================================

class Window_Overdrive < Window_Skill
 
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    @actor.overdrive_skills.each {|i| @data.push($data_skills[i]) if $data_skills[i] != nil}
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      if $fontface != nil
        self.contents.font.name = $fontface
        self.contents.font.size = $fontsize
      elsif $defaultfonttype != nil
        self.contents.font.name = $defaultfonttype
        self.contents.font.size = $defaultfontsize
      end
      (0...@item_max).each {|i| draw_item(i)}
    end
  end
 
  def draw_item(i)
    skill = @data[i]
    if @actor.overdrive_can_use?(skill.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + i % 2 * (288 + 32)
    y = i / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    self.contents.draw_text(x + 232, y, 48, 32, "#{skill.sp_cost}%", 2)
  end
 
end

#==============================================================================
# Scene_Battle
#==============================================================================

class Scene_Battle
 
  alias main_overdrive_later main
  def main
    main_overdrive_later
    @overdrive_window.dispose if @overdrive_window != nil
  end
 
  alias update_phase3_overdrive_later update_phase3
  def update_phase3
    if @overdrive_window != nil && @overdrive_window.visible
      @overdrive_window.update unless defined?(SDK)
      update_phase3_overdrive_select
    else
      update_phase3_overdrive_later
    end
  end
 
  alias update_phase3_enemy_select_overdrive_later update_phase3_enemy_select
  def update_phase3_enemy_select
    end_overdrive_select_plus if Input.trigger?(Input::B)
    update_phase3_enemy_select_overdrive_later
  end
 
  alias update_phase3_actor_select_overdrive_later update_phase3_actor_select
  def update_phase3_actor_select
    end_overdrive_select_plus if Input.trigger?(Input::B)
    update_phase3_actor_select_overdrive_later
  end
 
  alias phase3_next_actor_overdrive_later phase3_next_actor
  def phase3_next_actor
    end_overdrive_select if @overdrive_window != nil
    phase3_next_actor_overdrive_later
  end
 
  def update_phase3_overdrive_select
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      end_overdrive_select if @overdrive_window.visible
    elsif Input.trigger?(Input::C)
      @skill = @overdrive_window.skill
      if @skill == nil || !@active_battler.overdrive_can_use?(@skill.id)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @active_battler.current_action.skill_id = @skill.id
      @overdrive_window.visible = false
      if @skill.scope == 1
        start_enemy_select
      elsif [3, 5].include?(@skill.scope)
        start_actor_select
      else
        phase3_next_actor
      end
    end
  end
 
  def start_overdrive_select
    @overdrive_window = Window_Overdrive.new(@active_battler)
    @overdrive_window.help_window = @help_window
    @actor_command_window.active = @actor_command_window.visible = false
  end
 
  def end_overdrive_select
    end_overdrive_select_plus
    @actor_command_window.swap_commands
    @overdrive_window.dispose
    @overdrive_window, @help_window.visible = nil, false
  end
 
  def end_overdrive_select_plus
    if @overdrive_window != nil
      if @overdrive_window.visible
        @actor_command_window.active = @actor_command_window.visible = true
        @help_window.visible = false
      else
        @overdrive_window.active = @overdrive_window.visible = true
      end
    end
  end
 
  def make_overdrive_action_result(battler)
    @skill = $data_skills[battler.current_action.skill_id]
    unless battler.current_action.forcing || battler.overdrive_can_use?(@skill.id)
      $game_temp.forcing_battler = nil
      @phase4_step = 1
      return
    end
    if $tons_version != nil && $tons_version >= 5.0
      battler.overdrive -= @skill.sp_cost * 10 if @repeat[0] <= 1
    else
      battler.overdrive -= @skill.sp_cost * 10
    end
    @status_window.refresh
    @help_window.set_text(@skill.name, 1)
    @animation1_id, @animation2_id = @skill.animation1_id, @skill.animation2_id
    @common_event_id = @skill.common_event_id
    set_target_battlers(@skill.scope)
    @target_battlers.each {|target| target.skill_effect(battler, @skill)}
  end
 
  alias update_phase4_step2_overdrive_later update_phase4_step2
  def update_phase4_step2
    update_phase4_step2_overdrive_later
    if @active_battler.current_action.kind == BlizzCFG::OVERDRIVE_KIND
      make_overdrive_action_result(@active_battler)
    end
  end
 
  alias update_phase3_basic_command_overdrive_later update_phase3_basic_command
  def update_phase3_basic_command
    restore_commands(@active_battler)
    return if update_overdrive_input(@active_battler)
    if !Input.press?(Input::LEFT) && !Input.press?(Input::RIGHT)
      update_phase3_basic_command_overdrive_later
    end
  end
 
  def restore_commands(battler)
    if @actor_command_window.index != 1 &&
        @actor_command_window.commands[1] == BlizzCFG::OVERDRIVE_COMMAND_NAME
      @actor_command_window.swap_commands
    end
  end
 
  def update_overdrive_input(battler)
    if @actor_command_window.index == 1 && Input.press?(Input::RIGHT)
      if @actor_command_window.commands[1] != BlizzCFG::OVERDRIVE_COMMAND_NAME
        $game_system.se_play($data_system.decision_se)
        @actor_command_window.swap_commands
      end
      if !Input.press?(Input::UP) && !Input.press?(Input::DOWN)
        @actor_command_window.update
      end
    elsif @actor_command_window.commands[1] == BlizzCFG::OVERDRIVE_COMMAND_NAME
      $game_system.se_play($data_system.cancel_se)
      @actor_command_window.swap_commands
    end
    if @actor_command_window.commands[1] == BlizzCFG::OVERDRIVE_COMMAND_NAME &&
        Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      battler.current_action.kind = BlizzCFG::OVERDRIVE_KIND
      start_overdrive_select
      return true
    end
    return false
  end
 
end


And OF COURSE it works with Tons of Add-ons (it goes BELOW Tons). I didn't make it RTAB compatible to get it done faster. And like all my scripts it's SDK-independent, but SDK compatible. Compatible.

It's completely plug 'n' play. The only thing you need to use is a special script call to make an actor learn an Overdrive skill.

$game_actors[ACTOR_ID].learn_overdrive(SKILL_ID)
$game_party.actors[POSITION].learn_overdrive(SKILL_ID)


Keep in mind that POSITION starts from 0, not 1. Cost is SP in %. i.e. a skill costs 45 SP, then it costs 45% as Overdrive skill. You can actually even use the same skill as normal and as overdrive skill without getting your game bugged. You still think KGC is good? THINK AGAIN!
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Calintz

Very nice...
So that script is an overdrive script that is NOT part of the CRSL system??

**You should make a new thread for that and place it into the database for people who don't want the entire CRSL system...

** Good job. Power up!! **

Blizzard

March 03, 2009, 06:20:18 pm #16 Last Edit: March 03, 2009, 06:22:33 pm by Blizzard
No, it's not part of CRLS. It has actually the same functionality that Seph's Limit Break has, just without the other 98% of useless filling-up methods; simply a pure Overdrive System. If more people want it, I'll put some proper instructions together and post it as official script.

Also, it DOES NOT work with CRLS. Use only one of them, either EOS or CRLS.

If one more person calls KGC better, I'll start claiming that just Blizz-ABS with 17000 lines of code and comments is bigger than all of KGC's scripts together. :V:
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Calintz

March 03, 2009, 07:23:35 pm #17 Last Edit: March 03, 2009, 07:26:12 pm by Calintz16438
I definitely wouldn't call KGC better...

I'm not sucking up or anything, but I have never seen anyone who works with compatibility as well as Blizzard does. He takes so much pride in his work, that compatibility has become second nature to all of his work.

Everything always works exactly like he claims it will when he releases a new script, and they work damn near lag free EVERY TIME. Say what you will, but I back Blizzard 100%. His scripts truly are second to none.

I don't know much about KGC, so could somebody maybe post a link to where I can find his material?? I would like to research some of his work.

**Perhaps this rivalry deserves it's own thread XD!!

Landith

What does this do exactly? Sorry but I'm unfamiliar with the Overdrive system.

Also, is this Blizz-ABS Compatible?

Calintz