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.

Battle System Modifications

Hey first time posting anything on this msg board(at least that i know of...).
I'm know pretty much the basics to scripting. And rather quick learner. Just was wondering if someone could help me out with modifying the battle system. Or possibly give me a hand in creating a completly new battle system from scratch. And I will put your name in credits either way.

Pretty much all I have done so far is just change the battler images from the large pictures of the characters to a cropped image of the character shit to the left facing one taking a step so it looks like they are ready for action instead of just standing still. And I started to do the same thing for the Enemies just facing to the right.

Next I wanna start editing the battle system. When the battle starts. You get the option at the top of the screen saying "Fight" or "Escape." Pretty much I wanna get ride of that completly. And instead of having all the characters sharing the same window at the bottom. I want to have them in each of their own windows. Please Note that I am only using Three characters per party. When it becomes one of the players turn to choose an action I want the command window to open up just slight overlapping the top of their own window and offsetted to the right abit more. The "Escape" command that i was wanting to remove at the beginning of the fight i want to be added to the bottom of the command window. And yes this will be turned based. But the way that player turns will be set by is their level of agility. However has the highest agility has their turn first. Hope this is making any sense. But pretty much this is all i can think of wanting so far..

If Anyone can help me out it would be greatly appreciated just can you please make good and clear notes of what does what. Please and Thank you :D
 
To disable the Party Command Window use this

Code:
  alias no_party_command_start_phase2 start_phase2
  def start_phase2
    no_party_command_start_phase2
    @party_command_window.active = false
    @party_command_window.visible = false
    if $game_party.inputable?
      start_phase3
    end
  end

Now that I think out it I already done all of these modifications in my Battle System, which will be available very soon
 
And instead of having all the characters sharing the same window at the bottom. I want to have them in each of their own windows.

For that, use this (in a new script, above main):

Code:
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------

class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
  def initialize
    super(0, 160, 480, 160)
      self.opacity = 0
        @windows = []
        viewport = Viewport.new(0, 320, 480, 160)
        viewport.z = 100
      for i in 0...$game_party.actors.size
        x = i * 160 + (4 - $game_party.actors.size) * 80
        @windows[i] = Window_IndividualStatus.new(i, x)
      end
      @level_up_flags = [false, false, false, false]
      refresh
  end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
  super
    for window in @windows
    window.update
  end
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
  def dispose
    super
      for window in @windows
      window.dispose
    end
  end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
  def refresh(number = 0)
    if number == 0
      for i in 0...@windows.size
      @windows[i].refresh(@level_up_flags[i])
    end
    else
      @windows[number - 1].refresh(@level_up_flags[number - 1])
    end
  end

#==============================================================================
# ** Window_IndividualStatus
#==============================================================================

class Window_IndividualStatus < Window_Base
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
  def initialize(id, x)
    super(x, 320, 160, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 160
    @actor = $game_party.actors[id]
    refresh
  end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
  def refresh(level_up_flags = nil)
    self.contents.clear
      draw_actor_name(@actor, 4, 0)
      draw_actor_hp(@actor, 4, 60, 120)
      draw_actor_sp(@actor, 4, 84, 120)
      if level_up_flags
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 78, 120, 32, "LEVEL UP!")
      else
      draw_actor_state(@actor, 4, 34)
    end
  end
end
end

I don't know about the whole command window thing though. :-/
 

Kest

Member

Mastermind, there's an error in that (probably the line 16 formula) causing the windows to appear off to the right of the battler.

(Well, unless you were trying to center it. Because the battler is in normal position and the window is perfectly centered.)

(Looks likes it might be the "* 80" at the end of line 16.)
 

Kest

Member

Same basic setup as Mastermind's, different style:

Code:
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------

class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
  def initialize
    super(0, 160, 480, 160)
      self.opacity = 0
        @windows = []
        viewport = Viewport.new(0, 320, 480, 160)
        viewport.z = 100
      for i in 0...$game_party.actors.size
        # x = i * 160 + (4 - $game_party.actors.size) * 80
        x = i * 160 + (4 - $game_party.actors.size)
        @windows[i] = Window_IndividualStatus.new(i, x)
      end
      @level_up_flags = [false, false, false, false]
      refresh
  end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
  super
    for window in @windows
    window.update
  end
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
  def dispose
    super
      for window in @windows
      window.dispose
    end
  end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
  def refresh(number = 0)
    if number == 0
      for i in 0...@windows.size
      @windows[i].refresh(@level_up_flags[i])
    end
    else
      @windows[number - 1].refresh(@level_up_flags[number - 1])
    end
  end

#==============================================================================
# ** Window_IndividualStatus
#==============================================================================

class Window_IndividualStatus < Window_Base
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
  def initialize(id, x)
    super(x, 389, 160, 91)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 160
    @actor = $game_party.actors[id]
    refresh
  end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
  def refresh(level_up_flags = nil)
    self.contents.clear
      draw_actor_hp(@actor, 4, -9, 120)
      draw_actor_sp(@actor, 4, 10, 120)
      if level_up_flags
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 31, 120, 32, "LEVEL UP!")
      else
      draw_actor_state(@actor, 4, 31)
    end
  end
end
end
 
Right on well that works well. Just if I wanted to change how the windows are layed out. which part am i gonna wanna edit? Like having them all along the left part of the screen long an narrow so that they can hold info like this:

+------------------------------------------+
|CHAR NAME Hp / Hp : Mp / Mp |
+------------------------------------------+
|NEXT NAME Hp / Hp : Mp / Mp |
+------------------------------------------+

On the bottom right of the screen
 

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