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

Sorties: Star Trek: Glorious Wolf - (...) / Sorties: Dread Mac Farlane - episode 3 / News: Plein d'images cools créées par (...) / Sorties: Star Trek: Glorious Wolf - (...) / Jeux: Final Fantasy 2.0 / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

567 connectés actuellement

29191075 visiteurs
depuis l'ouverture

6126 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

RPG Fusion

Leo-Games

Offgame

Planète Glutko

Tous nos partenaires

Devenir
partenaire



forums

Index du forum > Entraide > [RESOLU] [VX] Problème script de panorama


LittleGamer - posté le 08/11/2014 à 15:21:09 (414 messages postés)

❤ 0

Domaine concerné: Script
Logiciel utilisé: VX
Bonjour,

J'ai trouvé ce script ce sur ce site, mais il est buggé. Il affiche un message d'erreur au lancement d'une nouvelle partie.

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
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
#==============================================================================
 
#  (RMVX)                                                     ~ Multi-panorama ~
 
#                                                                             de Lufia
 
#                                                                               v 1.0
 
#==============================================================================
 
# Ce script permet d'afficher plusieurs panoramas / fogs en même temps durant le jeu.
 
# Nombre maximum de panoramas :
 
MAX_PANORAMAS = 20
 
#
 
# Les images sont à placer dans le dossier Parallaxes.
 
# Les commandes suivantes sont à utiliser en insertion de script.
 
#
 
# Afficher un panorama :
 
#    show_pano(id, name, z, opacity, blend_type, zoom_x, zoom_y, autoscroll_x_speed, 
 
#      autoscroll_y_speed, move_x_speed, move_y_speed)
 
#        id : numéro du panorama (de 0 à MAX_PANORAMAS - 1)
 
#        name : nom du fchier dans Graphics/Parallaxes
 
#        z : coordonnée en z, si ce nombre est grand, le panorama apparaît au-dessus d'autres
 
#             éléments de la carte
 
#        opacity : opacité (de 0 à 255, nombre décimaux autorisés)
 
#        blend_type : type de transparence (0 : normale, 1 : addition, 2 : soustraction)
 
#        zoom_x : zoom en x (taille normale : 100.0)
 
#        zoom_y : zoom en y (taille normale : 100.0)
 
#        autoscroll_x_speed : vitesse de défilement horizontal
 
#        autoscroll_y_speed : vitesse de défilement vertical
 
#        move_x_speed : scrolling parallaxe en x (même vitesse que la carte : 2)
 
#        move_y_speed : scrolling parallaxe en y (même vitesse que la carte : 2)
 
#      ex : show_pano(0, "MonPano", -1, 160, 1, 54.3, 100, -10, 0, 2, 1)
 
#
 
# Modifier un panorama :
 
#    change_pano_properties(id, z, opacity, blend_type, zoom_x, zoom_y, autoscroll_x_speed, 
 
#      autoscroll_y_speed, move_x_speed, move_y_speed, duration, wait_for_end)
 
#        duration : temps de transition (en frames)
 
#        wait_for_end : attendre la fin de la transition ? (oui : true / non : false)
 
#      ex : change_pano_properties(0, 20, 255, 0, 100, 100, 0, 15, 2, 2, 20, true)
 
#
 
# Modifier le ton d'un panorama :
 
#    change_pano_tone(id, red, green, blue, gray, duration, wait_for_end)
 
#        red : ajustement du rouge (de -255 à 255)
 
#        green : ajustement du vert (de -255 à 255)
 
#        blue : ajustement du bleu (de -255 à 255)
 
#        gray : ajustement du gris (de -255 à 255)
 
#      ex : change_pano_tone(0, 100, -100, 0, 35, 15, false)
 
#
 
# Modifier la couleur d'un panorama :
 
#    change_pano_color(id, red, green, blue, alpha, duration, wait_for_end)
 
#       red : valeur du rouge (de 0 à 255)
 
#       green : valeur du vert (de 0 à 255)
 
#       blue : valeur du bleu (de 0 à 255)
 
#       alpha : alpha blending (de 0 à 255)
 
#      ex : change_pano_color(0, 255, 100, 0, 0, 0, false)
 
#
 
# Effacer un panorama :
 
#    hide_pano(args)
 
#       args : ids des panoramas
 
#      ex : hide_pano(1, 3, 12)
 
#
 
#==============================================================================
 
# Merci à Zeus81 pour ses précieux conseils.
 
# Enjoy !
 
#==============================================================================
 
 
 
 
 
#==============================================================================
 
# ** Game_Panorama
 
#------------------------------------------------------------------------------
 
#  This class handles panoramas. This class is used within the Game_Map class.
 
#==============================================================================
 
class Game_Panorama
 
 
 
  #--------------------------------------------------------------------------
 
  # * Public Instance Variables
 
  #--------------------------------------------------------------------------
 
  attr_reader      :id
 
  attr_accessor :name
 
  attr_accessor :z
 
  attr_accessor :opacity
 
  attr_accessor :blend_type
 
  attr_accessor :zoom_x
 
  attr_accessor :zoom_y
 
  attr_accessor :color
 
  attr_accessor :tone
 
  attr_accessor :autoscroll_x_speed
 
  attr_accessor :autoscroll_y_speed
 
  attr_accessor :move_x_speed
 
  attr_accessor :move_y_speed
 
  
 
  #--------------------------------------------------------------------------
 
  # * Object initialization
 
  #      id : panorama number
 
  #--------------------------------------------------------------------------
 
  def initialize(id)
 
    @id = id
 
    @name = ""
 
    @z = 0
 
    @opacity = 255.0
 
    @target_opacity = 255.0
 
    @blend_type = 0
 
    @zoom_x = 100.0
 
    @target_zoom_x = 100.0
 
    @zoom_y = 100.0
 
    @target_zoom_y = 100.0
 
    @color = Color.new(0, 0, 0, 0)
 
    @target_color = Color.new(0, 0, 0, 0)
 
    @tone = Tone.new(0, 0, 0, 0)
 
    @target_tone = Tone.new(0, 0, 0, 0)
 
    @autoscroll_x_speed = 0
 
    @autoscroll_y_speed = 0
 
    @move_x_speed = 0.0
 
    @move_y_speed = 0.0
 
    @duration = 0
 
    @tone_duration = 0
 
    @color_duration = 0
 
  end
 
  
 
  #--------------------------------------------------------------------------
 
  # * Show panorama
 
  #      name : filename
 
  #      z : z coordinate
 
  #      opacity : sprite opacity
 
  #      blend_type : blend type
 
  #      zoom_x : x axis zoom 
 
  #      zoom_y : y axis zoom
 
  #      autoscroll_x_speed : x axis autoscroll speed
 
  #      autoscroll_y_speed : y axis autoscroll speed
 
  #      move_x_speed : x axis scroll speed
 
  #      move_y_speed : y axis scroll speed
 
  #--------------------------------------------------------------------------
 
  def show(name, z, opacity, blend_type, zoom_x, zoom_y, autoscroll_x_speed, 
 
    autoscroll_y_speed, move_x_speed, move_y_speed)
 
    @name = name
 
    @z = z
 
    @opacity = opacity.to_f
 
    @target_opacity = opacity
 
    @blend_type = blend_type
 
    @zoom_x = zoom_x.to_f
 
    @target_zoom_x = @zoom_x
 
    @zoom_y = zoom_y.to_f
 
    @target_zoom_y = @zoom_y
 
    @color = Color.new(0, 0, 0, 0)
 
    @target_color = @color.clone
 
    @tone = Tone.new(0, 0, 0, 0)
 
    @target_tone = @tone.clone
 
    @autoscroll_x_speed = autoscroll_x_speed
 
    @autoscroll_y_speed = autoscroll_y_speed
 
    @move_x_speed = move_x_speed.to_f
 
    @move_y_speed = move_y_speed.to_f
 
  end
 
  
 
  #--------------------------------------------------------------------------
 
  # * Erase panorama
 
  #--------------------------------------------------------------------------
 
  def hide
 
    @name = ""
 
  end
 
  
 
  #--------------------------------------------------------------------------
 
  # * Change panorama properties
 
  #      z : z coordinate
 
  #      zoom_x : x axis zoom
 
  #      zoom_y : y axis zoom
 
  #      blend_type : blend type
 
  #      opacity : sprite opacity
 
  #      duration : transition time
 
  #--------------------------------------------------------------------------
 
  def change_opacity(z, zoom_x, zoom_y, opacity, blend_type, autoscroll_x_speed, 
 
    autoscroll_y_speed, move_x_speed, move_y_speed, duration)
 
    @z = z
 
    @blend_type = blend_type
 
    @autoscroll_x_speed = autoscroll_x_speed
 
    @autoscroll_y_speed = autoscroll_y_speed
 
    @move_x_speed = move_x_speed.to_f
 
    @move_y_speed = move_y_speed.to_f
 
    @target_zoom_x = zoom_x.to_f
 
    @target_zoom_y = zoom_y.to_f
 
    @target_opacity = opacity.to_f
 
    @duration = duration
 
    if duration == 0
 
      @zoom_x = @target_zoom_x
 
      @zoom_y = @target_zoom_y
 
      @opacity = @target_opacity
 
    end
 
  end
 
  
 
  #--------------------------------------------------------------------------
 
  # * Change panorama tone
 
  #      tone : new tone (Tone object)
 
  #      duration : transition time
 
  #--------------------------------------------------------------------------
 
  def change_tone(tone, duration)
 
    @target_tone = tone.clone
 
    @tone_duration = duration
 
    if duration == 0
 
      @tone = @target_tone.clone
 
    end
 
  end
 
  
 
  #--------------------------------------------------------------------------
 
  # * Change panorama color
 
  #      color : new color (Color object)
 
  #      duration : transition time
 
  #--------------------------------------------------------------------------
 
  def change_color(color, duration)
 
    @target_color = color.clone
 
    @color_duration = duration
 
    if duration == 0
 
      @color = @target_color.clone
 
    end
 
  end
 
  
 
  #--------------------------------------------------------------------------
 
  # * Frame update
 
  #--------------------------------------------------------------------------
 
  def update
 
    if @duration > 0
 
      d = @duration
 
      @zoom_x = (@zoom_x * (d-1) + @target_zoom_x) / d
 
      @zoom_y = (@zoom_y * (d-1) + @target_zoom_y) / d
 
      @opacity = (@opacity * (d-1) + @target_opacity) / d
 
      @duration -= 1
 
    end
 
    if @tone_duration > 0
 
      d = @tone_duration
 
      @tone.red = (@tone.red * (d-1) + @target_tone.red) / d
 
      @tone.green = (@tone.green * (d-1) + @target_tone.green) / d
 
      @tone.blue = (@tone.blue * (d-1) + @target_tone.blue) / d
 
      @tone.gray = (@tone.gray * (d-1) + @target_tone.gray) / d
 
      @tone_duration -= 1
 
    end
 
    if @color_duration > 0
 
      d = @color_duration
 
      @color.red = (@color.red * (d-1) + @target_color.red) / d
 
      @color.green = (@color.green * (d-1) + @target_color.green) / d
 
      @color.blue = (@color.blue * (d-1) + @target_color.blue) / d
 
      @color.alpha = (@color.alpha * (d-1) + @target_color.alpha) / d
 
      @color_duration -= 1
 
    end
 
  end
 
  
 
end
 
 
 
#==============================================================================
 
# ** Game_Map
 
#------------------------------------------------------------------------------
 
#  This class handles maps. It includes scrolling and passage determination
 
#  functions. The instance of this class is referenced by $game_map.
 
#==============================================================================
 
class Game_Map 
 
 
 
  #--------------------------------------------------------------------------
 
  # * Public Instance Variables
 
  #--------------------------------------------------------------------------
 
  attr_accessor :panoramas
 
  
 
  #--------------------------------------------------------------------------
 
  # * Object initialization
 
  #--------------------------------------------------------------------------
 
  alias lufia_multipano_initialize initialize
 
  def initialize
 
    @panoramas = []
 
    for i in 0...MAX_PANORAMAS
 
      @panoramas.push(Game_Panorama.new(i))
 
    end
 
    lufia_multipano_initialize
 
  end
 
  
 
  #--------------------------------------------------------------------------
 
  # * Frame Update
 
  #--------------------------------------------------------------------------
 
  alias lufia_multipano_update update
 
  def update
 
    @panoramas.each { |i| i.update }
 
    lufia_multipano_update
 
  end
 
  
 
end
 
 
 
#==============================================================================
 
# ** Sprite_Panorama
 
#------------------------------------------------------------------------------
 
#  This plane is used to display panoramas. It observes a instance of the
 
# Game_Panorama class and automatically changes plane properties.
 
#==============================================================================
 
class Sprite_Panorama < Plane
 
  
 
  #--------------------------------------------------------------------------
 
  # * Object initialization
 
  #      pano : panorama (Game_Panorama)
 
  #--------------------------------------------------------------------------
 
  def initialize(pano)
 
    super()
 
    @pano = pano
 
    @name = ""
 
    update
 
  end
 
  
 
  #--------------------------------------------------------------------------
 
  # * Frame update
 
  #--------------------------------------------------------------------------
 
 def update
 
    if @pano.name != @name
 
      @name = @pano.name
 
      if @name.empty?
 
        self.bitmap = nil
 
        self.visible = false
 
      else
 
        self.bitmap = Cache.parallax(@name)
 
        @width_x_8, @height_x_8 = self.bitmap.width * 8, self.bitmap.height * 8
 
        @scroll_x = @scroll_y = 0
 
        self.visible = true
 
      end
 
    end
 
    unless @name.empty?
 
      self.z = @pano.z
 
      self.opacity = @pano.opacity
 
      self.blend_type = @pano.blend_type
 
      self.zoom_x = @pano.zoom_x / 100.0
 
      self.zoom_y = @pano.zoom_y / 100.0
 
      self.color = @pano.color
 
      self.tone = @pano.tone
 
      @scroll_x = (@scroll_x + @pano.autoscroll_x_speed) % @width_x_8
 
      @scroll_y = (@scroll_y + @pano.autoscroll_y_speed) % @height_x_8
 
      self.ox = (@scroll_x + $game_map.display_x * @pano.move_x_speed) / 8
 
      self.oy = (@scroll_y + $game_map.display_y * @pano.move_y_speed)  / 8
 
    end
 
  end
 
   
 
end
 
 
 
#==============================================================================
 
# ** Spriteset_Map
 
#------------------------------------------------------------------------------
 
#  This class brings together map screen sprites, tilemaps, etc. It's used
 
# within the Scene_Map class.
 
#==============================================================================
 
class Spriteset_Map 
 
  
 
  #--------------------------------------------------------------------------
 
  # * Create parallax
 
  #--------------------------------------------------------------------------
 
  alias lufia_multipano_create_parallax create_parallax
 
  def create_parallax
 
    @sprites_panoramas = []
 
    for i in 0...MAX_PANORAMAS
 
      @sprites_panoramas.push(Sprite_Panorama.new($game_map.panoramas))
 
    end
 
    lufia_multipano_create_parallax
 
  end
 
  
 
  #--------------------------------------------------------------------------
 
  # * Dispose parallax
 
  #--------------------------------------------------------------------------
 
  alias lufia_multipano_dispose_parallax dispose_parallax
 
  def dispose_parallax
 
    lufia_multipano_dispose_parallax
 
    @sprites_panoramas.each { |i| i.dispose if i != nil }
 
  end
 
 
 
  #--------------------------------------------------------------------------
 
  # * Update parallax
 
  #--------------------------------------------------------------------------
 
  alias lufia_multipano_update_parallax update_parallax
 
  def update_parallax
 
    lufia_multipano_update_parallax
 
    for pano in @sprites_panoramas
 
      pano.update
 
    end
 
  end
 
 
 
end
 
 
 
#==============================================================================
 
# ** Game_Interpreter
 
#------------------------------------------------------------------------------
 
#  An interpreter for executing event commands. This class is used within the
 
# Game_Map, Game_Troop, and Game_Event classes.
 
#==============================================================================
 
class Game_Interpreter
 
  
 
  #--------------------------------------------------------------------------
 
  # * Show panorama
 
  #      id : panorama number
 
  #      name : filemane
 
  #      z : z coordinate
 
  #      opacity : sprite opacity
 
  #      blend_type : blend type
 
  #      zoom_x : x axis zoom
 
  #      zoom_y : y axis zoom
 
  #      autoscroll_x_speed : x axis autoscroll speed
 
  #      autoscroll_y_speed : y axis autoscroll speed
 
  #      move_x_speed : x axis scroll speed
 
  #      move_y_speed : y axis scroll speed
 
  #--------------------------------------------------------------------------
 
  def show_pano(id, name, z, opacity, blend_type, zoom_x, zoom_y, autoscroll_x_speed, 
 
    autoscroll_y_speed, move_x_speed, move_y_speed)
 
    $game_map.panoramas[id].show(name, z, opacity, blend_type, zoom_x, zoom_y, autoscroll_x_speed, 
 
      autoscroll_y_speed, move_x_speed, move_y_speed)
 
    return true
 
  end
 
  
 
  #--------------------------------------------------------------------------
 
  # * Erase panorama
 
  #      args : panorama numbers
 
  #--------------------------------------------------------------------------
 
  def hide_pano(*args)
 
    args.each { |id| $game_map.panoramas[id].hide }
 
    return true
 
  end
 
  
 
  #--------------------------------------------------------------------------
 
  # * Change panorama properties
 
  #      id : panorama number
 
  #      z : z coordinate
 
  #      zoom_x : x axis zoom
 
  #      zoom_y : y axis zoom
 
  #      opacity : sprite opacity
 
  #      blend_type : blend type
 
  #      autoscroll_x_speed : x axis autoscroll speed
 
  #      autoscroll_y_speed : y axis autoscroll speed
 
  #      move_x_speed : x axis scroll speed
 
  #      move_y_speed : y axis scroll speed
 
  #      duration : transition time
 
  #      wait_for_end : wait for end of transition?
 
  #--------------------------------------------------------------------------
 
  def change_pano_properties(id, z, opacity, blend_type, zoom_x, zoom_y,  autoscroll_x_speed, 
 
    autoscroll_y_speed, move_x_speed, move_y_speed, duration, wait_for_end)
 
    $game_map.panoramas[id].change_opacity(z, zoom_x, zoom_y, opacity, blend_type, autoscroll_x_speed, 
 
      autoscroll_y_speed, move_x_speed, move_y_speed, duration)
 
    @wait_count = duration if wait_for_end
 
    return true
 
  end
 
  
 
  #--------------------------------------------------------------------------
 
  # * Change panorama tone
 
  #      id : panorama number
 
  #      red : red value (-255 - 255)
 
  #      green : green value (-255 - 255)
 
  #      blue : blue value (-255 - 255)
 
  #      gray : grayscale value (-255 - 255)
 
  #      duration : transition time
 
  #      wait_for_end : wait for end of transition?
 
  #--------------------------------------------------------------------------
 
  def change_pano_tone(id, red, green, blue, gray, duration, wait_for_end)
 
    $game_map.panoramas[id].change_tone(Tone.new(red, green, blue, gray), duration)
 
    @wait_count = duration if wait_for_end
 
    return true
 
  end
 
  
 
  #--------------------------------------------------------------------------
 
  # * Change panorama color
 
  #      id : panorama number
 
  #      red : red value (0 - 255)
 
  #      green : green value (0 - 255)
 
  #      blue : blue value (0 - 255)
 
  #      alpha : alpha blending (0 - 255)
 
  #      duration : transition time
 
  #      wait_for_end : wait for end of transition?
 
  #--------------------------------------------------------------------------
 
  def change_pano_color(id, red, green, blue, alpha, duration, wait_for_end)
 
    $game_map.panoramas[id].change_color(Color.new(red, green, blue, alpha), duration)
 
    @wait_count = duration if wait_for_end
 
    return true
 
  end
 
  
 
end




Il affiche l'erreur suivante : Script panorama line 607: NoMethodError occured.
Undefined method `name' for #<Array:0x32cb7b0>

Je ne vois pas du tout ce qu'il faut faire pour corriger cette erreur, mes compétences en script étant très basiques.
Quelqu'un a-t-il la solution ?
Merci d'avance !


EDIT : Pas de réponse ? Allez, je tente un up quand même, pour voir.


Joke - posté le 16/11/2014 à 16:33:00 (5089 messages postés)

❤ 0

Bilouteux fou

J'ai la flemme de chercher l'erreur, en attendant j'utilisais exactement le même script pour mon projet, la version que j'ai fonctionne très bien, tu peux tester :

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
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
#==============================================================================
# (RMVX)                                                         ~ Multi-panorama ~
#                                                                             de Lufia
#                                                                               v 1.0
#==============================================================================
# Ce script permet d'afficher plusieurs panoramas en même temps durant le jeu.
# Nombre maximum de panoramas :
MAX_PANORAMAS = 10
#
# Afficher un panorama :
#    show_pano(id, name, z, opacity, blend_type, zoom_x, zoom_y, autoscroll_x_speed, 
#      autoscroll_y_speed, move_x_speed, move_y_speed)
#        id : numéro du panorama (de 0 à MAX_PANORAMAS - 1)
#        name : nom du fchier dans Graphics/Parallaxes
#        z : coordonnée en z, si ce nombre est grand, le panorama apparaît au-dessus d'autres
#             éléments de la carte
#        opacity : opacité (de 0 à 255, nombre décimaux autorisés)
#        blend_type : type de transparence (0 : normale, 1 : addition, 2 : soustraction)
#        zoom_x : zoom en x (taille normale : 100.0)
#        zoom_y : zoom en y (taille normale : 100.0)
#        autoscroll_x_speed : vitesse de défilement horizontal
#        autoscroll_y_speed : vitesse de défilement vertical
#        move_x_speed : scrolling parallaxe en x (même vitesse que la carte : 1/8)
#        move_y_speed : scrolling parallaxe en y (même vitesse que la carte : 1/8)
#
# Modifier un panorama :
#    change_pano_properties(id, z, opacity, blend_type, zoom_x, zoom_y,zoom_x, zoom_y, autoscroll_x_speed, 
#      autoscroll_y_speed, move_x_speed, move_y_speed, duration, wait_for_end)
#        duration : temps de transition (en frames)
#        wait_for_end : attendre la fin de la transition ? (oui : true / non : false)
#
# Modifier le ton d'un panorama :
#    change_pano_tone(id, red, green, blue, gray, duration, wait_for_end)
#        red : ajustement du rouge (de -255 à 255)
#        green : ajustement du vert (de -255 à 255)
#        blue : ajustement du bleu (de -255 à 255)
#        gray : ajustement du gris (de -255 à 255)
#
# Modifier la couleur d'un panorama :
#    change_pano_color(id, red, green, blue, alpha, duration, wait_for_end)
#       red : valeur du rouge (de 0 à 255)
#       green : valeur du vert (de 0 à 255)
#       blue : valeur du bleu (de 0 à 255)
#       alpha : alpha blending (de 0 à 255)
#
# Effacer un panorama :
#    hide_pano(args)
#       args : ids des panoramas (ex : hide_pano(1, 3, 12))
#
#==============================================================================
# Merci à Zeus81 pour ses précieux conseils.
# Enjoy !
#==============================================================================
 
 
#==============================================================================
# ** Game_Panorama
#------------------------------------------------------------------------------
#  This class handles panoramas. This class is used within the Game_Map class.
#==============================================================================
class Game_Panorama
 
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader      :id
  attr_accessor :name
  attr_accessor :z
  attr_accessor :opacity
  attr_accessor :blend_type
  attr_accessor :zoom_x
  attr_accessor :zoom_y
  attr_accessor :color
  attr_accessor :tone
  attr_accessor :autoscroll_x_speed
  attr_accessor :autoscroll_y_speed
  attr_accessor :move_x_speed
  attr_accessor :move_y_speed
  
  #--------------------------------------------------------------------------
  # * Object initialization
  #      id : panorama number
  #--------------------------------------------------------------------------
  def initialize(id)
    @id = id
    @name = ""
    @z = 0
    @opacity = 255.0
    @target_opacity = 255.0
    @blend_type = 0
    @zoom_x = 100.0
    @target_zoom_x = 100.0
    @zoom_y = 100.0
    @target_zoom_y = 100.0
    @color = Color.new(0, 0, 0, 0)
    @target_color = Color.new(0, 0, 0, 0)
    @tone = Tone.new(0, 0, 0, 0)
    @target_tone = Tone.new(0, 0, 0, 0)
    @autoscroll_x_speed = 0
    @autoscroll_y_speed = 0
    @move_x_speed = 0.0
    @move_y_speed = 0.0
    @duration = 0
    @tone_duration = 0
    @color_duration = 0
  end
  
  #--------------------------------------------------------------------------
  # * Show panorama
  #      name : filename
  #      z : z coordinate
  #      opacity : sprite opacity
  #      blend_type : blend type
  #      zoom_x : x axis zoom 
  #      zoom_y : y axis zoom
  #      autoscroll_x_speed : x axis autoscroll speed
  #      autoscroll_y_speed : y axis autoscroll speed
  #      move_x_speed : x axis scroll speed
  #      move_y_speed : y axis scroll speed
  #--------------------------------------------------------------------------
  def show(name, z, opacity, blend_type, zoom_x, zoom_y, autoscroll_x_speed, 
    autoscroll_y_speed, move_x_speed, move_y_speed)
    @name = name
    @z = z
    @opacity = opacity.to_f
    @target_opacity = opacity
    @blend_type = blend_type
    @zoom_x = zoom_x.to_f
    @target_zoom_x = @zoom_x
    @zoom_y = zoom_y.to_f
    @target_zoom_y = @zoom_y
    @color = Color.new(0, 0, 0, 0)
    @target_color = @color.clone
    @tone = Tone.new(0, 0, 0, 0)
    @target_tone = @tone.clone
    @autoscroll_x_speed = autoscroll_x_speed
    @autoscroll_y_speed = autoscroll_y_speed
    @move_x_speed = move_x_speed.to_f
    @move_y_speed = move_y_speed.to_f
  end
  
  #--------------------------------------------------------------------------
  # * Erase panorama
  #--------------------------------------------------------------------------
  def hide
    @name = ""
  end
  
  #--------------------------------------------------------------------------
  # * Change panorama properties
  #      z : z coordinate
  #      zoom_x : x axis zoom
  #      zoom_y : y axis zoom
  #      blend_type : blend type
  #      opacity : sprite opacity
  #      duration : transition time
  #--------------------------------------------------------------------------
  def change_opacity(z, zoom_x, zoom_y, opacity, blend_type, autoscroll_x_speed, 
    autoscroll_y_speed, move_x_speed, move_y_speed, duration)
    @z = z
    @blend_type = blend_type
    @autoscroll_x_speed = autoscroll_x_speed
    @autoscroll_y_speed = autoscroll_y_speed
    @move_x_speed = move_x_speed.to_f
    @move_y_speed = move_y_speed.to_f
    @target_zoom_x = zoom_x.to_f
    @target_zoom_y = zoom_y.to_f
    @target_opacity = opacity.to_f
    @duration = duration
    if duration == 0
      @zoom_x = @target_zoom_x
      @zoom_y = @target_zoom_y
      @opacity = @target_opacity
    end
  end
  
  #--------------------------------------------------------------------------
  # * Change panorama tone
  #      tone : new tone (Tone object)
  #      duration : transition time
  #--------------------------------------------------------------------------
  def change_tone(tone, duration)
    @target_tone = tone.clone
    @tone_duration = duration
    if duration == 0
      @tone = @target_tone.clone
    end
  end
  
  #--------------------------------------------------------------------------
  # * Change panorama color
  #      color : new color (Color object)
  #      duration : transition time
  #--------------------------------------------------------------------------
  def change_color(color, duration)
    @target_color = color.clone
    @color_duration = duration
    if duration == 0
      @color = @target_color.clone
    end
  end
  
  #--------------------------------------------------------------------------
  # * Frame update
  #--------------------------------------------------------------------------
  def update
    if @duration > 0
      d = @duration
      @zoom_x = (@zoom_x * (d-1) + @target_zoom_x) / d
      @zoom_y = (@zoom_y * (d-1) + @target_zoom_y) / d
      @opacity = (@opacity * (d-1) + @target_opacity) / d
      @duration -= 1
    end
    if @tone_duration > 0
      d = @tone_duration
      @tone.red = (@tone.red * (d-1) + @target_tone.red) / d
      @tone.green = (@tone.green * (d-1) + @target_tone.green) / d
      @tone.blue = (@tone.blue * (d-1) + @target_tone.blue) / d
      @tone.gray = (@tone.gray * (d-1) + @target_tone.gray) / d
      @tone_duration -= 1
    end
    if @color_duration > 0
      d = @color_duration
      @color.red = (@color.red * (d-1) + @target_color.red) / d
      @color.green = (@color.green * (d-1) + @target_color.green) / d
      @color.blue = (@color.blue * (d-1) + @target_color.blue) / d
      @color.alpha = (@color.alpha * (d-1) + @target_color.alpha) / d
      @color_duration -= 1
    end
  end
  
end
 
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
#  This class handles maps. It includes scrolling and passage determination
#  functions. The instance of this class is referenced by $game_map.
#==============================================================================
class Game_Map 
 
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :panoramas
  
  #--------------------------------------------------------------------------
  # * Object initialization
  #--------------------------------------------------------------------------
  alias old_initialize initialize
  def initialize
    @panoramas = []
    for i in 0...MAX_PANORAMAS
      @panoramas.push(Game_Panorama.new(i))
    end
    old_initialize
  end
  
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias old_update update
  def update
    @panoramas.each { |i| i.update }
    old_update
  end
  
end
 
#==============================================================================
# ** Sprite_Panorama
#------------------------------------------------------------------------------
#  This plane is used to display panoramas. It observes a instance of the
# Game_Panorama class and automatically changes plane properties.
#==============================================================================
class Sprite_Panorama < Plane
  
  #--------------------------------------------------------------------------
  # * Object initialization
  #      pano : panorama (Game_Panorama)
  #--------------------------------------------------------------------------
  def initialize(pano)
    super()
    @pano = pano
    @name = ""
    update
  end
  
  #--------------------------------------------------------------------------
  # * Frame update
  #--------------------------------------------------------------------------
 def update
    if @pano.name != @name
      @name = @pano.name
      if @name.empty?
        self.bitmap = nil
        self.visible = false
      else
        self.bitmap = Cache.parallax(@name)
        @width_x_8, @height_x_8 = self.bitmap.width * 8, self.bitmap.height * 8
        @scroll_x = @scroll_y = 0
        self.visible = true
      end
    end
    unless @name.empty?
      self.z = @pano.z
      self.opacity = @pano.opacity
      self.blend_type = @pano.blend_type
      self.zoom_x = @pano.zoom_x / 100.0
      self.zoom_y = @pano.zoom_y / 100.0
      self.color = @pano.color
      self.tone = @pano.tone
      @scroll_x = (@scroll_x + @pano.autoscroll_x_speed) % @width_x_8
      @scroll_y = (@scroll_y + @pano.autoscroll_y_speed) % @height_x_8
      self.ox = (@scroll_x + $game_map.display_x * @pano.move_x_speed) / 8
      self.oy = (@scroll_y + $game_map.display_y * @pano.move_y_speed)  / 8
    end
  end
   
end
 
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
#  This class brings together map screen sprites, tilemaps, etc. It's used
# within the Scene_Map class.
#==============================================================================
class Spriteset_Map 
  
  #--------------------------------------------------------------------------
  # * Create parallax
  #--------------------------------------------------------------------------
  alias old_create_parallax create_parallax
  def create_parallax
    old_create_parallax
    @sprites_panoramas = []
    for i in 0...MAX_PANORAMAS
      @sprites_panoramas.push(Sprite_Panorama.new($game_map.panoramas[i]))
    end
  end
  
  #--------------------------------------------------------------------------
  # * Dispose parallax
  #--------------------------------------------------------------------------
  alias old_dispose_parallax dispose_parallax
  def dispose_parallax
    old_dispose_parallax
    @sprites_panoramas.each { |i| i.dispose if i != nil }
  end
 
  #--------------------------------------------------------------------------
  # * Update parallax
  #--------------------------------------------------------------------------
  alias old_update_parallax update_parallax
  def update_parallax
    old_update_parallax
    for pano in @sprites_panoramas
      pano.update
    end
  end
 
end
 
#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
#  An interpreter for executing event commands. This class is used within the
# Game_Map, Game_Troop, and Game_Event classes.
#==============================================================================
class Game_Interpreter
  
  #--------------------------------------------------------------------------
  # * Show panorama
  #      id : panorama number
  #      name : filemane
  #      z : z coordinate
  #      opacity : sprite opacity
  #      blend_type : blend type
  #      zoom_x : x axis zoom
  #      zoom_y : y axis zoom
  #      autoscroll_x_speed : x axis autoscroll speed
  #      autoscroll_y_speed : y axis autoscroll speed
  #      move_x_speed : x axis scroll speed
  #      move_y_speed : y axis scroll speed
  #--------------------------------------------------------------------------
  def show_pano(id, name, z, opacity, blend_type, zoom_x, zoom_y, autoscroll_x_speed, 
    autoscroll_y_speed, move_x_speed, move_y_speed)
    $game_map.panoramas[id].show(name, z, opacity, blend_type, zoom_x, zoom_y, autoscroll_x_speed, 
      autoscroll_y_speed, move_x_speed, move_y_speed)
    return true
  end
  
  #--------------------------------------------------------------------------
  # * Erase panorama
  #      args : panorama numbers
  #--------------------------------------------------------------------------
  def hide_pano(*args)
    args.each { |id| $game_map.panoramas[id].hide  unless $game_map.panoramas[id].nil? }
    return true
  end
  
  #--------------------------------------------------------------------------
  # * Change panorama properties
  #      id : panorama number
  #      z : z coordinate
  #      zoom_x : x axis zoom
  #      zoom_y : y axis zoom
  #      opacity : sprite opacity
  #      blend_type : blend type
  #      autoscroll_x_speed : x axis autoscroll speed
  #      autoscroll_y_speed : y axis autoscroll speed
  #      move_x_speed : x axis scroll speed
  #      move_y_speed : y axis scroll speed
  #      duration : transition time
  #      wait_for_end : wait for end of transition?
  #--------------------------------------------------------------------------
  def change_pano_properties(id, z, opacity, blend_type, zoom_x, zoom_y, autoscroll_x_speed, 
    autoscroll_y_speed, move_x_speed, move_y_speed, duration, wait_for_end)
    $game_map.panoramas[id].change_opacity(z, zoom_x, zoom_y, opacity, blend_type, autoscroll_x_speed, 
      autoscroll_y_speed, move_x_speed, move_y_speed, duration)
    @wait_count = duration if wait_for_end
    return true
  end
  
  #--------------------------------------------------------------------------
  # * Change panorama tone
  #      id : panorama number
  #      red : red value (-255 - 255)
  #      green : green value (-255 - 255)
  #      blue : blue value (-255 - 255)
  #      gray : grayscale value (-255 - 255)
  #      duration : transition time
  #      wait_for_end : wait for end of transition?
  #--------------------------------------------------------------------------
  def change_pano_tone(id, red, green, blue, gray, duration, wait_for_end)
    $game_map.panoramas[id].change_tone(Tone.new(red, green, blue, gray), duration)
    @wait_count = duration if wait_for_end
    return true
  end
  
  #--------------------------------------------------------------------------
  # * Change panorama color
  #      id : panorama number
  #      red : red value (0 - 255)
  #      green : green value (0 - 255)
  #      blue : blue value (0 - 255)
  #      alpha : alpha blending (0 - 255)
  #      duration : transition time
  #      wait_for_end : wait for end of transition?
  #--------------------------------------------------------------------------
  def change_pano_color(id, red, green, blue, alpha, duration, wait_for_end)
    $game_map.panoramas[id].change_color(Color.new(red, green, blue, alpha), duration)
    @wait_count = duration if wait_for_end
    return true
  end
  
end



biloumaster.fr, mon joli site ouèb tout bô tout frai !


Nukidoudi - posté le 16/11/2014 à 17:59:41 (733 messages postés) -

❤ 0

yo

Oui, en fait c'est parce que la balise code de Oniro merdait à cette époque :)

https://xvw.lol


LittleGamer - posté le 16/11/2014 à 19:27:01 (414 messages postés)

❤ 0

Bon j'ai pas trop le temps de voir en détails ce soir, mais déjà le jeu ne crash pas ! Ca devrait le faire donc.
Merci Joke :)

Nukikoudi : C'est donc pour ça que ça ne marche pas x) C'est original comme problème de script...

Index du forum > Entraide > [RESOLU] [VX] Problème script de panorama

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