UltimaForum

Wsparcie [VX] - Szukam łatwego hud'u

poko67 - Czw 18 Sie, 2011 10:44
Temat postu: Szukam łatwego hud'u
Szukam prostego hudu chodzi mi o duży pasek tylko HP najlepiej znajdujący się po środku na dole ekranu...I aby pokazywał wartości Max hp i ile zostało
Angius - Czw 18 Sie, 2011 12:00

Weź jakikolwiek HUD, wywal z niego paski MP i EXP, ustal szerokośc i wysokość paska życia, i jego położenie na dole ekranu i gotowe ;-)
poko67 - Czw 18 Sie, 2011 12:16

podasz mi jakiś w którym mogę to zrobić bo może nie uwierzysz ale w tych co mam nie mogę...
Angius - Czw 18 Sie, 2011 12:22

http://www.ultimateam.pl/...3&highlight=hud
Ot choćby. Wystarczy wyłaczyć tło, twarz bohatera (dac przezroczystośc na 0) i wywalić wszystko, co ma MP lub EXP w linijce.

poko67 - Czw 18 Sie, 2011 12:52

sory ale czy mógłbyś to dla mnie zrobić bo pewnie mnie wyśmiejesz ale nie umię;p
nazwa bohatera i poziom może zostać chodzi mi o wyłączenie ino paska expa i many

Angius - Czw 18 Sie, 2011 12:57

Kod:
################################################################################
#                                                                              #
#                      ~~~~~ Copyright 2009 SojaBird ~~~~~                     #
#                                                                              #
################################################################################
# Tłumaczenie i korekta by Ayene
#
# By wyświetlić/ukryć HUD, wywołaj skrypt "hud"
# By wyświetlić/ukryć HUD, wywołaj skrypt "hud(true)" lub "hud(false)"

module AYENE
  # 0 - lewy górny róg
  # 1 - lewy dolny róg
  # 2 - prawy górny róg
  # 3 - prawy dolny róg
  POŁOŻENIE_HUD = 1
end

module HUD_HP_MP_EXP_NAME_FACE_LEVEL
  HUD_WIDTH = 152   # Szerokość okna
  FACE_OPACITY = 255 # przezroczystość twarzy bohatera [0~255]

  BG_DISPLAY = true # Ukrywa / wyświetla tło [true/false]

  EXP_NAME = "PD" # Tekst wyświetlany jako punkty doświadczenia
 
  ACTOR_ID = 0 # ID bohatera, którego statystyki mają się wyświetlać
               #(actor1=0, actor2=1...actorN=N-1)
 
  HIDE = true # Ukryj okno, gdy bohater jest za nim [true/false]
  OPACITY = 100 # Przezroczystość, gdy ukryty [0~255]
 
  HUD_START_DISPLAY = true # Wyświetlanie HUD od początku gry [true/false]
 
  CYCLE = true # Włącza / wyłącza zmianę bohaterów w drużynie za pomocą L&R
end

################################################################################
def hud(arg = nil)
  $game_system.hud_display = !$game_system.hud_display if arg == nil
  $game_system.hud_display = arg if arg != nil
end
################################################################################
class Window_HUD_HP_MP_EXP_NAME_FACE_LEVEL < Window_Base
  include HUD_HP_MP_EXP_NAME_FACE_LEVEL
 
  attr_reader :index
 
  def initialize(index)
    @index = index
    @height = WLH * 4 + 32
    case AYENE::POŁOŻENIE_HUD
      when 0
       super(0, 0, HUD_WIDTH, @height)
      when 1
       super(0, 208-@height, HUD_WIDTH, @height)
      when 2
       super(544-HUD_WIDTH, 0, HUD_WIDTH, @height)
      when 3
       super(544-HUD_WIDTH, 416-@height, HUD_WIDTH, @height)
    end     
    self.visible = $game_system.hud_display
    self.opacity = OPACITY
    self.opacity = 0 if !BG_DISPLAY
    @actor = $game_party.members[@index]
    @width = HUD_WIDTH - 32
    hide_status
    refresh
  end
 
  def refresh
    contents.clear
    @hp = @actor.hp
    draw_actor_hp(@actor, 0, WLH * 1, @width)
    end
 
  def hide_status
    if HIDE == true
      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
    if @hp != @actor.hp or
      @mp != @actor.mp or
      @exp != @actor.exp or
      @name != @actor.name or
      @level != @actor.level or
      @face != [@actor.face_name, @actor.face_index]
      refresh
    end
    hide_status
  end
end

#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
  alias start_hmexp_name_face_lvl start
  alias terminate_hmexp_name_face_lvl terminate
  alias update_hmexp_name_face_lvl update
  def start
    start_hmexp_name_face_lvl
    @index = HUD_HP_MP_EXP_NAME_FACE_LEVEL::ACTOR_ID
    new_hud
   
  end
  def terminate
    @hp_mp_exp_name_face_hud.dispose
    terminate_hmexp_name_face_lvl
  end
  def update
    update_hmexp_name_face_lvl
    @hp_mp_exp_name_face_hud.update
    return if !HUD_HP_MP_EXP_NAME_FACE_LEVEL::CYCLE
    return if !@hp_mp_exp_name_face_hud.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 != @hp_mp_exp_name_face_hud.index
  end
 
  def new_hud
    @hp_mp_exp_name_face_hud.dispose if !@hp_mp_exp_name_face_hud.nil?
    @hp_mp_exp_name_face_hud = Window_HUD_HP_MP_EXP_NAME_FACE_LEVEL.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 = HUD_HP_MP_EXP_NAME_FACE_LEVEL::HUD_START_DISPLAY
  end
end


Powiem tak: MOŻE działać, ale NIE MUSI. Nie jestem skrypterem, więc wywaliłem tylko kilka linijek kierując się logiką i analogią. Jak to nie pomoże, to spróbuj w typowym zdarzeniu ustawić HP na zmienną, a potem skryptem na zmienną w pasku ją sprawdzać.

poko67 - Czw 18 Sie, 2011 13:08

Bardzo ci dziękuję musiałem jedynie się pobawić z przestawianiem paska bo coś nie grało ale jest już dobrze dziękuję *POMÓGŁ poleciał;D*
Angius - Czw 18 Sie, 2011 13:11

Skoro działa - zamykam ;-)

Powered by phpBB modified by Przemo © 2003 phpBB Group