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.

Simple Script Edit

Im using a large party script (for making your party bigger) and now theres a small bug with my CMS.
If i change the max party number (line 3 of party script), the CMS just makes the party display window bigger and makes the cursor big enough so only 4 of it will fit (meaning it still thinks theres 4 party members...)
Maybe editing the CMS will fix this....

Also, could someone put a play time and steps taken box in the lower right corner? Thanks ^_^

Here are the scripts

CMS
Code:
#==========================================================================
# ** SilentMenu
# Version: 1.0
# Thanks to Rudy Guillan, Sayonara-P, TDS, Le?n y Soramaro. 
#------------------------------------------------------------------------------
# CMS fully animated, transparent windows, map background, transition
# between scenes and game completion window.
#==============================================================================



#==============================================================================
# ** Window_Oro
#------------------------------------------------------------------------------
#  Esta ventana muestra el oro del grupo.
#==============================================================================

class Window_Oro < Window_Base
  #--------------------------------------------------------------------------
  # * Inicializacion de objetos
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Actualizacion
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    cx = contents.text_size($data_system.words.gold).width
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
  end
end



#==============================================================================
# ** Window_Localizaci?n
#------------------------------------------------------------------------------
#  Esta es la ventana que muestra el nombre del mapa
#==============================================================================

class Window_Localizacion< Window_Base
  
  #--------------------------------------------------------------------------
  # * Inicializacion de objetos
  #--------------------------------------------------------------------------
def initialize
  super(0, 0, 480, 64)
   self.contents = Bitmap.new(width - 32, height - 32)
   self.contents.font.name = "Tahoma"
   self.contents.font.size = 18
   refresh
end

  #--------------------------------------------------------------------------
  # * Actualizacion
  #--------------------------------------------------------------------------
def refresh
   self.contents.clear
   data = load_data("Data/MapInfos.rxdata")
   self.contents.font.color = system_color
   self.contents.draw_text(0, 0, 248, 32, "Location:")
   self.contents.font.color = normal_color
   self.contents.draw_text(90, 0, 208, 32, data[$game_map.map_id].name, 2)
end

end



#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  Esta es la ventana que muestra a los miembros del grupo.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  
  #--------------------------------------------------------------------------
  # * Inicializacion de objetos
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 480, 296)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Actualizacion
  #--------------------------------------------------------------------------
  def refresh
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 18
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 64
      actor = $game_party.actors[i]
      draw_actor_graphic(actor, 32, y + 60)
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 144, y)
      draw_actor_level(actor, x, y + 16)
      draw_actor_state(actor, x + 90, y + 16)
      draw_actor_exp(actor, x, y + 32)
      draw_actor_hp(actor, 32+230, y+16)
      draw_actor_sp(actor, 32+230, y+32)
    end
  end
  #--------------------------------------------------------------------------
  # * Renovacion del rectangulo de cursor
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * 64, self.width - 32, 64) 
    end
  end
end


#==============================================================================
# ** Window_Ayuda
#------------------------------------------------------------------------------
#  Esta es la ventana que muestra la ayuda sobre cada comando.
#==============================================================================

class Window_Ayuda < Window_Base  
  #--------------------------------------------------------------------------
  # * Inicializacion de objetos
  #--------------------------------------------------------------------------  
def initialize 
super(0, 0, 480, 64)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Tahoma"  
self.contents.font.size = 18
end

  #--------------------------------------------------------------------------
  # * Actualizacion
  #--------------------------------------------------------------------------
def update(help_text) 
  self.contents.clear 
  self.contents.draw_text(0, 0, 440, 32, help_text) 
end

end 

#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  Esta es la escena del menu.
#==============================================================================

class Scene_Menu
  
  #--------------------------------------------------------------------------
  # * Inicializacion de objetos
  #--------------------------------------------------------------------------  
def initialize(menu_index = 0)
   @menu_index = menu_index 
end
  
  #--------------------------------------------------------------------------
  # * Metodo principal
  #--------------------------------------------------------------------------  
def main
  @spriteset = Spriteset_Map.new
  viewport = Viewport.new(0, 0, 640, 480)
  viewport.tone = Tone.new(0, 0, 0,166)
  #--------------------------------------------------------------------------
  # * Llamado a las ventanas del menu
  #--------------------------------------------------------------------------  
  @window_Oro = Window_Oro.new
  @window_Oro.back_opacity = 130
  @window_Oro.x = 480 + 160 
  @window_Oro.y = 30
  @window_Localizacion = Window_Localizacion.new
  @window_Localizacion.back_opacity = 130
  @window_Localizacion.y = 392 + 190 
  @status_window = Window_MenuStatus.new
  @status_window.back_opacity = 130
  @status_window.x = -480
  @status_window.y = 95
  @window_Ayuda = Window_Ayuda.new
  @window_Ayuda.back_opacity = 130
  @window_Ayuda.y = -80
  @window_Ayuda.update(" ")
  #--------------------------------------------------------------------------
  # * Creaci?n de la ventana de comandos
  #--------------------------------------------------------------------------  
  s1 = $data_system.words.item
  s2 = $data_system.words.equip
  s3 = $data_system.words.skill
  s4 = "Status"
  s5 = "Save"
  s6 = "Exit"
  @command_window = Window_Command.new(160, [s1,s2,s3,s4,s5,s6]) 
  @command_window.x = 480 + 160
  @command_window.y = 95
  @command_window.height = 296
  @command_window.index = @menu_index 
  @command_window.back_opacity = 130
  #--------------------------------------------------------------------------
  # * Transici?n
  #--------------------------------------------------------------------------  
  Graphics.transition(8, "Graphics/Transitions/004-Blind04")
  loop do
   Graphics.update
   Input.update
   update 
   if $scene != self
    break
   end
end 

  Graphics.freeze
  @spriteset.dispose
  viewport.dispose
  @window_Oro.dispose
  @window_Localizacion.dispose
  @status_window.dispose 
  @command_window.dispose 
  @window_Ayuda.dispose 
end

  #--------------------------------------------------------------------------
  # * Animacio?n de Entrada
  #--------------------------------------------------------------------------
  def animacion_entrada

  @command_window.x -= 10 if @command_window.x > 480        
  @window_Localizacion.y -= 10 if @window_Localizacion.y > 392
  @window_Oro.x -= 10 if @window_Oro.x > 480    
  @status_window.x += 20 if @status_window.x < 0
  @window_Ayuda.y += 10 if @window_Ayuda.y < 30
  
  end

  #--------------------------------------------------------------------------
  # * Animaci?n de Salida
  #--------------------------------------------------------------------------
  def animacion_salida

  @command_window.x += 10 if @command_window.x < 640       
  @window_Localizacion.y += 10 if @window_Localizacion.y < 480
  @window_Oro.x += 10 if @window_Oro.x < 640    
  @status_window.x -= 20 if @status_window.x > -480
  @window_Ayuda.y -= 10 if @window_Ayuda.y > -64
  
  if @status_window.x <= -480
    $scene = Scene_Map.new
    $game_map.autoplay   
    return
  end
  
  
  end
  
  #--------------------------------------------------------------------------
  # * Actualizacion de Frames
  #--------------------------------------------------------------------------

  def update
    
    if @intro == nil
     animacion_entrada
   end
   
  if @salida == true     
    animacion_salida
    @intro = false
  end
   
    
    @status_window.update
    @window_Localizacion.update
    @window_Oro.update
    @command_window.update


case @command_window.index 
  when 0 
    @window_Ayuda.update("See and manage the items of your party.")
  when 1
    @window_Ayuda.update("Manage the equipment of the selected character.")
  when 2
    @window_Ayuda.update("See the abilities of each of your characters.") 
  when 3
    @window_Ayuda.update("A overview of a character's current status.")
  when 4
    @window_Ayuda.update("Save the game to continue it later.") 
  when 5
    @window_Ayuda.update("Exit to title screen or quit game.")
end  


    if @command_window.active
      update_command
      return
    end
    if @status_window.active
      update_status
      return
    end
#-----------------------------------#    
end# fin del update
#-----------------------------------#

PARTY SCRIPT (PARTY SIZE ->LINE 3)
Code:
class Game_Party
  
  Max_Party_Size = 8
  
  def max_party_size
    return Max_Party_Size
  end
  
  def add_actor(actor_id)
    actor = $game_actors[actor_id]
    if not @actors.include?(actor) and $game_party.actors.size < Max_Party_Size
      @actors.push(actor)
      $game_player.refresh
    end
  end
  
  def all_dead?
    if $game_party.actors.size == 0
      return false
    end
    for actor in @actors
      if actor.hp > 0
        return false
      end
      if actor.index >= 4
        return true
      end
    end
    return true
  end
end

class Scene_Menu
  
  alias party_swap_update_command update_command
  def update_command
    party_swap_update_command
    if Input.trigger?(Input::LEFT) or Input.trigger?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      @previous_index = @command_window.index
      @command_window.index = -1
      @command_window.active = false
      @status_window.active = true
      @status_window.index = @status_window.top_row
      return
    end
  end
  
  alias party_swap_update_status update_status
  def update_status
    if Input.trigger?(Input::B)
      unless @swapee != nil
        $game_system.se_play($data_system.cancel_se)
        if @command_window.index == -1
          @command_window.index = @previous_index
        end
        @command_window.active = true
        @status_window.active = false
        @status_window.index = -1
        return
      end
      @swapee = nil
      return
    end
    if Input.trigger?(Input::C) and @command_window.index == -1
      unless @swapee != nil
        @swapee = @status_window.index
        $game_system.se_play($data_system.decision_se)
        return
      end
      if @swapee == @status_window.index
        $game_system.se_play($data_system.decision_se)
        @swapee = nil
        return
      end
      $game_system.se_play($data_system.decision_se)
      party_ids = []
      for actor in $game_party.actors
        party_ids.push(actor.id)
      end
      swapee2 = @status_window.index
      if @swapee < swapee2
        for i in @swapee...party_ids.size
          $game_party.remove_actor(party_ids[i])
        end
        $game_party.add_actor(party_ids[swapee2])
        for i in (@swapee + 1)...party_ids.size
          unless i == swapee2
            $game_party.add_actor(party_ids[i])
          else
            $game_party.add_actor(party_ids[@swapee])
          end
        end
      else
        for i in swapee2...party_ids.size
          $game_party.remove_actor(party_ids[i])
        end
        $game_party.add_actor(party_ids[@swapee])
        for i in (swapee2 + 1)...party_ids.size
          unless i == @swapee
            $game_party.add_actor(party_ids[i])
          else
            $game_party.add_actor(party_ids[swapee2])
          end
        end
      end
      @swapee = nil
      @status_window.refresh
      return
    end
    if Input.trigger?(Input::LEFT) or Input.trigger?(Input::RIGHT)
      if @swapee == nil and @command_window.index == -1
        $game_system.se_play($data_system.cursor_se)
        @command_window.index = @previous_index
        @command_window.active = true
        @status_window.active = false
        @status_window.index = -1
      end
    end
    party_swap_update_status
  end
  
  
end

class Window_MenuStatus < Window_Selectable
  
  def initialize
    unless $game_party.actors.size > 4
      super(0, 0, 480, 480)
    else
      super(0, 0, 480, 160 * $game_party.actors.size)
    end
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
  end
  
  alias large_refresh refresh
  def refresh
    large_refresh
    self.height = 480
  end
  
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
      return
    end
    row = @index / @column_max
    if row < self.top_row
      self.top_row = row
    end
    if row > self.top_row + (self.page_row_max - 1)
      self.top_row = row - (self.page_row_max - 1)
    end
    cursor_width = self.width / @column_max - 32
    x = @index % @column_max * (cursor_width + 32)
    y = @index / @column_max * 116 - self.oy
    self.cursor_rect.set(x, y, cursor_width, 96)
  end
  
  def top_row
    return self.oy / 116
  end
  
  def top_row=(row)
    if row < 0
      row = 0
    end
    if row > row_max - 1
      row = row_max - 1
    end
    self.oy = row * 116
  end
  
  def page_row_max
    return 4
  end
end

class Scene_Battle
  def phase3_next_actor
    begin
      if @active_battler != nil
        @active_battler.blink = false
      end
      if @actor_index == ([$game_party.actors.size, 4].min - 1)
        start_phase4
        return
      end
      @actor_index += 1
      @active_battler = $game_party.actors[@actor_index]
      @active_battler.blink = true
    end until @active_battler.inputable?
    phase3_setup_command_window
  end
  
end

class Game_Actor < Game_Battler
  def exist?
    return super == self.index < 4
  end
end

Thanks everyone ^_^
 

Anonymous

Guest

first off ditch the party size script, and change max party size in game_party line 109

if @actors.size < 4 and not @actors.include?(actor)
change the four to whatever you want

this solves the problem of the battles only thinking there is 4 characters but you can't see the command windows of four or more with the front view battle, i use my own side battle script using sprites instead of battlers.
 

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