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.

[XP] Version 2.8! CTB by Charlie Lee (v2.8) - aka a FFX like Battle System

Status
Not open for further replies.
DerVVulfman;300983 said:
Regarding the 'Actor Command Window' and 'Turn Order Display'

Is there a way to stop it refreshing/resetting when you go from one option to the other? It's understandable to have it refresh when it goes from one battler to the other, but when you go from 'Attack' to 'Item' in the system...

I'm not sure if I correctly understood your question, but I think that this is the point: when you change command, the expected delay changes, and so the turns potentially change (and they actually do the most of times). Does this answer your question?
 
This script is really well done!

But I've a question: Is it possible to configurate in the script, that the enemy-battler disappears if they're defeated? I mean a disappearing like in the standard-battle-system...do you understand, what I mean? :s
 
afterlife;304218 said:
i like the battle system and everything im just wondering how did u get ur sprite sheets...

It's all said in the first post, the party members are by Dollmage, and the enemies come from sprites found on the Internet and assembled by me. To find more take a look around in the Resource Analisys forum, and thank you for you comment.
 
Question!
Is it possible to have only the status window?
I mean to have the battle status window in the corner without the other bits of the battle system.
That would be absolute greatness.
 
Finlander;305893 said:
Question!
Is it possible to have only the status window?
I mean to have the battle status window in the corner without the other bits of the battle system.
That would be absolute greatness.

Copy this above Main:
Code:
#==============================================================================
# â–  Window_Base Add On
#------------------------------------------------------------------------------
class Window_Base
  #-----------------------------------------
  def draw_actor_parameter2(actor, x, y, type, first, second)
    case type
    when 0
      parameter_name = $data_system.words.atk
      parameter_value = actor.atk
    when 1
      parameter_name = $data_system.words.pdef
      parameter_value = actor.pdef
    when 2
      parameter_name = $data_system.words.mdef
      parameter_value = actor.mdef
    when 3
      parameter_name = $data_system.words.str
      parameter_value = actor.str
    when 4
      parameter_name = $data_system.words.dex
      parameter_value = actor.dex
    when 5
      parameter_name = $data_system.words.agi
      parameter_value = actor.agi
    when 6
      parameter_name = $data_system.words.int
      parameter_value = actor.int
    when 7
      parameter_name = "Evasion"
      parameter_value = actor.eva
    end
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, first, 32, parameter_name)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + first, y, second, 32, parameter_value.to_s, 2)
  end

  #-----------------------------------------
  def draw_actor_level2(actor, x, y,width = 144)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, "Lv")
    self.contents.font.color = normal_color
    if width - 32 >= 108
      hp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      hp_x = x + width - 48
      flag = false
    end
    self.contents.draw_text(hp_x, y, 48, 32, actor.level.to_s, 2)
  end
  #-----------------------------------------
  def draw_item_name_24(item, x, y)
    if item == nil
      return
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 28, y, 212, 24, item.name)
  end

end

#==============================================================================
# â–  Window_Status On Battle
#------------------------------------------------------------------------------
class Window_Status_On_Battle < Window_Base
  #--------------------------------------------------------------------------
  # actor
  #--------------------------------------------------------------------------
  attr_accessor :actor
  attr_accessor :visible_memory
  def initialize(actor=nil)
    super(0, 0, 400, 152)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.size = 14      
    self.back_opacity = 250
    self.opacity = 250
    @actor = actor
    if(@actor!=nil)
      refresh
    end
    @visible_memory=false
  end

  #--------------------------------------------------------------------------
  # Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    offset1=8

    for i in 0..6
      draw_actor_parameter2(@actor, 92, 16*i-offset1, i, 60, 32)
    end  
    
    draw_actor_name(@actor, 0, 32-offset1-32)
    draw_actor_class(@actor, 0, 64-offset1-32-16)
    
    draw_actor_hp(@actor, 0, 32-offset1, 80)
    draw_actor_sp(@actor, 0, 48-offset1, 80)
    draw_actor_level2(@actor, 0, 64-offset1,80)
    
    self.contents.font.color = system_color
=begin
    self.contents.draw_text(96, 96, 80, 32, "EXP")
    self.contents.draw_text(96, 128, 80, 32, "NEXT")
    self.contents.font.color = normal_color
    self.contents.draw_text(96 + 80, 96, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text(96 + 80, 128, 84, 32, @actor.next_rest_exp_s, 2)
    self.contents.font.color = system_color
=end

    itemsx=220
    itemsy=32-offset1-20
    #self.contents.draw_text(368, 160, 192, 32, "Equipment")
    draw_item_name_24($data_weapons[@actor.weapon_id], itemsx, itemsy)
    draw_item_name_24($data_armors[@actor.armor1_id], itemsx, itemsy+24*1)
    draw_item_name_24($data_armors[@actor.armor2_id], itemsx , itemsy+24*2)
    draw_item_name_24($data_armors[@actor.armor3_id], itemsx, itemsy+24*3)
    draw_item_name_24($data_armors[@actor.armor4_id], itemsx , itemsy+24*4)
  end
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  end
end


class Scene_Battle
  
  alias phase3_setup_command_window_sob phase3_setup_command_window
  def phase3_setup_command_window
    phase3_setup_command_window_sob
    if @active_battler.is_a? Game_Enemy
      @status_on_battle_window.visible=false
    else
      @status_on_battle_window.actor=@active_battler
      @status_on_battle_window.refresh
      @status_on_battle_window.visible=@status_on_battle_window.visible_memory unless ($reaction and !PLAYABLE_REACTION)
    end
  end
  
  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : basic command)
  #--------------------------------------------------------------------------
  alias update_phase3_basic_command_sob update_phase3_basic_command
  def update_phase3_basic_command
    @status_on_battle_window.visible=@status_on_battle_window.visible_memory
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by actor command window cursor position
      case @actor_command_window.index
      when 4  # status
        $game_system.se_play($data_system.decision_se)
        @status_on_battle_window.actor=@active_battler
        @status_on_battle_window.refresh
        @status_on_battle_window.visible=!@status_on_battle_window.visible
        @status_on_battle_window.visible_memory=@status_on_battle_window.visible
        return
      end
    end
    update_phase3_basic_command_sob
  end
  
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Initialize each kind of temporary battle data
    $game_temp.in_battle = true
    $game_temp.battle_turn = 0
    $game_temp.battle_event_flags.clear
    $game_temp.battle_abort = false
    $game_temp.battle_main_phase = false
    $game_temp.battleback_name = $game_map.battleback_name
    $game_temp.forcing_battler = nil
    # Initialize battle event interpreter
    $game_system.battle_interpreter.setup(nil, 0)
    # Prepare troop
    @troop_id = $game_temp.battle_troop_id
    $game_troop.setup(@troop_id)
    # Make actor command window
    s1 = $data_system.words.attack
    s2 = $data_system.words.skill
    s3 = $data_system.words.guard
    s4 = $data_system.words.item
    @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4, "Status"])
    @actor_command_window.y = 160-32
    @actor_command_window.back_opacity = 160
    @actor_command_window.active = false
    @actor_command_window.visible = false
    # Make other windows
    @party_command_window = Window_PartyCommand.new
    @help_window = Window_Help.new
    @help_window.back_opacity = 160
    @help_window.visible = false
    @status_window = Window_BattleStatus.new
    @message_window = Window_Message.new
    # Make sprite set
    @spriteset = Spriteset_Battle.new
    # Initialize wait count
    @wait_count = 0
    # Execute transition
    if $data_system.battle_transition == ""
      Graphics.transition(20)
    else
      Graphics.transition(40, "Graphics/Transitions/" +
        $data_system.battle_transition)
    end
    # Start pre-battle phase
    start_phase1
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Refresh map
    $game_map.refresh
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @actor_command_window.dispose
    @party_command_window.dispose
    @help_window.dispose
    @status_window.dispose
    @message_window.dispose
    if @skill_window != nil
      @skill_window.dispose
    end
    if @item_window != nil
      @item_window.dispose
    end
    if @result_window != nil
      @result_window.dispose
    end
    # Dispose of sprite set
    @spriteset.dispose
    # If switching to title screen
    if $scene.is_a?(Scene_Title)
      # Fade out screen
      Graphics.transition
      Graphics.freeze
    end
    # If switching from battle test to any screen other than game over screen
    if $BTEST and not $scene.is_a?(Scene_Gameover)
      $scene = nil
    end
  end
  
  alias main_sob main
  def main
    @status_on_battle_window = Window_Status_On_Battle.new
    @status_on_battle_window.visible = false
    main_sob
    @status_on_battle_window.dispose
  end

  alias start_phase4_sob start_phase4 
  def start_phase4
    @status_on_battle_window.visible = false
    start_phase4_sob
  end
  
  alias start_skill_select_sob start_skill_select 
  def start_skill_select
    @status_on_battle_window.visible = false
    start_skill_select_sob
  end
  
  alias start_item_select_sob start_item_select 
  def start_item_select
    @status_on_battle_window.visible = false
    start_item_select_sob
  end
  
  alias start_enemy_select_sob start_enemy_select 
  def start_enemy_select
    @status_on_battle_window.visible = false
    start_enemy_select_sob
  end

end
...you should see this:
http://img134.imageshack.us/img134/4964/63344938tg1.th.png[/IMG]

It's almost everything done with aliases for better compatibility, everything but the "main" method in Scene_Battle, for which I put the code that could be inserted with an alias in that way and I also neeeded to modify the following lines in the body of the method.

Code:
    @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4[COLOR=Red], "Status"[/COLOR]])
    @actor_command_window.y = 160[COLOR=Red]-32[/COLOR]
 
I'm certainly impressed by this, I really am. If I weren't customising my own battle system for my game I'd use this. But I certainly love what you've done with it!
 
Is it possible to use static battlers for the oponents only?
like:
for the heroes we have animated battleres
for the enemy standard battlers
 
Mishimo;307414 said:
Is it possible to use static battlers for the oponents only?
like:
for the heroes we have animated battleres
for the enemy standard battlers

Yes, use
Code:
MNK_STATIONARY_ENEMIES =  true
in the configuration part of Minkoff/DerVVulfman embedded BS.

Please read the FAQ, thanks.
 
I used that but it didnt worked...
the enemy didnt move but the animations didn't stopped if you know what I mean :s
 
Mishimo;308089 said:
I used that but it didnt worked...
the enemy didnt move but the animations didn't stopped if you know what I mean :s

Err... so you want the default battler sprites for the enemies... I think that you should also set this value then:
Code:
DEFAULT_ENEMY           = true
However let me suggest you to read the .pdf guide of Minkoff/DerVVulfman's Animation System, it will answer all your questions.
 
This sure is getting very annoying to you but i already read the .pdf like u said and tried everything and i can't get it to work well :S

where am i suposed to set the value you gave me on your last post?
cuz the minkoff animation system you included in your demo is different from the one inDerVVulfman's main post and i cant find the place to insert that value on your script.

sorry for taking your time :s
thank you in advance!
 
Mishimo;308220 said:
This sure is getting very annoying to you but i already read the .pdf like u said and tried everything and i can't get it to work well :S

where am i suposed to set the value you gave me on your last post?
cuz the minkoff animation system you included in your demo is different from the one inDerVVulfman's main post and i cant find the place to insert that value on your script.

sorry for taking your time :s
thank you in advance!

Make sure that you have downloaded the version 2.0 of my CTB. Then you should be able to access the Configuration part of the Animation System as in the picture below, and set to true the DEFAULT_ENEMY value.
http://img503.imageshack.us/img503/7372/65099172rl8.th.jpg[/IMG]
 
Version 2.1 is available.

Skills Learning System v1.2 with renewed graphics now featured
Minkoff/DerVVulfman v10.3 animation system adopted
Fixed a little glitch that displayed a defending char in the wrong position.
 

xkrimx

Member

I cant seem to get the battlers to work properly, when I put them in they just show up as the whole picture, not just one single frame. Please help D:
 
xkrimx;310104 said:
I cant seem to get the battlers to work properly, when I put them in they just show up as the whole picture, not just one single frame. Please help D:

Download the last demo (v2.1) please. Then if the demo works for you, try to find the differences in the Configuration between the demo and your project.
Last, refer to the Animation System Guide (see the FAQs in the first post for a link) because this kind of problem is likely to not depend on my BS, but on the Anim.Sys. instead.
 
Status
Not open for further replies.

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