Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Zamknięty przez: Ayene
Nie 30 Paź, 2011 11:45
Problem z HUD-em
Autor Wiadomość
hubertwalczak8 



Dołączył: 09 Gru 2010
Posty: 14
Wysłany: Sob 29 Paź, 2011 15:36
Problem z HUD-em
Hej, ostatnio chciałem sobie zainstalować jakiegoś dobrego HUD-a, i znalazłem jeden fajny, ale po zainstalowaniu i włączeniu wyświetla się coś takiego:
http://imageshack.us/phot...28/errorjs.png/
Kod:
################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                               HUD BluePrint v3.2                             #
#                                                                              #
################################################################################

# To toggle the hud's display, just do a callscript "hud"
# To set the hud's display, just do a callscript "hud(true)" or "hud(false)"

module Module_Name; WLH = Window_Base::WLH
################################################################################
# User Customazation
  Start_Display = true #true/false
  Opacity = 100 #0-255
  BG_Display = true #true/false
  Hide = true #true/false
  EXP_NAME = "E"
################################################################################
# Don't touch below (if ure're not a scripter)
################################################################################
=begin #########################################################################
Some standard value's you might want to use are allready pre-defiend so that you
don't have to write the whole function for your self anymore.
Here follows a list: (just copy+past and fill in the value's to let it work)
  * draw_actor_graphic(actor, x, y)
  * draw_actor_face(actor, x, y, size = 96)
  * draw_actor_name(actor, x, y)
  * draw_actor_class(actor, x, y)
  * draw_actor_level(actor, x, y)
  * draw_actor_state(actor, x, y, width = 96)
  * draw_actor_hp(actor, x, y, width = 120)
  * draw_actor_mp(actor, x, y, width = 120)
  * draw_actor_parameter(actor, x, y, type)
      FOR TYPE: 0=atk, 1=def, 2=spi, 3=agi
  * draw_item_name(item, x, y, enabled = true)
  * draw_currency_value(value, x, y, width)
 
  Custom new standard functions:
  * draw_actor_exp(actor, x, y, width = 120)
=end ###########################################################################
################################################################################
  def xywh
    @x = 0 #Set the x-position
    @y = 0 #Set the y-position
    @w = 96+32 #Set the width
    @h = 72+24+32 #Set the height
    return[@x, @y, @w, @h]
  end; def hud_values #Set the value's that you're using (also used at refresh)
    @actor = $game_party.members[@index]
    @temp_states = @actor.states
    #Example: @actor = $game_party.members[0]
  end; def hud_contents #Set the things you want to draw
    draw_actor_graphic(@actor, 14, 42)
    draw_actor_hp(@actor, 32, 0, 93-32)
    draw_actor_mp(@actor, 32, 24, 96-32)
    draw_actor_exp(@actor, 0, 48, 96)
    draw_actor_state(@actor, 0, 72, 96)
    #Example: draw_actor_hp(@actor, x, y)
  end; def hud_refresh?
    if @temp_actor != @actor or
    @temp_actor.character_name != @actor.character_name or
    @temp_actor.character_index != @actor.character_index or
    @temp_actor.hp != @actor.hp or
    @temp_actor.mp != @actor.mp or
    @temp_actor.exp != @actor.exp or
    @temp_states != @actor.states
    @temp_states = @actor.states
    #Example: if @actor != $game_party.members[0]
    return true; end
  end
end
################################################################################
# Don't touch below
################################################################################

################################################################################
# Call script function
################################################################################
def hud(arg = nil)
  $game_system.hud_display = !$game_system.hud_display if arg == nil
  $game_system.hud_display = arg if arg != nil
end
################################################################################
#------------------------------------------------------------
# * Hud_Name: Create Hud window
#------------------------------------------------------------
class Hud_Name < Window_Base
  include Module_Name
 
  attr_reader :index
 
  def initialize(index)
    @index = index
    super(xywh[0],xywh[1],xywh[2],xywh[3])
    self.visible = $game_system.hud_display
    self.opacity = Opacity
    self.opacity = 0 if !BG_Display
    hide_status if Hide
    hud_values
    refresh
  end
 
  def refresh
    contents.clear
    hud_values
    hud_contents
  end
 
  def hide_status
    if Hide
      if $game_player.screen_x + 16 > self.x and
      $game_player.screen_y + 4 > self.y and
      $game_player.screen_x - 16 < self.x + self.width and
      $game_player.screen_y - 28 < self.y + self.height
        self.opacity = Opacity if BG_Display
        self.contents_opacity = Opacity
      else
        self.opacity = 255 if BG_Display
        self.contents_opacity = 255
      end
    end
  end
 
  def update
    self.visible = $game_system.hud_display
    return if !self.visible
    refresh if hud_refresh?
    hide_status if Hide
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_hud_name start
  alias terminate_hud_name terminate
  alias update_hud_name update
  def start
    start_hud_name
    @index = 0
    new_hud
  end
  def terminate
    @hud_name.dispose
    terminate_hud_name
  end
  def update
    update_hud_name
    @hud_name.update
    return if !@hud_name.visible
    if Input.trigger?(Input::R)
      if @index == $game_party.members.size - 1
        @index = 0
      else
        @index += 1
      end
    elsif Input.trigger?(Input::L)
      if @index == 0
        @index = $game_party.members.size - 1
      else
        @index -= 1
      end
    end
    new_hud if @index != @hud_name.index
  end
  def new_hud
    @hud_name.dispose if !@hud_name.nil?
    @hud_name = Hud_Name.new(@index)
  end
end

#------------------------------------------------------------
# * Game_System: Check for display
#------------------------------------------------------------
class Game_System
  alias hud_initialize initialize
  attr_accessor :hud_display
  def initialize
    hud_initialize
    @hud_display = Module_Name::Start_Display
  end
end

#------------------------------------------------------------
# * Window_Base: Some new standard function
#------------------------------------------------------------
class Window_Base < Window
  include Module_Name
 
  def draw_actor_exp(actor, x, y, width = 120)
    s1 = actor.exp_s
    s2 = actor.next_rest_exp_s + s1
    if s1.is_a? String or s2.is_a? String
      s1 = actor.exp
      s2 = actor.exp
    end
    draw_actor_exp_gauge(actor, x, y, s1, s2, width)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 30, WLH, EXP_NAME)
    self.contents.font.color = normal_color
    last_font_size = self.contents.font.size
    xr = x + width
    if width < 120
      self.contents.draw_text(xr - 44, y, 44, WLH, s1, 2)
    else
      self.contents.draw_text(xr - 99, y, 44, WLH, s1, 2)
      self.contents.font.color = normal_color
      self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
      self.contents.draw_text(xr - 44, y, 44, WLH, s2, 2)
    end
  end
 
  def draw_actor_exp_gauge(actor, x, y, s1, s2, width = 120)
    gw = width * s1 / s2
    gc1 = text_color(31)
    gc2 = text_color(27)
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  end
end
 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Sob 29 Paź, 2011 22:35
Co masz w linijce 22?
________________________


 
 
 
tracersgta 




Preferowany:
RPG Maker VX

Pomógł: 45 razy
Dołączył: 10 Sty 2011
Posty: 612
Skąd: mam wiedzieć?
Wysłany: Nie 30 Paź, 2011 07:42
22. linijka to:
Kod:
=begin #########################################################################
________________________
I'm a tiger! I roar. I hunt, I climb, I eat, I wash, I sleep!

Gość, jeżeli pomogłem daj "Pomógł" ;-)
 
 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Nie 30 Paź, 2011 11:22
Nie masz przypadkiem żadnych spacji przed =begin. Zrób najlepiej screen, jak wygląda skrypt u Ciebie w edytorze skryptu.
________________________


 
 
 
hubertwalczak8 



Dołączył: 09 Gru 2010
Posty: 14
Wysłany: Nie 30 Paź, 2011 11:24
Dobra, zara dam edita.
EDIT:
http://imageshack.us/phot...84/scriptv.png/
 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Nie 30 Paź, 2011 11:40
Takie linijki jak '=begin' i '=end' nie mogą być poprzedzone spacją. Trzeba je przesunąć maksymalnie do lewej, tak żeby zamknięty w nie tekst zmienił kolor na zielony.
________________________


 
 
 
hubertwalczak8 



Dołączył: 09 Gru 2010
Posty: 14
Wysłany: Nie 30 Paź, 2011 11:42
Działa, dzięki za pomoc.
 
 
Wyświetl posty z ostatnich:   
Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene