Bienvenue visiteur !
|

Statistiques
Liste des membres
Contact
Mentions légales
85 connectés actuellement
26991173 visiteurs depuis l'ouverture
3281 visiteurs aujourd'hui

Partenaires








Tous nos partenaires
Devenir partenaire
|
arttroy -
posté le 29/12/2012 à 16:31:28 (2394 messages postés)
| Just working | Domaine concerné: Script Logiciel utilisé: RMVX Ace Bonjour me revoilà avec un nouveau souci, cette fois c'est l'affichage dans le skill menu qui ne va pas.
Alors déjà les parties de code concernées :
Scene_Skill :
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
| class Scene_HWSkill < Scene_ItemBase
attr_accessor :lvl_actuel
attr_accessor :util_actuel
def start
super
create_help_window
create_background
create_actor_window
create_command_window
create_status_window
create_item_window
create_background_image
create_background_image_b
create_pierre_window
@command_window.index = 0
create_image_pierres
end
def terminate
super
dispose_background
dispose_background_image
dispose_background_image_b
dispose_pierre_system
end
def create_background
@sprite_menu = Sprite.new
@sprite_menu.bitmap = Cache.picture("fond menu base 4")
@sprite_menu.x = 270
@sprite_menu.y = 115
@sprite_menu.z = 4
end
def dispose_background
@sprite_menu.dispose
end
def create_background_image
@sprite = Sprite.new
@sprite.bitmap = Cache.picture("fond")
end
def dispose_background_image
@sprite.dispose
end
def create_background_image_b
@sprite_b = Sprite.new
@sprite_b.bitmap = Cache.picture("fond menu base 3")
@sprite_b.x = 100
@sprite_b.y = 115
@sprite_arts = Sprite.new
@sprite_arts.bitmap = Cache.picture("Ecriture_arts")
@sprite_arts.x = 420
@sprite_arts.y = 68
@sprite_arts.z = 5
end
def dispose_background_image_b
@sprite_b.dispose
@sprite_arts.dispose
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
wy = @help_window.height
@command_window = Window_SkillCommand.new(0, wy)
@command_window.viewport = @viewport
@command_window.help_window = @help_window
@command_window.actor = @actor
@command_window.set_handler(:skill, method(:command_skill))
@command_window.set_handler(:cancel, method(:return_scene))
@command_window.set_handler(:pagedown, method(:next_actor))
@command_window.set_handler(:pageup, method(:prev_actor))
end
#--------------------------------------------------------------------------
# * Create Status Window
#--------------------------------------------------------------------------
def create_status_window
y = @help_window.height
@status_window = Window_SkillStatus.new(@command_window.width, y)
@status_window.opacity = 0
@status_window.back_opacity = 0
@status_window.viewport = @viewport
@status_window.actor = @actor
end
#--------------------------------------------------------------------------
# * Create Item Window
#--------------------------------------------------------------------------
def create_item_window
wx = 0
wy = @status_window.y + @status_window.height
ww = Graphics.width
wh = Graphics.height - wy
@item_window = Window_SkillList.new(370, 300, 250, wh)
@item_window.actor = @actor
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.set_handler(:ok, method(:on_item_ok))
@item_window.set_handler(:cancel, method(:on_item_cancel))
@command_window.skill_window = @item_window
@item_window.opacity = 0
@item_window.back_opacity = 0
end
#----------------------------------------------------------------------------
# * Système de pierres magiques
#----------------------------------------------------------------------------
def create_image_pierres
@sprite_pierre = Sprite.new
@sprite_pierre.bitmap = Cache.picture("")
@sprite_pierre.x = 366
@sprite_pierre.y = 160
@sprite_pierre.z = 4
@sprite_icone = Sprite.new
@sprite_icone.bitmap = Cache.picture("")
@sprite_icone.x = 355
@sprite_icone.y = 235
@sprite_icone.z = 4
update
end
def create_pierre_window
@niveau_window = Window_Pierre_Niveau.new(0, 308, self)
end
def update
super
update_pierre_system
@niveau_window.update
@sprite_pierre.update
@sprite_icone.update
end
def update_pierre_system
if @command_window.command_name(@command_window.index) == "Pierre feu" and $game_party.item_number($data_armors[61])==1
@sprite_pierre.bitmap = Cache.picture("EcriturePierreFeu")
@sprite_pierre.x = 368
@sprite_pierre.y = 139
@sprite_icone.bitmap = Cache.picture("icone_pierre_feu")
@lvl_actuel = $game_variables[60]
@util_actuel = $game_variables[58]
end
if @command_window.command_name(@command_window.index) == "Pierre eau" and $game_party.item_number($data_armors[62])==1
@sprite_pierre.bitmap = Cache.picture("EcriturePierreEau")
@sprite_pierre.x = 385
@sprite_pierre.y = 160
@sprite_icone.bitmap = Cache.picture("icone_pierre_eau")
@lvl_actuel = $game_variables[61]
@util_actuel = $game_variables[59]
end
if @command_window.command_name(@command_window.index) == "Pierre terre" and $game_party.item_number($data_armors[63])==1
@sprite_pierre.bitmap = Cache.picture("EcriturePierreTerre")
@sprite_pierre.x = 367
@sprite_pierre.y = 154
@sprite_icone.bitmap = Cache.picture("icone_pierre_terre")
@lvl_actuel = $game_variables[63]
@util_actuel = $game_variables[62]
end
if @command_window.command_name(@command_window.index) == "Pierre vent" and $game_party.item_number($data_armors[64])==1
@sprite_pierre.bitmap = Cache.picture("EcriturePierreVent")
@sprite_pierre.x = 370
@sprite_pierre.y = 156
@sprite_icone.bitmap = Cache.picture("icone_pierre_vent")
@lvl_actuel = $game_variables[65]
@util_actuel = $game_variables[64]
end
if @command_window.command_name(@command_window.index) == "Pierre foudre" and $game_party.item_number($data_armors[65])==1
@sprite_pierre.bitmap = Cache.picture("EcriturePierreFoudre")
@sprite_pierre.x = 362
@sprite_pierre.y = 159
@sprite_icone.bitmap = Cache.picture("icone_pierre_foudre")
@lvl_actuel = $game_variables[67]
@util_actuel = $game_variables[66]
end
end
def dispose_pierre_system
@sprite_pierre.dispose
@sprite_icone.dispose
end
#--------------------------------------------------------------------------
# * Get Skill's User
#--------------------------------------------------------------------------
def user
@actor
end
#--------------------------------------------------------------------------
# * [Skill] Command
#--------------------------------------------------------------------------
def command_skill
@item_window.activate
@item_window.select_last
end
#--------------------------------------------------------------------------
# * Item [OK]
#--------------------------------------------------------------------------
def on_item_ok
@actor.last_skill.object = item
if @actor.hp < @actor.mhp
use_item
else
Sound.play_buzzer
@item_window.activate
@item_window.select_last
end
end
#--------------------------------------------------------------------------
# * Item [Cancel]
#--------------------------------------------------------------------------
def on_item_cancel
@item_window.unselect
@command_window.activate
end
#--------------------------------------------------------------------------
# * Play SE When Using Item
#--------------------------------------------------------------------------
def play_se_for_item
Sound.play_use_skill
end
#--------------------------------------------------------------------------
# * Use Item
#--------------------------------------------------------------------------
def use_item
super
@status_window.refresh
@item_window.refresh
end
#--------------------------------------------------------------------------
# * Change Actors
#--------------------------------------------------------------------------
def on_actor_change
@command_window.actor = @actor
@status_window.actor = @actor
@item_window.actor = @actor
@command_window.activate
end
end
class Window_Pierre_Niveau < Window_Base
def initialize(x, y, scene)
super(420, 180, 220, 150)
self.opacity = 0
self.back_opacity = 0
self.contents.font.size = 20
self.contents.font.name = "Karate"
self.contents.font.color = normal_color
@scene = scene
update
refresh
end
def refresh
self.contents.clear
@lvl = @scene.lvl_actuel
@util = @scene.util_actuel
self.contents.draw_text(25, 0, 100, contents.height, "Nv : " + @scene.lvl_actuel.to_s, 2)
self.contents.draw_text(-50, 20, 200, contents.height, " Utilisations : " + @scene.util_actuel.to_s, 2)
end
def update
super
if @lvl != @scene.lvl_actuel or @util != @scene.util_actuel
refresh
end
end
end |
Le Window_SkillCommand
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
| #==============================================================================
# ** Window_SkillCommand
#------------------------------------------------------------------------------
# This window is for selecting commands (special attacks, magic, etc.) on the
# skill screen.
#==============================================================================
class Window_SkillCommand < Window_Command
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :skill_window
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y)
@actor = nil
self.x = 100
self.y = 70
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 550
end
#--------------------------------------------------------------------------
# * Set Actor
#--------------------------------------------------------------------------
def actor=(actor)
return if @actor == actor
@actor = actor
refresh
select_last
end
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
return 1
end
def col_max
return 5
end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
def make_command_list
return unless @actor
# self.visible = false
@actor.added_skill_types.sort.each do |stype_id|
name = $data_system.skill_types[stype_id]
add_command(name, :skill, true, stype_id)
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
@skill_window.stype_id = current_ext if @skill_window
end
#--------------------------------------------------------------------------
# * Set Skill Window
#--------------------------------------------------------------------------
def skill_window=(skill_window)
@skill_window = skill_window
update
end
#--------------------------------------------------------------------------
# * Restore Previous Selection Position
#--------------------------------------------------------------------------
def select_last
skill = @actor.last_skill.object
if skill
select_ext(skill.stype_id)
else
select(0)
end
end
end
|
Le système d'auto-équipement (créé par Mack) :
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
| class Game_Interpreter
def update_slot
for actor in $game_party.members
# Fait ce qui suit pour chaque héros dans l'équipe
if $game_party.item_number($data_armors[61])>0
# Si l'item d'id 60 est possèder dans l'inventaire ( Et seulement dans l'inventaire, pas sur les héros )
if actor.equips[5]==nil
# Si le héros n'a pas d'équipement dans le slot 5 ( Premier accessoire )
actor.force_change_equip(5,$data_armors[61])
#Equiper l'accessoir d'id 60
end
end
#Pareil, mais pour l'objet d'id 58 et le slot 6
if $game_party.item_number($data_armors[62])>0
if actor.equips[6]==nil
actor.force_change_equip(6,$data_armors[62])
end
end
if $game_party.item_number($data_armors[63])>0
if actor.equips[7]==nil
actor.force_change_equip(7,$data_armors[63])
end
end
if $game_party.item_number($data_armors[64])>0
if actor.equips[8]==nil
actor.force_change_equip(8,$data_armors[64])
end
end
if $game_party.item_number($data_armors[65])>0
if actor.equips[9]==nil
actor.force_change_equip(9,$data_armors[65])
end
end
end
end
end |
Le souci est que lorsque j'ajoute les pierres une par une, celle du feu et de l'eau fonctionnent bien mais pour les autres l'affichage ne se fait pas en gros ça donne ça :
Alors que ça devrait donner ça (c'est d'ailleurs bien ce qui se passe si j'ai toutes les pierres) :
Si quelqu'un pouvait m'aider sur ce point ce serait sympa. Merci d'avance de vos réponses.
|
Anti-inconstructivité / Pétition pour que le mot making soit inscrit dans le dictionnaire ? |
Estheone -
posté le 29/12/2012 à 18:28:09 (312 messages postés)
| | Un truc que je comprends pas dans tes scripts : tu as d'un côté un script qui t'équipe automatiquement les pierres (et donc les vire de l'inventaire) et de l'autre tu vérifies si tu as les pierres dans l'inventaire pour faire leur affichage (les lignes de code de ce type)
1
| and $game_party.item_number($data_armors[61])==1 |
Du coup il est pas là le problème ?
Si tu voulais vérifier si la pierre est équipée sur le héros il te faut remplacer ces lignes par :
1
| and $game_party.leader.armors.include?($data_armors[x]) |
Sinon c'est que j'ai rien compris et que je vois pas où est le problème. 
|
Wandering Souls : Jeu complet / Topic sur Oniro |
arttroy -
posté le 29/12/2012 à 19:08:03 (2394 messages postés)
| Just working | J'ai testé et ça ne fonctionne pas (mais ça revient au même donc du coup je vais garder ta méthode), ce que je ne comprend pas c'est que l'affichage se fait correctement avec la pierre de feu et d'eau mais pour les trois autres ça foire systématiquement (à moins d'avoir les 5 pierres d'équipées, là ça fonctionne nickel).
J'ai passé ma journée là dessus impossible de trouver.
C'est vraiment curieux comme bug quand même... Si je prend la pierre du vent en premier ça foire, si j'ajoute la pierre de terre, cette fois ci celle du vent s'affiche bien mais pas celle de la terre et si je rajoute encore la pierre de foudre plus de soucis tout est affiché normalement... Depuis tout à l'heure j'essaie différentes combinaisons mais rien.
Histoire que mes propos soient plus clairs...
http://youtu.be/-KTybs03BnA
Ça fait un moment que je cherche mais rien à faire...
Edit : je viens de vivre un de mes plus grands moments de solitude à la lecture du MP d'Esthéone en fait je m'étais juste trompé dans une partie de la condition, je n'affichait pas le bon objet, je suis désolé...
Du coup problème résolu...
|
Anti-inconstructivité / Pétition pour que le mot making soit inscrit dans le dictionnaire ? | Index du forum > Entraide > [Résolu][RMVX Ace] Problème d'affichage


|
|
|