RPGVX.net
RPG-Maker VX => VX Technik [Frageforum] => Thema gestartet von: gocki77 am Juni 20, 2011, 15:34:48
-
Hallo, hoffe ihr könnt mir bei einem Problem helfen.
Ich habe das Kampfmenü so umgestaltet, sodass man die HP- und MP-Balken während des ganzen Kampfes permanent sehen kann (es handelt sich immer noch um das normale Kampfsystem, nur die Kampfnachrichten werden in einem seperaten Fenster angezegt). Doch die Balken werden erst aktualisiert, nachdem sämtliche Angriffe einer Runde vollführt wurden.
Wie muss man nun den Code ändern, damit nach jedem Angriff eines Gegners die Anzeigen aktualisiert werden?
Danke schon mal für eure Antworten!
-
Würde dir gern helfen, aber ohne Code --> Nix los! Da ich ja keinen Plan habe welches "Scene_Battle" du verwendest, wird dir auch nur ein schwer jemand helfen können.
MfG,
MelekTaus
-
Ich hab das Scene-Battle mal als Textdatei angehängt. Wäre echt cool, wenn sich jemand die Arbeit macht und da mal drüber schaut. Aber außer den Code
@info_viewport.visible = false
auszukommentieren habe ich da nicht viel gemacht. Ist der Standartcode des Makers.
-
Also wenn man das normale Kampfsystem verwendet und sonst kein Skript verwendet wird, wo HP-Balken angezeigt werden, dann könnte man das hier verwenden (habe ich mal schnell rumgepfuscht und gehört über Main):
#==============================================================================
# ** MelekTaus - enemy_hp4ever_and_up2date
#==============================================================================
MELEKTAUS_ENEMY_HP_4_EVER_WIDTH = 90
#==============================================================================
class Window_EnemyHP < Window_Selectable
#--------------------------------------------------------------------------
def initialize
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
super(0, 0, 545, 300)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
refresh
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
end
#--------------------------------------------------------------------------
def refresh
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
self.contents.clear
$game_troop.members.size.times do |i|
enemy = $game_troop.members[i]
x = i % @column_max * (90 + @spacing)
y = (i / @column_max * (10 + WLH))
x = enemy.screen_x - MELEKTAUS_ENEMY_HP_4_EVER_WIDTH / 1.5
y = enemy.screen_y - 160
draw_enemy_hp(enemy, x, y, MELEKTAUS_ENEMY_HP_4_EVER_WIDTH)
end
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
end
#--------------------------------------------------------------------------
def draw_enemy_hp(enemy, x, y, width)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
draw_enemy_hp_gauge(enemy, x, y + 5, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
last_font_size = self.contents.font.size
if width < 120
self.contents.draw_text(x + width - 40, y, 40, WLH, enemy.hp, 2)
else
self.contents.draw_text(x + width - 100, y, 40, WLH, enemy.hp, 2)
self.contents.font.color = normal_color
self.contents.draw_text(x + width - 60, y, 15, WLH, "/", 2)
self.contents.draw_text(x + width - 45, y, 45, WLH, enemy.maxhp, 2)
end
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
end
#--------------------------------------------------------------------------
def draw_enemy_hp_gauge(enemy, x, y, width)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8,
width * enemy.hp / enemy.maxhp, 6, hp_gauge_color1, hp_gauge_color2)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
end
#--------------------------------------------------------------------------
end
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
alias melektaus_battle_bar_forever_scene_battle_create_info_viewport
create_info_viewport unless $@
def create_info_viewport
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
melektaus_battle_bar_forever_scene_battle_create_info_viewport
@enemy_window = Window_EnemyHP.new
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
end
#--------------------------------------------------------------------------
alias melektaus_battle_bar_forever_scene_battle_dispose_info_viewport
dispose_info_viewport unless $@
def dispose_info_viewport
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
melektaus_battle_bar_forever_scene_battle_dispose_info_viewport
@enemy_window.dispose
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
end
#--------------------------------------------------------------------------
alias melektaus_battle_bar_forever_scene_battle_update_info_viewport
update_info_viewport unless $@
def update_info_viewport
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@enemy_window.refresh
melektaus_battle_bar_forever_scene_battle_update_info_viewport
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
end
#--------------------------------------------------------------------------
alias melektaus_battle_bar_forever_scene_battle_process_victory
process_victory unless $@
def process_victory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@enemy_window.refresh
melektaus_battle_bar_forever_scene_battle_process_victory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
end
#--------------------------------------------------------------------------
end
#==============================================================================
So, und jetzt schmeiß ich mich in die Federn,
MelekTaus