UltimaForum

Wsparcie [VX] - Hud Gothic

pezik - Sob 14 Kwi, 2012 09:21
Temat postu: Hud Gothic
Czy mógłby mi ktoś zrobić skrypt na hud z tymi hotkeysami jak w G3
Tylko bez tych pasków hp i mp bo to już mam.

MrCorniszon - Sob 14 Kwi, 2012 10:25

na vx raczej nie ma, jest do xp może ktoś ci przerobi:
http://www.rmxp.pl/index.php?topic=6801.0
Screen:
Spoiler:


pezik - Sob 14 Kwi, 2012 11:07

No właśnie też to widziałem. Może Ayene jak ma trochę czasu to mi to przerobi do vx.
Ayene - Sob 14 Kwi, 2012 14:07

Nie przerobi, bo skrypt na XP jest robiony pod ABS-a. Rozumiem, że w swojej grze wykorzystujesz system walki na mapie. Podaj który to, a może w wolnym czasie nad tym posiedzę.
pezik - Pon 16 Kwi, 2012 19:46

Ayene:
Ten co na forum walka w czasie rzeczywistym

EzioMasterPl - Wto 17 Kwi, 2012 15:39

Ayene, jeśli nie wystawiasz tego skryptu tu, to mi wyślij wiadomościa.
Mam tak jak on walkę

Ayene - Sob 05 Maj, 2012 22:02

Dobra, myślę, że będzie działać. Wrzucam dwa skrypty, z czego oba powinny się znaleźć pod skryptami na walkę:
HUD ze statsami:
Spoiler:

Kod:
# Jest to przerobiony skrypt HUD autorstwa SojaBird
# Dodana grafika pasków oraz poprawiony pasek z doświadczeniem.
# by Ayene

module HUD_HP_MP_EXP
  HUD_WIDTH = 152   # Szerokość okna
 
  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 = false # Włącza / wyłącza zmianę bohaterów w drużynie za pomocą L&R
end

class Window_HUD_HP_MP_EXP < Window_Base
  include HUD_HP_MP_EXP
  attr_reader :index
 
  def initialize(index)
    @index = index
    height = 14 * 3 + 32
    super(544-HUD_WIDTH, 416-height, HUD_WIDTH, height)
    self.visible = $game_system.hud_display
    self.opacity = 0
    @actor = $game_party.members[@index]
    @width = HUD_WIDTH - 32
    hide_status
    refresh
  end
 
  def refresh
    contents.clear
    @hp = @actor.hp; @mp = @actor.mp; @exp = @actor.exp
    draw_actor_hp_HUD(@actor, 0, 14 * 0)
    draw_actor_mp_HUD(@actor, 0, 14 * 1)
    draw_actor_exp_HUD(@actor, 0, 14 * 2)
  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.contents_opacity = OPACITY
      else
        self.contents_opacity = 255
      end
    end
  end
 
  def draw_actor_hp_HUD(actor, x, y, width = 104)
    bitmap = Cache.picture("hp_mp_bar")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(x, y, bitmap, src_rect)   
    gw = width * actor.hp / actor.maxhp
    gc1 = Color.new(130,24,27)
    gc2 = Color.new(180,37,41)
    self.contents.gradient_fill_rect(x+8, y+3, gw, 6, gc1, gc2)   
  end
 
  def draw_actor_mp_HUD(actor, x, y, width = 104)
    bitmap = Cache.picture("hp_mp_bar")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(x, y, bitmap, src_rect)   
    gw = width * actor.mp / actor.maxmp
    gc1 = Color.new(231,192,123)
    gc2 = Color.new(247,222,174)
    self.contents.gradient_fill_rect(x+8, y+3, gw, 6, gc1, gc2)   
  end
   
  def draw_actor_exp_HUD(actor, x, y, width = 104)
    bitmap = Cache.picture("hp_mp_bar")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(x, y, bitmap, src_rect)
    s1 = actor.gained_exp(actor.level, actor.exp)
    s2 = actor.needed_exp(actor.level)     
    gw = (s1 < s2 ? s1 * width / s2 : width)
    gc1 = Color.new(38,101,131)
    gc2 = Color.new(45,121,157)
    self.contents.gradient_fill_rect(x+8, y+3, gw, 6, gc1, gc2)   
  end
 
  def update
    self.visible = $game_system.hud_display
    return if !self.visible
    refresh if @hp != @actor.hp or @mp != @actor.mp or @exp != @actor.exp
    hide_status
  end
end

class Scene_Map < Scene_Base
  alias got_hud_start start
  alias got_hud_terminate terminate
  alias got_hud_update update
  def start
    got_hud_start
    @index = HUD_HP_MP_EXP::ACTOR_ID
    new_hud   
  end
  def terminate
    @got_hud.dispose
    got_hud_terminate
  end
  def update
    got_hud_update
    @got_hud.update
    return if !HUD_HP_MP_EXP::CYCLE
    return if !@got_hud.visible
    if Input.trigger?(Input::R)
      @index += 1
      @index %= $game_party.members.size
    elsif Input.trigger?(Input::L)
      @index += $game_party.members.size - 1
      @index %= $game_party.members.size
    end
    new_hud if @index != @got_hud.index
  end
 
  def new_hud
    @got_hud.dispose if !@got_hud.nil?
    @got_hud = Window_HUD_HP_MP_EXP.new(@index)
  end
end

class Game_System
  alias hud_initialize initialize
  attr_accessor :hud_display
  def initialize
    hud_initialize
    @hud_display = HUD_HP_MP_EXP::HUD_START_DISPLAY
  end
end

class Game_Actor < Game_Battler
  def gained_exp(current_level, current_exp)
    return (current_exp - @exp_list[current_level])   
  end
  def needed_exp(current_level)
    return (@exp_list[current_level + 1] - @exp_list[current_level])
  end
end



HUD umiejętności i przedmiotów:
Spoiler:

Kod:
#==============================================================================
# MOG HUD Equip V1.1 VX           
# Autor XP: Moghunter         
# Przełożone na VX przez Ayene (mam nadzieję, że będzie 'śmigać' :P
# Przeorobiony hud - kompatybilny tylko z Walką w czasie rzeczywsitym
#==============================================================================
if true # True = wyświetla HUD / False = nie wyświetla

module MOG
  # Położenie HUD - współrzędne x i y
  EQPMAPX = 20 # współrzędna x
  EQPMAPY = 350 # współrzędna y
 
  # Przełącznik, kontrolujący wyświetlanie HUD
  EQPMAPVIS = 5
 
  # Okno
  EQPMAPSKIN = "Window"
 
  # Przezroczystość okna HUD
  EQPMAPOPA = 0
end

$mogscript = {} if $mogscript == nil
$mogscript["mpequip"] = true

#==============================================================================
# Window_Base
#==============================================================================
class Window_Base < Window
  def draw_equip_map(item, x, y, enabled = true)
    if item == nil
      return
    end
    draw_icon(item.icon_index , x+18, y+2, enabled)
  end

  def draw_mequip(x, y)
    mequip = Cache.picture("hudmem")   
    cw = mequip.width
    ch = mequip.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x , y ,mequip, src_rect)
  end
end

#==============================================================================
# Window_Equip_Map
#==============================================================================
class Window_Equipmap < Window_Base
  def initialize(actor)
    super(0, 0, 360, 100)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = MOG::EQPMAPOPA
    self.windowskin = Cache.system(MOG::EQPMAPSKIN)
    @actor = actor
    refresh
  end
 
  def refresh
    self.contents.clear
    draw_mequip(0,0)
    @items = {}
    @skills = {} 
   @actor.skill_hotkeys.each{|key, val|
     @skills[Requiem_SBABS::Skill_Buttons.index(key)] = val     
   }
    @skills.each{|index, id|
      if id != 0
        skill = $data_skills[id]
        enabled = @actor.calc_mp_cost(skill) > @actor.mp ? false : true
        draw_equip_map(skill, 30 * index, 0, enabled)
      end
    }
    @actor.item_hotkeys.each{|key, val|
     @items[Requiem_SBABS::Item_Buttons.index(key)] = val     
   }
    @items.each{|index, id|
      if id != 0 and $game_party.item_number($data_items[id]) > 0   
        draw_equip_map($data_items[id], 30 * (index+5), 0)
      end
    } 
  end
end

#==============================================================================
# Scene_Map
#==============================================================================
class Scene_Map
  alias ayene_start start
  def start   
    @actor = $game_party.members[0]
    @eqmap = Window_Equipmap.new(@actor)
    @eqmap.x = MOG::EQPMAPX
    @eqmap.y = MOG::EQPMAPY
    if $game_switches[MOG::EQPMAPVIS] == false
      @eqmap.visible = true
    else
      @eqmap.visible = false     
    end
    ayene_start
  end
 
  alias ayene_terminate terminate
  def terminate
    ayene_terminate
    @eqmap.dispose
  end
 
  alias mog8_update update
  def update
    if $game_switches[MOG::EQPMAPVIS] == false
      @eqmap.visible = true
    else
      @eqmap.visible = false     
    end
    if $eref == true
      @eqmap.refresh
      $eref = false
    end
    mog8_update
  end
end

#==============================================================================
# Game_Map
#==============================================================================
class Game_Map
  attr_accessor :eref
end

class Game_Interpreter
  def eref
    $eref = true
  end
  alias mog319ref command_319
  def command_319
    eref
    return mog319ref
  end
end
end


class Game_Player < Game_Character
  alias aye_attack_with_skill attack_with_skill
  def attack_with_skill
    aye_attack_with_skill
    $eref = true
  end
 
  alias aye_attack_with_item attack_with_item
  def attack_with_item
    aye_attack_with_item   
    $eref = true
  end
end


Wejdźcie w skrypt:
Kod:
Requiem SBABS Standard

i edytujcie linijki z Skill_Buttons i Item_Buttons na (39 i 41):
Kod:
Skill_Buttons = [Input::Numberkeys[1], Input::Numberkeys[2], Input::Numberkeys[3], Input::Numberkeys[4], Input::Numberkeys[5]]
Item_Buttons = [Input::Numberkeys[6], Input::Numberkeys[7], Input::Numberkeys[8], Input::Numberkeys[9], Input::Numberkeys[0]]


Do folderu pictures wrzućcie:

jako 'hp_mp_bar' oraz

jako 'hudmem'
Dodałam odświeżanie HUD-a również, gdy skończy się wymagana ilość many do rzucenia czaru i gdy skończą się soczki.

Zalecane dokładne testy. Całość wygląda tak:

EzioMasterPl - Nie 06 Maj, 2012 09:07

Ayene ja mam problem p;. Jak zabije bossa na 2 mapie znika mi na stałe ten men_hud.
A i dzięki ogólnie za to, bo bardzo mi się podoba hud z Gothica 3. A i jeśli by się dało mogłabyś przerobic ten skrypt co jest do XP - DragonHud???

Ayene - Nie 06 Maj, 2012 09:29

Znika HUD po pewnie zmieniasz przełącznik nr 5. Zmień go w konfiguracji skryptu:
Kod:
# Przełącznik, kontrolujący wyświetlanie HUD
  EQPMAPVIS = 5

Nie będę już więcej przerabiać graficznie, bo każdy to może sobie zrobić odpowiednio podstawiając grafiki. Przy ewentualnym przesunięciu ikon mogę pomóc.

pezik - Wto 08 Maj, 2012 08:52

Ayene
Dzięki!!!! Bardzo przyda mi się to w projekcie. Leci pomógł.

MrCorniszon - Wto 08 Maj, 2012 13:54

@pezik Po zabiciu bossa zmieniasz Przełącznik ?
- nie lepiej dać Przełącznik Własny ?

pezik - Wto 08 Maj, 2012 14:05

MrCorniszon
Pomyliłeś mnie z EzioMasterPL


Powered by phpBB modified by Przemo © 2003 phpBB Group