RPGloryXP
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.

RPGloryXP


 
AccueilAccueil  PortailPortail  GalerieGalerie  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  Connexion  
-39%
Le deal à ne pas rater :
Pack Home Cinéma Magnat Monitor : Ampli DENON AVR-X2800H, Enceinte ...
1190 € 1950 €
Voir le deal

 

 Barre système menu et combat [F]

Aller en bas 
2 participants
AuteurMessage
Mikuri
Administrateur
Administrateur
Mikuri


Masculin
Nombre de messages : 142
Age : 33
Date d'inscription : 24/09/2006

Projet
Projet: Mysis
Pourcentage:
Barre système menu et combat [F] Left_bar_bleue0/100Barre système menu et combat [F] Empty_bar_bleue  (0/100)

Barre système menu et combat [F] Empty
MessageSujet: Barre système menu et combat [F]   Barre système menu et combat [F] Icon_minitimeMar 26 Sep - 19:07

Barre système menu et combat.


Ce script rajoutera des barres de vie, magie et expérience en combat et dans le menu.

Créer un nouveau script au dessu de main nommer comme il vous semble, exemple Bar système.

Code:
#==============================================================================
# ?¡ Game_Actor
# Script téléchargé sur www.rpg-creation.com
#------------------------------------------------------------------------------
# ?@ƒAƒNƒ^?[‚ðˆµ‚¤ƒNƒ‰ƒX‚Å‚•?B‚±‚̃Nƒ‰ƒX‚Í Game_Actors ƒNƒ‰ƒX ($game_actors)
# ‚Ì“à•”‚Å´g—p‚³‚ê?AGame_Party ƒNƒ‰ƒX ($game_party) ‚©‚ç‚à´Q?Æ‚³‚ê‚Ü‚•?B
#==============================================================================

class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end

#==============================================================================
# ?¡ Window_Base
#------------------------------------------------------------------------------
# ?@ƒQ?[ƒ¤’†‚Ì‚•‚ׂẴEƒBƒ“ƒhƒE‚̃X?[ƒp?[ƒNƒ‰ƒX‚Å‚•?B
#==============================================================================

class Window_Base < Window
#--------------------------------------------------------------------------
# ?½ HP ƒQ?[ƒW‚Ì•`‰æ
#--------------------------------------------------------------------------
# ƒIƒ¦ƒWƒiƒ‹‚ÌHP•`‰æ‚ð draw_actor_hp_original ‚Æ–¼‘O•Ï?X
alias :draw_actor_hp_original :draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
# •Ï?”rate‚É ¼»?Ý‚ÌHP/MHP‚ð‘ã“ü
if actor.maxhp != 0
rate = actor.hp.to_f / actor.maxhp
else
rate = 0
end
# plus_x:X?À•W‚̈ʒu•â?³ rate_x:X?À•W‚̈ʒu•â?³(%) plus_y:Y?À•W‚̈ʒu•â?³
# plus_width:•?‚Ì•â?³ rate_width:•?‚Ì•â?³(%) height:?c•?
# align1:•`‰æƒ^ƒCƒv1 0:?¶‹l‚ß 1:’†‰›‘µ‚¦ 2:‰E‹l‚ß
# align2:•`‰æƒ^ƒCƒv2 0:?ã‹l‚ß 1:’†‰›‘µ‚¦ 2:‰º‹l‚ß
# align3:ƒQ?[ƒWƒ^ƒCƒv 0:?¶‹l‚ß 1:‰E‹l‚ß
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
# ƒOƒ‰ƒf?[ƒVƒ‡ƒ“?Ý’è grade1:‹óƒQ?[ƒW grade2:´ÀƒQ?[ƒW
# (0:‰¡‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“ 1:?c‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“ 2:´Î‚߂ɃOƒ‰ƒf?[ƒVƒ‡ƒ“(¼ƒ?d)?j
grade1 = 1
grade2 = 0
# ?F?Ý’è?Bcolor1:¦O˜g?Ccolor2:’†˜g
# color3:‹óƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor4:‹óƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
# color5:´ÀƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor6:´ÀƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
# •Ï?”sp‚É•`‰æ‚•‚éƒQ?[ƒW‚Ì•?‚ð‘ã“ü
if actor.maxhp != 0
hp = (width + plus_width) * actor.hp * rate_width / 100 / actor.maxhp
else
hp = 0
end
# ƒQ?[ƒW‚Ì•`‰æ
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, hp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
# ƒIƒ¦ƒWƒiƒ‹‚ÌHP•`‰æ?ˆ—?‚ð¼Ä‚Ñ?o‚µ
draw_actor_hp_original(actor, x, y, width)
end
#--------------------------------------------------------------------------
# ?½ SP ƒQ?[ƒW‚Ì•`‰æ
#--------------------------------------------------------------------------
# ƒIƒ¦ƒWƒiƒ‹‚ÌSP•`‰æ‚ð draw_actor_sp_original ‚Æ–¼‘O•Ï?X
alias :draw_actor_sp_original :draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
# •Ï?”rate‚É ¼»?Ý‚ÌSP/MSP‚ð‘ã“ü
if actor.maxsp != 0
rate = actor.sp.to_f / actor.maxsp
else
rate = 1
end
# plus_x:X?À•W‚̈ʒu•â?³ rate_x:X?À•W‚̈ʒu•â?³(%) plus_y:Y?À•W‚̈ʒu•â?³
# plus_width:•?‚Ì•â?³ rate_width:•?‚Ì•â?³(%) height:?c•?
# align1:•`‰æƒ^ƒCƒv1 0:?¶‹l‚ß 1:’†‰›‘µ‚¦ 2:‰E‹l‚ß
# align2:•`‰æƒ^ƒCƒv2 0:?ã‹l‚ß 1:’†‰›‘µ‚¦ 2:‰º‹l‚ß
# align3:ƒQ?[ƒWƒ^ƒCƒv 0:?¶‹l‚ß 1:‰E‹l‚ß
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
# ƒOƒ‰ƒf?[ƒVƒ‡ƒ“?Ý’è grade1:‹óƒQ?[ƒW grade2:´ÀƒQ?[ƒW
# (0:‰¡‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“ 1:?c‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“ 2:´Î‚߂ɃOƒ‰ƒf?[ƒVƒ‡ƒ“(¼ƒ?d)?j
grade1 = 1
grade2 = 0
# ?F?Ý’è?Bcolor1:¦O˜g?Ccolor2:’†˜g
# color3:‹óƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor4:‹óƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
# color5:´ÀƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor6:´ÀƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(0, 64, 0, 192)
color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
color6 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
# •Ï?”sp‚É•`‰æ‚•‚éƒQ?[ƒW‚Ì•?‚ð‘ã“ü
if actor.maxsp != 0
sp = (width + plus_width) * actor.sp * rate_width / 100 / actor.maxsp
else
sp = (width + plus_width) * rate_width / 100
end
# ƒQ?[ƒW‚Ì•`‰æ
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, sp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
# ƒIƒ¦ƒWƒiƒ‹‚ÌSP•`‰æ?ˆ—?‚ð¼Ä‚Ñ?o‚µ
draw_actor_sp_original(actor, x, y, width)
end
#--------------------------------------------------------------------------
# ?½ EXP ƒQ?[ƒW‚Ì•`‰æ
#--------------------------------------------------------------------------
# ƒIƒ¦ƒWƒiƒ‹‚ÌEXP•`‰æ‚ð draw_actor_sp_original ‚Æ–¼‘O•Ï?X
alias :draw_actor_exp_original :draw_actor_exp
def draw_actor_exp(actor, x, y, width = 204)
# •Ï?”rate‚É ¼»?Ý‚Ìexp/nextexp‚ð‘ã“ü
if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end
# plus_x:X?À•W‚̈ʒu•â?³ rate_x:X?À•W‚̈ʒu•â?³(%) plus_y:Y?À•W‚̈ʒu•â?³
# plus_width:•?‚Ì•â?³ rate_width:•?‚Ì•â?³(%) height:?c•?
# align1:•`‰æƒ^ƒCƒv1 0:?¶‹l‚ß 1:’†‰›‘µ‚¦ 2:‰E‹l‚ß
# align2:•`‰æƒ^ƒCƒv2 0:?ã‹l‚ß 1:’†‰›‘µ‚¦ 2:‰º‹l‚ß
# align3:ƒQ?[ƒWƒ^ƒCƒv 0:?¶‹l‚ß 1:‰E‹l‚ß
plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
# ƒOƒ‰ƒf?[ƒVƒ‡ƒ“?Ý’è grade1:‹óƒQ?[ƒW grade2:´ÀƒQ?[ƒW
# (0:‰¡‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“ 1:?c‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“ 2:´Î‚߂ɃOƒ‰ƒf?[ƒVƒ‡ƒ“(¼ƒ?d)?j
grade1 = 1
grade2 = 0
# ?F?Ý’è?Bcolor1:¦O˜g?Ccolor2:’†˜g
# color3:‹óƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor4:‹óƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
# color5:´ÀƒQ?[ƒWƒ_?[ƒNƒJƒ‰?[?Ccolor6:´ÀƒQ?[ƒWƒ‰ƒCƒgƒJƒ‰?[
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 * rate, 80 - 80 * rate ** 2, 80 - 80 * rate, 192)
color6 = Color.new(240 * rate, 240 - 240 * rate ** 2, 240 - 240 * rate, 192)
# •Ï?”exp‚É•`‰æ‚•‚éƒQ?[ƒW‚Ì•?‚ð‘ã“ü
if actor.next_exp != 0
exp = (width + plus_width) * actor.now_exp * rate_width /
100 / actor.next_exp
else
exp = (width + plus_width) * rate_width / 100
end
# ƒQ?[ƒW‚Ì•`‰æ
gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, exp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
# ƒIƒ¦ƒWƒiƒ‹‚ÌEXP•`‰æ?ˆ—?‚ð¼Ä‚Ñ?o‚µ
draw_actor_exp_original(actor, x, y)
end
#--------------------------------------------------------------------------
# ?½ ƒQ?[ƒW‚Ì•`‰æ
#--------------------------------------------------------------------------
def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
case align1
when 1
x += (rect_width - width) / 2
when 2
x += rect_width - width
end
case align2
when 1
y -= height / 2
when 2
y -= height
end
# ˜g•`‰æ
self.contents.fill_rect(x, y, width, height, color1)
self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2)
if align3 == 0
if grade1 == 2
grade1 = 3
end
if grade2 == 2
grade2 = 3
end
end
if (align3 == 1 and grade1 == 0) or grade1 > 0
color = color3
color3 = color4
color4 = color
end
if (align3 == 1 and grade2 == 0) or grade2 > 0
color = color5
color5 = color6
color6 = color
end
# ‹óƒQ?[ƒW‚Ì•`‰æ
self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4,
color3, color4, grade1)
if align3 == 1
x += width - gauge
end
# ´ÀƒQ?[ƒW‚Ì•`‰æ
self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4,
color5, color6, grade2)
end
end

#------------------------------------------------------------------------------
# ?@BitmapƒNƒ‰ƒX‚É?V‚½‚È‹@”‚ð’ljÁ‚µ‚Ü‚•?B
#==============================================================================

class Bitmap
#--------------------------------------------------------------------------
# ?½ ‹é¼`‚ðƒOƒ‰ƒf?[ƒVƒ‡ƒ“•´¦
# color1 : ƒXƒ^?[ƒgƒJƒ‰?[
# color2 : ƒGƒ“ƒhƒJƒ‰?[
# align : 0:‰¡‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“
# 1:?c‚ɃOƒ‰ƒf?[ƒVƒ‡ƒ“
# 2:´Î‚߂ɃOƒ‰ƒf?[ƒVƒ‡ƒ“?i¼ƒ?d‚ɂ‚«’?ˆÓ?j
#--------------------------------------------------------------------------
def gradation_rect(x, y, width, height, color1, color2, align = 0)
if align == 0
for i in x...x + width
red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
green = color1.green +
(color2.green - color1.green) * (i - x) / (width - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - x) / (width - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - x) / (width - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(i, y, 1, height, color)
end
elsif align == 1
for i in y...y + height
red = color1.red +
(color2.red - color1.red) * (i - y) / (height - 1)
green = color1.green +
(color2.green - color1.green) * (i - y) / (height - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - y) / (height - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - y) / (height - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(x, i, width, 1, color)
end
elsif align == 2
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
elsif align == 3
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
end
end
end

#==============================================================================
# ?¡ Spriteƒ‚ƒWƒ…?[ƒ‹
#------------------------------------------------------------------------------
# ?@ƒAƒjƒ??[ƒVƒ‡ƒ“‚̦Ǘ?‚ð?s‚¤ƒ‚ƒWƒ…?[ƒ‹‚Å‚•?B
#==============================================================================

module RPG
class Sprite < ::Sprite
def damage(value, critical)
dispose_damage
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
bitmap = Bitmap.new(160, 48)
bitmap.font.name = "Arial Black"
bitmap.font.size = 32
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
if value.is_a?(Numeric) and value < 0
bitmap.font.color.set(176, 255, 144)
else
bitmap.font.color.set(255, 255, 255)
end
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
if critical
bitmap.font.size = 20
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
end
@_damage_sprite = ::Sprite.new
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80 + self.viewport.ox
@_damage_sprite.oy = 20 + self.viewport.oy
@_damage_sprite.x = self.x + self.viewport.rect.x
@_damage_sprite.y = self.y - self.oy / 2 + self.viewport.rect.y
@_damage_sprite.z = 3000
@_damage_duration = 40
end
def animation(animation, hit)
dispose_animation
@_animation = animation
return if @_animation == nil
@_animation_hit = hit
@_animation_duration = @_animation.frame_max
animation_name = @_animation.animation_name
animation_hue = @_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_animation_sprites = []
if @_animation.position != 3 or not @@_animations.include?(animation)
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_animation_sprites.push(sprite)
end
unless @@_animations.include?(animation)
@@_animations.push(animation)
end
end
update_animation
end
def loop_animation(animation)
return if animation == @_loop_animation
dispose_loop_animation
@_loop_animation = animation
return if @_loop_animation == nil
@_loop_animation_index = 0
animation_name = @_loop_animation.animation_name
animation_hue = @_loop_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_loop_animation_sprites = []
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_loop_animation_sprites.push(sprite)
end
update_loop_animation
end
def animation_set_sprites(sprites, cell_data, position)
for i in 0..15
sprite = sprites[i]
pattern = cell_data[i, 0]
if sprite == nil or pattern == nil or pattern == -1
sprite.visible = false if sprite != nil
next
end
sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
if position == 3
if self.viewport != nil
sprite.x = self.viewport.rect.width / 2
sprite.y = self.viewport.rect.height - 160
else
sprite.x = 320
sprite.y = 240
end
else
sprite.x = self.x + self.viewport.rect.x -
self.ox + self.src_rect.width / 2
sprite.y = self.y + self.viewport.rect.y -
self.oy + self.src_rect.height / 2
sprite.y -= self.src_rect.height / 4 if position == 0
sprite.y += self.src_rect.height / 4 if position == 2
end
sprite.x += cell_data[i, 1]
sprite.y += cell_data[i, 2]
sprite.z = 2000
sprite.ox = 96
sprite.oy = 96
sprite.zoom_x = cell_data[i, 3] / 100.0
sprite.zoom_y = cell_data[i, 3] / 100.0
sprite.angle = cell_data[i, 4]
sprite.mirror = (cell_data[i, 5] == 1)
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
sprite.blend_type = cell_data[i, 7]
end
end
end
end
Revenir en haut Aller en bas
Skimmer
Habitué
Habitué
Skimmer


Masculin
Nombre de messages : 50
Age : 32
Projet : Cercle des Dieux
Date d'inscription : 27/09/2006

Projet
Projet: Cercle des Dieux
Pourcentage:
Barre système menu et combat [F] Left_bar_bleue1/100Barre système menu et combat [F] Empty_bar_bleue  (1/100)

Barre système menu et combat [F] Empty
MessageSujet: Re: Barre système menu et combat [F]   Barre système menu et combat [F] Icon_minitimeMer 11 Oct - 19:41

Ce script ne fonctionne pas chez moi (bug à la ligne 382, si je me rappelle bien) Jaimerais bien que quelquun le teste pour voir si cest mon ordi ou alors le script

Merci Very Happy
Revenir en haut Aller en bas
Mikuri
Administrateur
Administrateur
Mikuri


Masculin
Nombre de messages : 142
Age : 33
Date d'inscription : 24/09/2006

Projet
Projet: Mysis
Pourcentage:
Barre système menu et combat [F] Left_bar_bleue0/100Barre système menu et combat [F] Empty_bar_bleue  (0/100)

Barre système menu et combat [F] Empty
MessageSujet: Re: Barre système menu et combat [F]   Barre système menu et combat [F] Icon_minitimeMer 11 Oct - 21:17

J'ai retesté et tout marchait bien, de plus à la ligne 382 il y a juste :

Code:
update_animation

Donc, cela vient peut-être de tes animations, malgré que je ne vois pas pourquoi il y aurait un bug.

Tack utilise le même script dans Jâqulin et tout fonctionne ainsi que moi je l'utilisait il y a quelque temps et il marchait.

Cela vient de ton jeu. Peut-être est-il pas compatible avec un des script que tu installer.

Voila.
Revenir en haut Aller en bas
Skimmer
Habitué
Habitué
Skimmer


Masculin
Nombre de messages : 50
Age : 32
Projet : Cercle des Dieux
Date d'inscription : 27/09/2006

Projet
Projet: Cercle des Dieux
Pourcentage:
Barre système menu et combat [F] Left_bar_bleue1/100Barre système menu et combat [F] Empty_bar_bleue  (1/100)

Barre système menu et combat [F] Empty
MessageSujet: Re: Barre système menu et combat [F]   Barre système menu et combat [F] Icon_minitimeMer 7 Fév - 20:21

Le même vieux bug... encore et toujours.

Screen d'erreur:
http://img458.imageshack.us/my.php?image=bugvg2.jpg
Revenir en haut Aller en bas
Mikuri
Administrateur
Administrateur
Mikuri


Masculin
Nombre de messages : 142
Age : 33
Date d'inscription : 24/09/2006

Projet
Projet: Mysis
Pourcentage:
Barre système menu et combat [F] Left_bar_bleue0/100Barre système menu et combat [F] Empty_bar_bleue  (0/100)

Barre système menu et combat [F] Empty
MessageSujet: Re: Barre système menu et combat [F]   Barre système menu et combat [F] Icon_minitimeMer 7 Fév - 20:23

et tu as quoi a ligne 382 ?

Heum...je vois pas pourquoi ça marche pas tous mes projet l'utilise.

Attend essaie celui-ci...

Code:
# HP,SPƒQ�[ƒW•\Ž¦ƒXƒNƒŠƒvƒgVer1.12

#==============================================================================
# �¡ Window_Base
#------------------------------------------------------------------------------
# �@ƒQ�[ƒ€’†‚Ì‚•‚ׂẴEƒBƒ“ƒhƒE‚̃X�[ƒp�[ƒNƒ‰ƒX‚Å‚•�B
#==============================================================================

class Window_Base < Window
#--------------------------------------------------------------------------
# �œ HP ‚Ì•`‰æ
#    actor : ƒAƒNƒ^�[
#    x    : •`‰æ�æ X �À•W
#    y    : •`‰æ�æ Y �À•W
#    width : •`‰æ�æ‚Ì•�
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
  # •Ï�”hp‚É•`‰æ‚•‚éƒQ�[ƒW‚Ì•�‚ð‘ã“ü
  hp = width * actor.hp / actor.maxhp
  # ˜g•`‰æ
  self.contents.fill_rect(x - 2, y + 15, width + 4, 10, Color.new(0, 0, 0, 192))
  self.contents.fill_rect(x - 1, y + 16, width + 2, 8, Color.new(255, 255, 192, 192))
  for i in y..y + 5
      red  = 96 - 96 * (i - y) / 5
      green = 96 - 96 * (i - y) / 5
      blue  = 96 - 96 * (i - y) / 5
    self.contents.fill_rect(x, i + 17, width, 1, Color.new(red, green, blue, 192))
  end
  # ƒQ�[ƒW‚Ì•`‰æ�ˆ—��BŒ»�Ý‚ÌHP‚É‚æ‚Á‚Ä•`‰æ�F‚ð•Ï‰»‚³‚¹‚é�B
  for i in x..x + hp - 1
      red  = 80 + 160 * (i - x) / hp
      green = 80 + 160 * (i - x) / hp
      blue  = 80 + 160 * (i - x) / hp
    self.contents.fill_rect(i, y + 17, 1, 6, Color.new(red, green, blue, 192))
  end
  # •Žš—ñ "HP" ‚ð•`‰æ
  self.contents.font.color = system_color
  self.contents.draw_text(x, y - 9, 32, 32, $data_system.words.hp)
  # MaxHP ‚ð•`‰æ‚•‚éƒXƒy�[ƒX‚ª‚ ‚é‚©ŒvŽZ
  if width - 32 >= 108
    hp_x = x + width - 108
    flag = true
  elsif width - 32 >= 48
    hp_x = x + width - 48
    flag = false
  end
  # HP ‚ð•`‰æ
  self.contents.font.color = actor.hp == 0 ? knockout_color :
    actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  self.contents.draw_text(hp_x, y - 9, 48, 32, actor.hp.to_s, 2)
  # MaxHP ‚ð•`‰æ
  if flag
    self.contents.font.color = normal_color
    self.contents.draw_text(hp_x + 48, y - 9, 12, 32, "/", 1)
    self.contents.draw_text(hp_x + 60, y - 9, 48, 32, actor.maxhp.to_s)
  end
end
#--------------------------------------------------------------------------
# �œ SP ‚Ì•`‰æ
#    actor : ƒAƒNƒ^�[
#    x    : •`‰æ�æ X �À•W
#    y    : •`‰æ�æ Y �À•W
#    width : •`‰æ�æ‚Ì•�
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 144)
  # •Ï�”sp‚É•`‰æ‚•‚éƒQ�[ƒW‚Ì•�‚ð‘ã“ü
  sp = width * actor.sp / actor.maxsp
  # ˜g•`‰æ
  self.contents.fill_rect(x - 2, y + 19, width + 4, 10, Color.new(0, 0, 0, 192))
  self.contents.fill_rect(x - 1, y + 20, width + 2, 8, Color.new(255, 255, 192, 192))
  for i in y..y + 5
      red  = 0
      green = 48 - 48 * (i - y) / 5
      blue  = 96 - 96 * (i - y) / 5
    self.contents.fill_rect(x, i + 21, width, 1, Color.new(red, green, blue, 192))
  end
  # ƒQ�[ƒW‚Ì•`‰æ�ˆ—��BŒ»�Ý‚ÌSP‚É‚æ‚Á‚Ä•`‰æ�F‚ð•Ï‰»‚³‚¹‚é�B
  for i in x..x + sp - 1
      red  = 0
      green = 40 + 80 * (i - x) / sp
      blue  = 80 + 160 * (i - x) / sp
    self.contents.fill_rect(i, y + 21, 1, 6, Color.new(red, green, blue, 192))
  end
  # •Žš—ñ "SP" ‚ð•`‰æ
  self.contents.font.color = system_color
  self.contents.draw_text(x, y - 5, 32, 32, $data_system.words.sp)
  # MaxSP ‚ð•`‰æ‚•‚éƒXƒy�[ƒX‚ª‚ ‚é‚©ŒvŽZ
  if width - 32 >= 108
    sp_x = x + width - 108
    flag = true
  elsif width - 32 >= 48
    sp_x = x + width - 48
    flag = false
  end
  # SP ‚ð•`‰æ
  self.contents.font.color = actor.sp == 0 ? knockout_color :
    actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  self.contents.draw_text(sp_x, y - 5, 48, 32, actor.sp.to_s, 2)
  # MaxSP ‚ð•`‰æ
  if flag
    self.contents.font.color = normal_color
    self.contents.draw_text(sp_x + 48, y - 5, 12, 32, "/", 1)
    self.contents.draw_text(sp_x + 60, y - 5, 48, 32, actor.maxsp.to_s)
  end
end
end

module RPG
class Sprite < ::Sprite
  def damage(value, critical)
    dispose_damage
    if value.is_a?(Numeric)
      damage_string = value.abs.to_s
    else
      damage_string = value.to_s
    end
    bitmap = Bitmap.new(160, 48)
    bitmap.font.name = "Arial Black"
    bitmap.font.size = 32
    bitmap.font.color.set(0, 0, 0)
    bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
    bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
    bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
    bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
    if value.is_a?(Numeric) and value < 0
      bitmap.font.color.set(176, 255, 144)
    else
      bitmap.font.color.set(255, 255, 255)
    end
    bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
    if critical
      bitmap.font.size = 20
      bitmap.font.color.set(0, 0, 0)
      bitmap.draw_text(-1, -1, 160, 20, "Critique!", 1)
      bitmap.draw_text(+1, -1, 160, 20, "Critique!", 1)
      bitmap.draw_text(-1, +1, 160, 20, "Critique!", 1)
      bitmap.draw_text(+1, +1, 160, 20, "Critique!", 1)
      bitmap.font.color.set(255, 255, 255)
      bitmap.draw_text(0, 0, 160, 20, "Critique!", 1)
    end
    @_damage_sprite = ::Sprite.new
    @_damage_sprite.bitmap = bitmap
    @_damage_sprite.ox = 80 + self.viewport.ox
    @_damage_sprite.oy = 20 + self.viewport.oy
    @_damage_sprite.x = self.x + self.viewport.rect.x
    @_damage_sprite.y = self.y - self.oy / 2 + self.viewport.rect.y
    @_damage_sprite.z = 3000
    @_damage_duration = 40
  end
  def animation(animation, hit)
    dispose_animation
    @_animation = animation
    return if @_animation == nil
    @_animation_hit = hit
    @_animation_duration = @_animation.frame_max
    animation_name = @_animation.animation_name
    animation_hue = @_animation.animation_hue
    bitmap = RPG::Cache.animation(animation_name, animation_hue)
    if @@_reference_count.include?(bitmap)
      @@_reference_count[bitmap] += 1
    else
      @@_reference_count[bitmap] = 1
    end
    @_animation_sprites = []
    if @_animation.position != 3 or not @@_animations.include?(animation)
      for i in 0..15
        sprite = ::Sprite.new
        sprite.bitmap = bitmap
        sprite.visible = false
        @_animation_sprites.push(sprite)
      end
      unless @@_animations.include?(animation)
        @@_animations.push(animation)
      end
    end
    update_animation
  end
  def loop_animation(animation)
    return if animation == @_loop_animation
    dispose_loop_animation
    @_loop_animation = animation
    return if @_loop_animation == nil
    @_loop_animation_index = 0
    animation_name = @_loop_animation.animation_name
    animation_hue = @_loop_animation.animation_hue
    bitmap = RPG::Cache.animation(animation_name, animation_hue)
    if @@_reference_count.include?(bitmap)
      @@_reference_count[bitmap] += 1
    else
      @@_reference_count[bitmap] = 1
    end
    @_loop_animation_sprites = []
    for i in 0..15
      sprite = ::Sprite.new
      sprite.bitmap = bitmap
      sprite.visible = false
      @_loop_animation_sprites.push(sprite)
    end
    update_loop_animation
  end
  def animation_set_sprites(sprites, cell_data, position)
    for i in 0..15
      sprite = sprites[i]
      pattern = cell_data[i, 0]
      if sprite == nil or pattern == nil or pattern == -1
        sprite.visible = false if sprite != nil
        next
      end
      sprite.visible = true
      sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
      if position == 3
        if self.viewport != nil
          sprite.x = self.viewport.rect.width / 2
          sprite.y = self.viewport.rect.height - 160
        else
          sprite.x = 320
          sprite.y = 240
        end
      else
        sprite.x = self.x + self.viewport.rect.x - self.ox + self.src_rect.width / 2
        sprite.y = self.y + self.viewport.rect.y - self.oy + self.src_rect.height / 2
        sprite.y -= self.src_rect.height / 4 if position == 0
        sprite.y += self.src_rect.height / 4 if position == 2
      end
      sprite.x += cell_data[i, 1]
      sprite.y += cell_data[i, 2]
      sprite.z = 2000
      sprite.ox = 96
      sprite.oy = 96
      sprite.zoom_x = cell_data[i, 3] / 100.0
      sprite.zoom_y = cell_data[i, 3] / 100.0
      sprite.angle = cell_data[i, 4]
      sprite.mirror = (cell_data[i, 5] == 1)
      sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
      sprite.blend_type = cell_data[i, 7]
    end
  end
end
end
Revenir en haut Aller en bas
Contenu sponsorisé





Barre système menu et combat [F] Empty
MessageSujet: Re: Barre système menu et combat [F]   Barre système menu et combat [F] Icon_minitime

Revenir en haut Aller en bas
 
Barre système menu et combat [F]
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Barre de vie et magie des ennemies en combat. [F]
» Menu gameover [F]

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RPGloryXP :: Taverne :: Scripts-
Sauter vers:  
Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser