Duvidas nesse script ABS.
3 participantes
- ElricNovato
- Mensagens : 13
Reputação : 10
Duvidas nesse script ABS.
Sex Ago 20, 2010 12:46 am
- Spoiler:
- #==============================================================================
# Requiem HUD
#==============================================================================
OnOff_Switch = 0 # Switch that show or hide the HUD
Skills_Text = "Habilidades" # Text displayed on skills window
Items_Text = "Itens" # Text displayed on items window
Ammo_Text = "Munição" # Text displayed on ammunitions window
#------------------------------------------------------------------------------
Requiem_Masterpiece.register("Requiem HUD", 1.0, "29/03/2009")
#------------------------------------------------------------------------------
if Requiem_Masterpiece.enabled?("Requiem ABS", 5.0)
#------------------------------------------------------------------------------
class Requiem_HUD1 < Window_Base
def initialize
super(-32, -32, 224, 140)
self.opacity = 0
@actor = $game_party.members[0]
@old_hp = @actor.hp
@old_mp = @actor.mp
update
refresh
end
def update
return if $game_party.members.size <= 0
return unless @old_hp != @actor.hp or @old_mp != @actor.mp or @actor != $game_party.members[0]
@old_hp = @actor.hp
@old_mp = @actor.mp
@actor = $game_party.members[0]
refresh
end
def refresh
self.contents.clear
draw_hpbar(@actor, 34, 16)
draw_mpbar(@actor, 34, 38)
self.contents.font.size = 16
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(19, 15, 24, 24, Vocab::hp_a)
self.contents.draw_text(19, 39, 24, 24, Vocab::mp_a)
self.contents.font.color = Color.new(255,255,255)
self.contents.draw_text(18, 14, 24, 24, Vocab::hp_a)
self.contents.draw_text(18, 38, 24, 24, Vocab::mp_a)
end
def draw_hpbar(actor, x, y)
base = Cache.system("Base")
self.contents.blt(x, y, base, base.rect)
bar = Cache.system("HP Bar")
meter = Rect.new(0, 0, base.width * actor.hp / actor.maxhp, base.height)
self.contents.blt(x, y, bar, meter)
end
def draw_mpbar(actor, x, y)
base = Cache.system("Base")
self.contents.blt(x, y, base, base.rect)
bar = Cache.system("MP Bar")
meter = Rect.new(0, 0, base.width * actor.mp / actor.maxmp, base.height)
self.contents.blt(x, y, bar, meter)
end
end
#------------------------------------------------------------------------------
class Requiem_HUD2 < Window_Base
def initialize
super(-32,-32,608,480)
self.opacity = 0
@actor = $game_party.members[0]
refresh
end
def update
return if $game_party.members.size <= 0
if @actor != $game_party.members[0]
@actor = $game_party.members[0]
refresh
end
end
def refresh
return if $game_party.members.size <= 0
self.contents.clear
self.contents.font.size = 16
bitmap = Cache.system("HUD")
rect = Rect.new(0, 0, 544, 416)
self.contents.blt(16, 16, bitmap, rect)
draw_skills(464, 28)
draw_items(464, 396)
draw_ammo(32, 396)
end
def draw_skills(x, y)
skill_count = 0
@actor.skill_hotkeys.each { |key, value|
next if value.nil?
skill = $data_skills[value]
next if skill.nil?
draw_icon(skill.icon_index, (32*skill_count)+x-4, y)
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text((32*skill_count)+x+5, y+17, 64, 24, Input.name?(key))
self.contents.font.color = Color.new(255,255,255)
self.contents.draw_text((32*skill_count)+x+4, y+16, 64, 24, Input.name?(key))
skill_count += 1
}
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(x-7, y-15, 96, 24, Skills_Text, 1)
self.contents.font.color = Color.new(255,255,255)
self.contents.draw_text(x-8, y-16, 96, 24, Skills_Text, 1)
end
def draw_items(x, y)
item_count = 0
@actor.item_hotkeys.each { |key, value|
next if value.nil?
item = $data_items[value]
next if item.nil?
draw_icon(item.icon_index, (32*item_count)+x-4, y)
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text((32*item_count)+x+5, y+17, 64, 24, Input.name?(key))
self.contents.font.color = Color.new(255,255,255)
self.contents.draw_text((32*item_count)+x+4, y+16, 64, 24, Input.name?(key))
item_count += 1
}
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(x-7, y-15, 96, 24, Items_Text, 1)
self.contents.font.color = Color.new(255,255,255)
self.contents.draw_text(x-8, y-16, 96, 24, Items_Text, 1)
end
def draw_ammo(x, y)
if @actor.equips[0] != nil and @actor.equips[0].ranged?
draw_icon(@actor.equips[0].ammo1.icon_index, x-4, y) if @actor.equips[0].ammo1 != nil
draw_icon(@actor.equips[0].ammo2.icon_index, x+28, y) if @actor.equips[0].ammo2 != nil
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(x+5, y+17, 32, 24, Input.name?(Requiem_ABS::Right_Attack_Button))
self.contents.draw_text(x+37, y+17, 32, 24, Input.name?(Requiem_ABS::Left_Attack_and_Shield_Button))
self.contents.font.color = Color.new(255,255,255)
self.contents.draw_text(x+4, y+16, 32, 24, Input.name?(Requiem_ABS::Right_Attack_Button))
self.contents.draw_text(x+36, y+16, 32, 24, Input.name?(Requiem_ABS::Left_Attack_and_Shield_Button))
end
self.contents.font.color = Color.new(0,0,0)
self.contents.draw_text(x-7, y-16, 64, 24, Ammo_Text, 1)
self.contents.font.color = Color.new(255,255,255)
self.contents.draw_text(x-8, y-16, 64, 24, Ammo_Text, 1)
end
end
#------------------------------------------------------------------------------
class Scene_Map < Scene_Base
alias requiem_hudstart start
alias requiem_hudupdate update
alias requiem_hudterminate terminate
def start
requiem_hudstart
@hud_window1 = Requiem_HUD1.new
@hud_window2 = Requiem_HUD2.new
@hud_window1.visible = @hud_window1.active = false
@hud_window2.visible = @hud_window2.active = false
showing_hud
end
def update
requiem_hudupdate
@hud_window1.update if @hud_window1.active
@hud_window2.update if @hud_window2.active
showing_hud
end
def terminate
requiem_hudterminate
@hud_window1.dispose
@hud_window2.dispose
end
def showing_hud
if OnOff_Switch <= 0 or $game_switches[OnOff_Switch]
@hud_window1.visible = @hud_window1.active = true
@hud_window2.visible = @hud_window2.active = true
else
@hud_window1.visible = @hud_window1.active = false
@hud_window2.visible = @hud_window2.active = false
end
end
end
#------------------------------------------------------------------------------
end
Seguinte...
Requiem ABS 5.0
Preciso de uma ajuda...fazer a HUD SUMIR no meio do jogo.
Não acho o script dela.
Tento mas não dá certo.
Podem ajudar?
Re: Duvidas nesse script ABS.
Sex Ago 20, 2010 7:29 pm
Sabe esta linha do script?
Faça, no evento que fará a HUD sumir, fazer a switch que você colocou em OnOff_Switch ficar ON.
- Código:
OnOff_Switch = 0 # Switch that show or hide the HUD
Faça, no evento que fará a HUD sumir, fazer a switch que você colocou em OnOff_Switch ficar ON.
- ElricNovato
- Mensagens : 13
Reputação : 10
Re: Duvidas nesse script ABS.
Sáb Ago 21, 2010 10:26 am
Sim, eu consigo fazer ela sumir desse jeito...porém está difícil de fazer ela retornar no jogo.
Quando eu mudo o "0" pra "1", ela some mesmo, porém eu quero que ela reapareça em certas ocasiões, e isso que eu não consigo.
Quando eu mudo o "0" pra "1", ela some mesmo, porém eu quero que ela reapareça em certas ocasiões, e isso que eu não consigo.
Re: Duvidas nesse script ABS.
Sáb Ago 21, 2010 1:22 pm
"Switch that show or hide the HUD"
Tradução:
"Switch para mostrar ou ocultar a HUD"
Explicação:
Crie um evento paralelo, este evento irá desativar ou ativar a HUD, para isso, coloque nesse evento:
Para desativar:
[opções de switch] [switch00X] [OFF]
Para ativar:
[opções de switch] [switch00X] [ON]
Obs.: repare que a switch "00X" se refere a switch que você usou no script, na linha:
Se ainda não conseguir ocultar e mostrar a HUD, avise.
Edit------------------------------------------
Esqueci de dizer que a switch usada no script deve se unicamente para ele, ou seja, caso utilize a switch de ID "001" para ativar/desativar a HUD, não a utilize para abrir uma porta, por exemplo.
Tradução:
"Switch para mostrar ou ocultar a HUD"
Explicação:
Crie um evento paralelo, este evento irá desativar ou ativar a HUD, para isso, coloque nesse evento:
Para desativar:
[opções de switch] [switch00X] [OFF]
Para ativar:
[opções de switch] [switch00X] [ON]
Obs.: repare que a switch "00X" se refere a switch que você usou no script, na linha:
- Código:
OnOff_Switch = X
Se ainda não conseguir ocultar e mostrar a HUD, avise.
Edit------------------------------------------
Esqueci de dizer que a switch usada no script deve se unicamente para ele, ou seja, caso utilize a switch de ID "001" para ativar/desativar a HUD, não a utilize para abrir uma porta, por exemplo.
- ElricNovato
- Mensagens : 13
Reputação : 10
Re: Duvidas nesse script ABS.
Dom Ago 22, 2010 10:41 am
Consegui. Tudo perfeito. Muito obrigado.
Permissões neste sub-fórum
Não podes responder a tópicos
|
|