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.

Net RMXP v2.1.7 support needed

hi, i have just downloaded Net RMXP v2.1.7

and i have to fix a little error in the Raz Hud Script

somebody said to replace it with this

Code:
#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------
SDK.log("Raz Hud", "Raz", 1, "??.??.??")
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.state("Raz Hud") == true
#==============================================================================
# ** Hud Menu
#==============================================================================
# Raziel
# Version 2.0
# 2007-08-18
#------------------------------------------------------------------------------
#===============================================================================
# * Module Raz_Hud
#===============================================================================

module Raz_Hud
  #set it to true to center the hud if there are less than four party members
  Center_hud = false
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs map screen processing.
#==============================================================================

class Scene_Map 
  #----------------------------------------------------------------------------
  # * Alias Listings
  #----------------------------------------------------------------------------
  alias raz_hud_main main 
  alias raz_hud_update update 
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main 
    @hud_dummy = [] 
    for i in 0...$game_netparty.actors.size
      @hud_dummy[i] = Window_Dummy_Raz.new(i)
    end 
    @hud_window = Window_HUD.new
    raz_hud_main 
    @hud_window.dispose 
    @hud_dummy.each { |hud| hud.dispose }
  end 
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update 
  if @hud_window.visible
    if @hud_dummy[$game_netparty.actors.size] != nil
      @hud_dummy.each{|hud|  hud.dispose} 
      @hud_dummy = []
      for i in 0...$game_netparty.actors.size
        @hud_dummy[i] = Window_Dummy_Raz.new(i)
      end 
    end
    @hud_window.update 
    end
    raz_hud_update 
  end 
  
  def toggle_hud(s)
    @hud_window.visible = s
    @hud_dummy.each { |hud| hud.visible = s }
  end

end 
#===============================================================================
# * Window_HUD
#===============================================================================

class Window_HUD < Window_Base 
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize 
    super(0, -32, 800, 600) 
    self.contents = Bitmap.new(width - 32, height - 32) 
    self.back_opacity = 0 
    self.windowskin = RPG::Cache.windowskin("Blank")
    self.visible = true # $game_switches[Raz_Hud::SWITCH_ID]
    refresh 
  end 
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh 
    self.contents.clear 
    @old_hp, @old_sp, @old_exp, @old_size, @old_chn = [],[],[],$game_netparty.actors.size,[]
    
    for actor in $game_netparty.actors
      @old_hp << actor.hp; @old_sp << actor.sp; @old_exp << actor.exp
        if actor.is_a?(Game_Actor)
          a = $game_netparty.actors.size - 1 
          center = Raz_Hud::Center_hud == true ? (240 - (a * 80)) : 25
          x = ($game_netparty.actors.index(actor) * 90 - 25) + center
        else
          x = 16
          y = 52 * $game_netparty.actors.index(actor) + 52
        end
    if actor.is_a?(Game_Actor)
      self.contents.font.size = 14
      draw_actor_graphic(actor, x + 60 , 445-34) 
      self.contents.font.color = normal_color 
      self.contents.draw_text(x, 360-8, 100, 32, actor.name) 
      draw_slant_bar(x + 8, 396, actor.hp+1, actor.maxhp+1, 100 - 40, 6) 
      draw_slant_bar(x + 8, 416, actor.sp+1, actor.maxsp+1, 100 - 40, 6, Color.new(0, 0, 150), Color.new(60, 155, 155)) 
      now_exp = actor.level == 99 ? 1 : actor.now_exp
      next_exp = actor.level == 99 ? 1 : actor.next_exp
      draw_slant_bar(x + 8, 436, now_exp+1, next_exp+1, 100 - 40, 6, Color.new(0, 150, 0), Color.new(60, 255, 60)) 
      self.contents.font.size = 14
      draw_actor_state(actor, x, 360+5)
      self.contents.font.color = Color.new(255,255,255) 
      self.contents.font.bold = true 
      self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color 
      self.contents.draw_text(x + 16 , 382, 100, 32, "#{actor.hp}/#{actor.maxhp}", 1) 
      self.contents.font.color = actor.sp == 0 ? crisis_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color 
      self.contents.draw_text(x + 16 , 402, 100, 32, "#{actor.sp}/#{actor.maxsp}", 1) 
      self.contents.font.color = Color.new(186,255,255) 
      self.contents.font.size = 16
      self.contents.font.bold = false 
      self.contents.draw_text(x, 384, 50, 32, $data_system.words.hp) 
      self.contents.draw_text(x, 404, 50, 32, $data_system.words.sp) 
      self.contents.draw_text(x, 424, 50, 32, "Exp")
    elsif actor.is_a?(Game_NetPlayer)
      self.contents.font.size = 14
      x = 16
      y = 52 * ($game_netparty.actors.index(actor) + 1) + 52
      draw_actor_graphic(actor, x, y)
      draw_slant_bar(x + 2 , y - 20 , actor.hp+1, actor.maxhp+1,48,3) 
      draw_slant_bar(x + 2 , y - 20 + 6, actor.sp+1, actor.maxsp+1,48,3,Color.new(0, 128,255),Color.new(190, 220,255)) 
        if actor.is_a?(Game_Actor)
          now_exp =  actor.level == 99 ? 1 : actor.now_exp
          next_exp = actor.level == 99 ? 1 : actor.next_exp
          draw_slant_bar(x + 2,  y - 20 + 12, now_exp+1, next_exp+1, 48, 3,Color.new(0, 150, 0), Color.new(60, 255, 60)) 
        end
      end
    end 
    
  end 
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update 
    $game_netparty.actors[0] = $game_party.actors[0]
    refresh if @old_size != $game_netparty.actors.size
    @old_hp.each_with_index {|hp, index| refresh if hp != $game_netparty.actors[index].hp}    
    @old_sp.each_with_index {|sp, index| refresh if sp != $game_netparty.actors[index].sp}    
    @old_exp.each_with_index {|exp, index| refresh if exp != $game_netparty.actors[index].exp}
  end 
end 
#===============================================================================
# * Window_Dummy
#===============================================================================

class Window_Dummy_Raz < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #   size: Party's size
  #--------------------------------------------------------------------------
  def initialize(size)
    @old_size = $game_netparty.actors.size
    x = Raz_Hud::Center_hud == true ? 240 - ($game_netparty.actors.size - 1) * 80 : 0
    super(160 * size + x, 372,160, 108)
    self.visible = true#$game_switches[Raz_Hud::SWITCH_ID]
    self.opacity = 0
  end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================

class Window_Base < CG::Window
  #--------------------------------------------------------------------------
  # * Draw Slant Bar (by SephirothSpawn)
  #--------------------------------------------------------------------------
  def draw_slant_bar(x, y, min, max, width = 152, height = 6, 
  bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255)) 
    for i in 0..height 
      self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255)) 
    end 
    for i in 1..(height - 1) 
      r = 100 * (height - i) / height + 0 * i / height 
      g = 100 * (height - i) / height + 0 * i / height 
      b = 100 * (height - i) / height + 0 * i / height 
      a = 255 * (height - i) / height + 255 * i / height 
      self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a)) 
    end 
    for i in 1..( (min / max.to_f) * width - 1) 
      for j in 1..(height - 1) 
        r = bar_color.red * (width - i) / width + end_color.red * i / width 
        g = bar_color.green * (width - i) / width + end_color.green * i / width 
        b = bar_color.blue * (width - i) / width + end_color.blue * i / width 
        a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width 
        self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a)) 
      end 
    end 
  end 
end 
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor 
  #--------------------------------------------------------------------------
  # * Now Exp
  #--------------------------------------------------------------------------
  def now_exp 
    return @exp - @exp_list[@level] 
  end 
  #--------------------------------------------------------------------------
  # * Next Exp
  #--------------------------------------------------------------------------
  def next_exp  
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 
  end 
end

end

i am able to login now with this

but the HP is 1 and Sp is 0

can somebody help me
 

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