Day.png);">
Apprendre


Vous êtes
nouveau sur
Oniromancie?

Visite guidée
du site


Découvrir
RPG Maker

RM 95
RM 2000/2003
RM XP
RM VX/VX Ace
RM MV/MZ

Apprendre
RPG Maker

Tutoriels
Guides
Making-of

Dans le
Forum

Section Entraide

Tutos: Checklist de la composition (...) / Sorties: Dread Mac Farlane - episode 8 / Sorties: Dread Mac Farlane - episode 7 / Jeux: Ce qui vit Dessous / News: Quoi de neuf sur Oniromancie (...) / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

390 connectés actuellement

29378056 visiteurs
depuis l'ouverture

7423 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Level Up!

Guelnika & E-magination

Lumen

RPG Fusion

Tous nos partenaires

Devenir
partenaire



forums

Index du forum > Entraide > [RESOLU] [RMXP] Problème script HUD de Raziel


Mr Drerrawyn - posté le 05/08/2013 à 18:58:13 (1694 messages postés)

❤ 0

Le

Domaine concerné: Scripts
Logiciel utilisé: RMXP
Bonsoir, j'ai un problème avec un script (celui-ci)

Donc, le truc, c'est simple:
Quand je lance le jeu, juste après l'écran titre:

image

J'ai rien à ajouter je crois, j'aimerais vraiment utiliser ce script.

Indications:
1. Le script ne marche pas sur un projet vierge
2. Je n'ai aucun autre script


Mack - posté le 05/08/2013 à 19:11:53 (2288 messages postés) - staff

❤ 0

A vue de nez, le script est 'achement bugguer xD.
Tu corriges un morceau, et hop !
Y a une nouvelle erreur !
:'D.
J'vais voir pour corriger ça, mais au pire, si tu veux j'peux recoder un HUD comme tu le souhaites ;D.

( Je prend note de tout les commentaires, même si je n'y répond pas )


Zeus81 - posté le 05/08/2013 à 19:26:17 (11071 messages postés)

❤ 0

Tu vas dans la page du script sur oniro, tu fais Afficher le code source (Ctrl+U sur Firefox) et tu cherches (Ctrl+F) tous les <i> dans le script que tu remplaces par [i].
Une fois Nonor avait transformé tous les scripts de la bdd en bbcode et il a explosé la moitié d'entre eux. :)


Mr Drerrawyn - posté le 05/08/2013 à 19:35:25 (1694 messages postés)

❤ 0

Le

Hophophophophop Mack, non, finis tes projets avant ;)
Merci beaucoup quand meme :)

Merci Zeus, je vais essayer ça après manger :)

(justement, avant ce script marchait tout le temps)

EDIT: Doesn't work :( ou je m'y suis mal prit, mais ça m'étonnerait


Mack - posté le 05/08/2013 à 19:40:13 (2288 messages postés) - staff

❤ 0

J'ai pas mon PC en ce moment, celui sur lequel je suis à juste RMXP d'installer, donc de toute façon je peux rien faire pour l'instant xD.

Zeus :
Ah okay, j'comprend mieux xD.

J'viens de finir de le "réparer" :

Portion de code : Tout sélectionner

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
 
 
 
# HUD by Raziel
 
class Scene_Map
  SWITCH_ID = 1
  $center_hud = false
  alias raz_hud_main main
  alias raz_hud_update update
  def main
    @size = $game_party.actors.size
    update_hud
    raz_hud_main
    @hud_window.dispose
    for i in 0...@size
      if (@hud_cummy!=nil)
        unless (@hud_cummy.disposed?)
          @hud_dummy.dispose
        end
      end
    end
 
  end
 
  def update
    update_hud
    raz_hud_update
  end
  
  def update_hud
    if @size != $game_party.actors.size
      @hud_window.refresh
      show_window
    end
    if @hud != true
      main_window
    end
    turn_hud_on_off
    @hud_window.update
    
  end
  
 
  def show_window
    @size = $game_party.actors.size
    for i in 0..3
      @hud_dummy.visible = ($game_party.actors != nil)
    end
  end
 
  def main_window
    @opacity = 200
    @hud_dummy = []
    for i in 0...4
      y = $game_party.actors.size - 1
      x = 240 - (y * 80)
      if $center_hud == true
        @hud_dummy[i] = Window_Base.new(160 * i + x, 372,160, 108)
      else
        @hud_dummy[i] = Window_Base.new(160 * i, 372,160, 108)
      end
      @hud_dummy[i].opacity = @opacity
      @hud_dummy[i].visible = false
    end
    @hud_window = Window_HUD.new
    for i in 0...$game_party.actors.size
      @hud_dummy[i].visible = $game_party.actors != nil
    end
    @hud = true
  end
 
  def turn_hud_on_off
   if $game_switches[SWITCH_ID] == false
    @hud_window.visible = false
      for i in 0...$game_party.actors.size
        @hud_dummy[i].visible = false
      end
    end
    if $game_switches[SWITCH_ID] == true
      @hud_window.visible = true
      for i in 0...$game_party.actors.size
        @hud_dummy[i].visible = true
      end
    end
  end
end
 
 
class Window_HUD < Window_Base
  def initialize
    super(0, 0, 800, 600)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      eval("@old_hp#{i+1} = actor.hp; @old_sp#{i+1} = actor.sp; @old_exp#{i+1} = actor.now_exp")
    end
    refresh
  end
 
  def refresh
    self.contents.clear
    for i in 0...$game_party.actors.size
      a = $game_party.actors.size - 1
      actor = $game_party.actors[i]
      if $center_hud == true
        x = (i * 160 + 25) + (240 - (a * 80))
      else
        x = i * 160 + 25
      end
      self.contents.font.size = 21
      draw_actor_graphic(actor, x - 15, 445)
      self.contents.font.color = normal_color
      self.contents.draw_text(x - 25, 360, 100, 32, actor.name)
      width = 100
      height = 6
      draw_slant_bar(x + 8, 396, actor.hp, actor.maxhp, width, height, Color.new(150, 0, 0), Color.new(155, 155, 60))
      draw_slant_bar(x + 8, 416, actor.sp, actor.maxsp, width, height, Color.new(0, 0, 150), Color.new(60, 155, 155))
      unless actor.level == 99
        draw_slant_bar(x + 8, 436, actor.now_exp, actor.next_exp, width, height, Color.new(0, 150, 0), Color.new(60, 255, 60))
      else
        draw_slant_bar(x + 8, 436, 1, 1, width = 100, height = 6, Color.new(0, 150, 0), Color.new(60, 255, 60))
      end
      self.contents.font.size = 16
      draw_actor_state(actor, x + 45, 360)
      self.contents.font.color = normal_color
      self.contents.font.bold = true
      self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
      self.contents.draw_text(x + 16, 382, 100, 32, "#{actor.hp}/#{actor.maxhp}", 1)
      self.contents.font.color = actor.sp == 0 ? crisis_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
      self.contents.draw_text(x + 16, 402, 100, 32, "#{actor.sp}/#{actor.maxsp}", 1)
      self.contents.font.color = system_color
      self.contents.font.size = 20
      self.contents.font.bold = false
      self.contents.draw_text(x, 384, 50, 32, $data_system.words.hp)
      self.contents.draw_text(x, 404, 50, 32, $data_system.words.sp)
      self.contents.draw_text(x, 424, 50, 32, "Exp")
    end
  end
 
  def update
    super
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if (eval("@old_hp#{i+1}") != actor.hp or eval("@old_sp#{i+1}") != actor.sp or
        eval("@old_exp#{i+1}") != actor.now_exp)
        refresh
        eval("@old_hp#{i+1} = actor.hp; @old_sp#{i+1} = actor.sp; @old_exp#{i+1} = actor.now_exp")
      end
    end
  end
end
 
class Window_Base < Window
  def draw_slant_bar(x, y, min, max, width = 152, height = 6,
    bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
    for i in 0..height
      self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
    end
    for i in 1..(height - 1)
      r = 100 * (height - i) / height + 0 * i / height
      g = 100 * (height - i) / height + 0 * i / height
      b = 100 * (height - i) / height + 0 * i / height
      a = 255 * (height - i) / height + 255 * i / height
      self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
    end
    for i in 1..( (min / max.to_f) * width - 1)
      for j in 1..(height - 1)
        r = bar_color.red * (width - i) / width + end_color.red * i / width
        g = bar_color.green * (width - i) / width + end_color.green * i / width
        b = bar_color.blue * (width - i) / width + end_color.blue * i / width
        a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
        self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
      end
    end
  end
end
 
 
 
class Game_Actor
  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
 


Je trouve qu'il est codé bizarrement, l'auteur à mis plusieurs eval, mais j'vois pas à quoi ils servent ...

( Je prend note de tout les commentaires, même si je n'y répond pas )


Mr Drerrawyn - posté le 05/08/2013 à 19:43:39 (1694 messages postés)

❤ 0

Le

Bad value of range: Ligne 168
Sorry :/


Mack - posté le 05/08/2013 à 20:26:02 (2288 messages postés) - staff

❤ 0

Ah ?
Aucune erreur chez moi ><.

( Je prend note de tout les commentaires, même si je n'y répond pas )


Mr Drerrawyn - posté le 05/08/2013 à 20:59:53 (1694 messages postés)

❤ 0

Le

Pas d'erreur à la ligne 168 ? :O

EDIT: Ok, c'est bon, c'est juste que faut pas mettre les MP max à 0 -.-


Mack - posté le 06/08/2013 à 19:08:52 (2288 messages postés) - staff

❤ 0

J'savais même pas que c'était possible de mettre les MP max à 0 xD

( Je prend note de tout les commentaires, même si je n'y répond pas )

Index du forum > Entraide > [RESOLU] [RMXP] Problème script HUD de Raziel

repondre up

Suite à de nombreux abus, le post en invités a été désactivé. Veuillez vous inscrire si vous souhaitez participer à la conversation.

Haut de page

Merci de ne pas reproduire le contenu de ce site sans autorisation.
Contacter l'équipe - Mentions légales

Plan du site

Communauté: Accueil | Forum | Chat | Commentaires | News | Flash-news | Screen de la semaine | Sorties | Tests | Gaming-Live | Interviews | Galerie | OST | Blogs | Recherche
Apprendre: Visite guidée | RPG Maker 95 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker MV | Tutoriels | Guides | Making-of
Télécharger: Programmes | Scripts/Plugins | Ressources graphiques / sonores | Packs de ressources | Midis | Eléments séparés | Sprites
Jeux: Au hasard | Notre sélection | Sélection des membres | Tous les jeux | Jeux complets | Le cimetière | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Proposer
Ressources RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
Ressources RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
Ressources RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes
Ressources RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis
Archives: Palmarès | L'Annuaire | Livre d'or | Le Wiki | Divers