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: Dread Mac Farlane - episode 7 / Jeux: Ce qui vit Dessous / News: Quoi de neuf sur Oniromancie (...) / Sorties: Dread Mac Farlane - episode 6 / News: Quoi de neuf sur Oniromancie (...) / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

279 connectés actuellement

29350744 visiteurs
depuis l'ouverture

5968 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Leo-Games

Eclipso

RPG Maker - La Communauté

Tous nos partenaires

Devenir
partenaire



Lazymap

Pour mapper automatiquement des murs.

Script pour RPG Maker XP
Ecrit par Krosk
Publié par Krosk (lui envoyer un message privé)
Signaler un script cassé

❤ 0

Auteur : Krosk
Logiciel : RPG Maker XP
Nombre de scripts : 1

Le mapping de grandes cartes sous RMXP est long et pénible. C'est particulièrement vrai pour les grottes, à cause des murs et des parois qu'il faut placer un par un en suivant la forme du sol. La tache n'est pas difficile en soi, mais juste longue.

Fonctionnalités
Lazymap permet d'accélérer le processus du mapping des cartes:
- grandes
- de grottes
- d'intérieurs
- d'extérieurs
en construisant pour vous parois, facades, murs autour d'une zone que vous définissez.

Il est utile lors des premières ébauches d'une carte, quand vous décidez de construire par exemple un chemin dans une grotte. Vous tracez le chemin, Lazymap complète avec les parois.

Vous pouvez aussi utiliser ce script dans plusieurs étapes de la création de votre carte. Par exemple, si vous voulez créer un chemin montagneux, vous tracez les sentiers en bas de la carte, vous laissez Lazymap faire les falaises, et vous continuez de tracer les sentiers placés plus haut, et ainsi de suite.

Une fois les grandes lignes de la carte accomplies grâce à Lazymap, vous pouvez continuer le mapping et ajouter des éléments, faire de la finition, etc...

Screens

Spoiler (cliquez pour afficher)




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
#  Lazymap v1.0 - par Krosk
#    Le mappeur paresseux
# --------------------------------------------------------
#  Lazymap est un script qui vous permet de mapper 
#  automatiquement certains éléments de votre carte,
#  typiquement toutes parois et murs qui peuvent
#  entourer une zone.
#
#  Lazymap ne crèe pas de cartes. Il ne fait qu'ajouter
#  des éléments à une carte existante.
#
#  L'objectif de Lazymap est de gagner un peu de temps
#  lors du mapping.
#
#
#     Installation
#
#  1/ Collez ce script quelque part avant Main, mais après les
#     scripts par défaut de RMXP.
#
#  2/ Activez LAZYMAP_ENABLED en écrivant LAZYMAP_ENABLED = true
#     en tête de script (juste en bas)
#
#
#
#     Instructions
# 
#  1/ Dessinez sur une carte vide et vierge, le sol qui servira de
#     support. Les murs seront ajoutés autour de ce sol.
#
#  2/ Dessinez sur une nouvelle carte, le modèle de mur à construire
#     autour de ce sol.
#     La carte modèle doit avoir le même tileset que la carte à construire.
#     Le modèle à suivre est le suivant :
#       - Couche basse
#           Utilisez l'outil Ellipse. Tracez avec le même tile 
#           que celui utilisé pour dessiner le sol, un cercle
#           de taille 5x5, placé entre (x=2, y=4) et (x=6, y=8).
#       - Couche moyenne
#           Placez vos murs autour de cette zone, sans l'empiéter.
#           Pour être sur de comment faire, référez vous
#           à l'image d'exemple qui accompagne ce script.
#
#  3/ Lancez votre projet en mode DEBUG, en maintenant la touche F7.
#     Une interface devrait apparaître.
#
#  4/ Sélectionnez votre carte, avec PG.UP et PG.DOWN, 
#     appuyez sur ESPACE.
#
#  5/ Sélectionnez votre modèle, avec PG.UP et PG.DOWN, 
#     appuyez sur ESPACE. Vous ne pourrez valider votre choix
#     que si le tileset est le même.
#     Attention: LAZYMAP ne vérifie pas que votre modèle est juste.
#
#  6/ Vous aurez un aperçu de la carte après construction des murs.
#     Validez pour sauvegarder vos modifications.
#
#  7/ Pour observer les changements, n'oubliez pas de quitter 
#     sans sauvegarder votre projet sous RMXP, et de le réouvrir.
#
#
#
#     Remarques
#
#  1/ Ce script n'est pas un mappeur miraculeux. 
#     Certaines dispositions du sol sont non mappable automatiquement,
#     et le script fera potentiellement des erreurs de mapping.
#     Vous devez vérifier et corriger par derrière.
#     Le comportement est particulièrement erratique près des bords 
#     de la carte, ou quand 2 zones sont proches.
#
#  2/ Les murs sont dessinés par défaut sur la couche basse, sauf
#     les éléments qui surplombent le sol, dessinés sur la couche moyenne.
#     Vous pouvez déplacer tous les éléments sur la couche moyenne
#     en changeant:
#       LAZYLAYER = 1
#     ou sur la couche haute avec:
#       LAZYLAYER = 2
#
#  3/ Quand Lazymap lit votre modèle de mur et trouve un tile vide sur un des
#     éléments qui compose votre mur, il considèrera ce tile comme
#     transparent, et ne modifiera pas la carte lorsqu'il voudra l'utiliser.
#
#  4/ La version actuelle de Lazymap ne prend pas en compte tous les
#     éléments de votre modèle de mur, et donc le résultat peut être
#     moins élaboré que votre modèle.
#
#  5/ Pensez à mettre LAZYMAP_ENABLED = false quand vous ne l'utilisez plus,
#     vos données pourraient être accessibles de l'extérieur si vous distribuez ce projet
#     votre projet avec ce script activé.
#
# --------------------------------------------------------
#
#   ATTENTION : Ce script modifie vos données de cartes 
#     de manière irréversible. Pensez à faire une sauvegarde 
#     de vos cartes avant d'utiliser ce script.
#
# --------------------------------------------------------
 
module LAZYMAP
  
  # ---------------------------
  #  Configuration
  # ---------------------------
  LAZYMAP_ENABLED = true
  LAZYLAYER = 0
  
  
  # ---------------------------
  #  Début de script
  # ---------------------------
  Input.update    
  if $DEBUG and LAZYMAP_ENABLED and Input.press?(Input::F7)
    
    $fontface = "Arial"
    $fontsize = 22
    $data_system = load_data("Data/System.rxdata")
    $game_system = Game_System.new
    
    class LM_Window_Key < Window_Command
      def initialize(commands = [])
        super(240, commands)
        self.visible = true
        self.active = false
        self.index = -1
        self.x = 640 - 240
      end
      
      def set(phase, enable = true)
        self.dispose
        case phase
        when 0
          commands = ["LAZYMAP par Krosk", "*** Carte ***",
            "←↑→↓ Déplacer", 
            "PG.UP Précédente",
            "PG.DOWN Suivante", 
            "ESPACE Sélectionner",
            "ECHAP Quitter"]
        when 1  
          commands = ["LAZYMAP par Krosk", "*** Modèle ***",
            "←↑→↓ Déplacer",
            "PG.UP Précédente",
            "PG.DOWN Suivante",
            "ESCAPE Retour"]
          if enable
            commands.insert(5, "ESPACE Sélectionner")
          end
        when 2
          commands = ["LAZYMAP par Krosk", "*** Aperçu ***", 
          "←↑→↓ Déplacer", "ESPACE Suivante", 
          "ECHAP Retour"]
        when 3
          commands = ["LAZYMAP par Krosk", "*** Appliquer ***",
            "←↑→↓ Déplacer", "ESPACE Ecraser", "ECHAP Annuler"]
        when 4
          commands = ["LAZYMAP par Krosk"]
        end
          
        
        return LM_Window_Key.new(commands)
      end
    end
    
    class LM_Window_Info < Window_Command
      def initialize(commands = [])
        super(640, commands)
        self.visible = true
        self.active = false
        self.index = -1
        self.y = 480 - self.height
      end
      
      def set(phase, values = [])
        self.dispose
        case phase
        when 0, 1
          commands = ["Nom de Carte:    #{values[0]}", 
            "ID de Carte:    #{values[1]}  *****  Taille de Carte:    #{values[2]}x#{values[3]}"]
        when 2
          commands = ["Nom de Carte:    #{values[0]}  ***  APERCU", 
            "ID de Carte:    #{values[1]}  *****  Taille de Carte:    #{values[2]}x#{values[3]}"]
        when 3
          commands = ["ATTENTION : LAZYMAP va écraser votre carte. Êtes vous sur?"]
        when 4
          commands = ["Map sauvegardée. Fermez votre projet sous RMXP pour appliquer les changements.", "Appuyez ESPACE pour continuer."]
        end
        
        return LM_Window_Info.new(commands)
      end
    end
 
    class LM_Interface
      
      def initialize
        @data_tilesets       = load_data("Data/Tilesets.rxdata")
        @map_infos           = load_data("Data/MapInfos.rxdata")
        
        @main_viewport = Viewport.new(0, 0, 640, 480)
        @main_tilemap = Tilemap.new(@main_viewport)
        
        @key_window = LM_Window_Key.new
        @info_window = LM_Window_Info.new
        
        @phase = 0
        
        @current_map = @map_infos.keys.sort.first
        @current_model = @map_infos.keys.sort.first
        
        @current_tileset_id = ""
        
        @key_window = @key_window.set(0)
        @info_window = @info_window.set(0)
        
        load_map(@current_map)
        
        loop do
          Graphics.update
          Input.update
          update
        end
        
        @key_window.dispose
        @info_window.dispose
        @main_tilemap.dispose
        @main_viewport.dispose
      end
      
      def next_map(map_id)
        index = @map_infos.keys.sort.index(map_id)
        if index == @map_infos.keys.size - 1
          return @map_infos.keys.sort.first
        end
        return @map_infos.keys.sort[index + 1]
      end
      
      def previous_map(map_id)
        index = @map_infos.keys.sort.index(map_id)
        if index == 0
          return @map_infos.keys.sort.last
        end
        return @map_infos.keys.sort[index - 1]
      end
      
      def update
        @main_tilemap.update
        @main_viewport.update
        @key_window.update
        @info_window.update
        navigate
        case @phase
        when 0
          update_phase_0
        when 1
          update_phase_1
        when 2
          update_phase_2
        when 3
          update_phase_3
        when 4
          update_phase_4
        end        
      end
      
      def navigate
        if Input.press?(Input::UP)
          @main_tilemap.oy -= 20
        end
        if Input.press?(Input::DOWN)
          @main_tilemap.oy += 20
        end
        if Input.press?(Input::LEFT)
          @main_tilemap.ox -= 20
        end
        if Input.press?(Input::RIGHT)
          @main_tilemap.ox += 20
        end
      end
      
      def update_phase_0
        if Input.trigger?(Input::B)
          exit
        end
        if Input.trigger?(Input::C)
          @phase = 1
          @key_window = @key_window.set(@phase, compare_tileset)
          load_map(@current_model)
        end
        if Input.repeat?(Input::R)
          @current_map = next_map(@current_map)
          load_map(@current_map)
        end
        if Input.repeat?(Input::L)
          @current_map = previous_map(@current_map)
          load_map(@current_map)
        end
      end
      
      def update_phase_1
        if Input.trigger?(Input::B)
          @phase = 0
          @key_window = @key_window.set(@phase)
          load_map(@current_map)
        end
        if Input.trigger?(Input::C) and compare_tileset
          @phase = 2
          @key_window = @key_window.set(@phase)
          read_model
          preview_changes
        end
        if Input.repeat?(Input::R)
          @current_model = next_map(@current_model)
          @key_window = @key_window.set(@phase, compare_tileset)
          load_map(@current_model)
        end
        if Input.repeat?(Input::L)
          @current_model = previous_map(@current_model)
          @key_window = @key_window.set(@phase, compare_tileset)
          load_map(@current_model)
        end
      end
      
      def update_phase_2
        if Input.trigger?(Input::B)
          @phase = 1
          @key_window = @key_window.set(@phase, compare_tileset)
          load_map(@current_model)
        end
        if Input.trigger?(Input::C)
          @phase = 3
          @key_window = @key_window.set(@phase)
          @info_window = @info_window.set(@phase)
        end
      end
      
      def update_phase_3
        if Input.trigger?(Input::B)
          @phase = 2
          @key_window = @key_window.set(@phase)
          preview_changes
        end
        if Input.trigger?(Input::C)
          apply_change
          @phase = 4
          @key_window = @key_window.set(@phase)
          load_map(@current_map)
        end
      end
      
      def update_phase_4
        if Input.trigger?(Input::C)
          @phase = 0
          @key_window = @key_window.set(@phase)
          load_map(@current_map)
        end
      end
      
      def load_map(current_map_data)
        if current_map_data.type == Fixnum
          current_map_data = load_data(sprintf("Data/Map%03d.rxdata", current_map_data))
        end
        
        tileset = @data_tilesets[current_map_data.tileset_id]
        @main_tilemap.tileset = RPG::Cache.tileset(tileset.tileset_name)
        for i in 0..6
          autotile_name = tileset.autotile_names[i]
          @main_tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
        end
        @main_tilemap.priorities = tileset.priorities
        @main_tilemap.map_data = current_map_data.data 
        
        @main_tilemap.ox = 0
        @main_tilemap.oy = 0
        
        map_id = @phase == 1 ? @current_model : @current_map
        @info_window = @info_window.set(@phase, 
          [@map_infos[map_id].name, 
            map_id, 
            current_map_data.width, 
            current_map_data.height])
      end
 
      def compare_tileset
        map = load_data(sprintf("Data/Map%03d.rxdata", @current_map))
        model = load_data(sprintf("Data/Map%03d.rxdata", @current_model))
        return map.tileset_id == model.tileset_id
      end
      
      
      def read_model
        map_data = load_data(sprintf("Data/Map%03d.rxdata", @current_model))
        
        @@PAT00 = map_data.data[0,0,0] # Blanc
        
        @@PAT10 = map_data.data[4,6,0] # Terre
        
        @@PAT11 = map_data.data[4,3,1] # Mur haut
        @@PAT12 = map_data.data[4,2,1] # Mur haut
        @@PAT13 = map_data.data[4,1,1] # Mur haut
        
        @@PAT21 = map_data.data[2,4,1] # Mur haut gauche
        @@PAT22 = map_data.data[2,3,1] # Mur haut gauche
        @@PAT23 = map_data.data[2,2,1] # Mur haut gauche
        
        @@PAT31 = map_data.data[6,4,1] # Mur haut droit
        @@PAT32 = map_data.data[6,3,1] # Mur haut droit
        @@PAT33 = map_data.data[6,2,1] # Mur haut droit
        
        @@PAT41 = map_data.data[1,5,1] # Mur gauche
        @@PAT51 = map_data.data[7,5,1] # Mur droit
        
        @@PAT81 = map_data.data[4,8,1] # Mur bas
        @@PAT61 = map_data.data[2,7,1] # Mur bas gauche
        @@PAT71 = map_data.data[6,7,1] # Mur bas droit
        
        @@PAT91 = map_data.data[6,8,1] # Mur coin bas droite
        @@PAT92 = map_data.data[2,8,1] # Mur coin bas gauche
        @@PAT93 = map_data.data[6,1,1] # Mur coin haut droite
        @@PAT94 = map_data.data[2,1,1] # Mur coin haut gauche
      end
      
      def preview_changes
        map_data = load_data(sprintf("Data/Map%03d.rxdata", @current_map))
        current_map_data = load_data(sprintf("Data/Map%03d.rxdata", @current_map))
        
        for x in 0...map_data.data.xsize
          for y in 0...map_data.data.ysize
            
            # Trou vertical
            #
            #   XOX   XxX
            if  map_data.data[x,y,0] == @@PAT10 and
                map_data.data[x+1,y,0] == @@PAT00 and
                map_data.data[x+2,y,0] == @@PAT10
              map_data.data[x+1,y,0] = @@PAT10
            end
            
            # Trou horizontal 1
            #
            #   X     X
            #   0     x
            #   X     X
            if  map_data.data[x,y,0] == @@PAT10 and
                map_data.data[x,y+1,0] == @@PAT00 and
                map_data.data[x,y+2,0] == @@PAT10
              map_data.data[x,y+1,0] = @@PAT10
            end
            
            # Trou horizontal 2
            #
            #   X     X
            #   0     x
            #   0     x
            #   X     X
            if  map_data.data[x,y,0] == @@PAT10 and
                map_data.data[x,y+1,0] == @@PAT00 and
                map_data.data[x,y+2,0] == @@PAT00 and
                map_data.data[x,y+3,0] == @@PAT10
              map_data.data[x,y+1,0] = @@PAT10
              map_data.data[x,y+2,0] = @@PAT10
            end
            
            # Mur horizontal haut
            #
            #   X        W
            #   X        W
            #  XXX       W
            #   0        O
            if  map_data.data[x-1,y,0] == @@PAT10 and 
                map_data.data[x-1,y-1,0] == @@PAT00 and
                map_data.data[x-2,y-1,0] == @@PAT00 and
                map_data.data[x,y-1,0] == @@PAT00 and
                map_data.data[x-1,y-2,0] == @@PAT00 and
                map_data.data[x-1,y-3,0] == @@PAT00
                
              current_map_data.data[x-1,y-1,LAZYLAYER] = @@PAT11 if @@PAT11 != 0
              current_map_data.data[x-1,y-2,LAZYLAYER] = @@PAT12 if @@PAT12 != 0
              current_map_data.data[x-1,y-3,LAZYLAYER] = @@PAT13 if @@PAT13 != 0
            end
            
            # Mur horizontal bas
            #
            #   O       W
            #  XXX
            #
            if  map_data.data[x-1,y-1,0] == @@PAT10 and 
                map_data.data[x,y,0] == @@PAT00 and
                map_data.data[x-1,y,0] == @@PAT00 and
                map_data.data[x-2,y,0] == @@PAT00
              
              current_map_data.data[x-1,y-1,[LAZYLAYER,1].max] = @@PAT81 if @@PAT81 != 0
            end
    
            # Mur coin haut gauche
            #
            #   X     W
            #   X     W
            #   XO    WO
            #   OO    OO
            #
            if  map_data.data[x-1,y,0] == @@PAT10 and 
                #map_data.data[x,y,0] == @@PAT10 and
                map_data.data[x,y-1,0] == @@PAT10 and
                map_data.data[x-1,y-1,0] == @@PAT00 and
                map_data.data[x-1,y-2,0] == @@PAT00 and
                map_data.data[x-1,y-3,0] == @@PAT00
                
              current_map_data.data[x-1,y-1,LAZYLAYER] = @@PAT21 if @@PAT21 != 0
              current_map_data.data[x-1,y-2,LAZYLAYER] = @@PAT22 if @@PAT22 != 0
              current_map_data.data[x-1,y-3,LAZYLAYER] = @@PAT23 if @@PAT23 != 0
            end
            
            # Mur coin haut droit
            #
            #   X     W
            #   X     W
            #  OX    OW
            #  OO    OO
            #
            if  map_data.data[x,y,0] == @@PAT10 and 
                #map_data.data[x-1,y,0] == @@PAT10 and
                map_data.data[x-1,y-1,0] == @@PAT10 and
                map_data.data[x,y-1,0] == @@PAT00 and
                map_data.data[x,y-2,0] == @@PAT00 and
                map_data.data[x,y-3,0] == @@PAT00
                
              current_map_data.data[x,y-1,LAZYLAYER] = @@PAT31 if @@PAT31 != 0
              current_map_data.data[x,y-2,LAZYLAYER] = @@PAT32 if @@PAT32 != 0
              current_map_data.data[x,y-3,LAZYLAYER] = @@PAT33 if @@PAT33 != 0
            end
            
            # Mur coin haut droit - coin
            #
            #   X     W
            #         W
            #  XX    XX
            #  OX    OX
            #
            if  map_data.data[x-1,y,0] == @@PAT10 and 
                map_data.data[x,y,0] == @@PAT00 and
                map_data.data[x-1,y-1,0] == @@PAT00 and
                map_data.data[x,y-1,0] == @@PAT00 and
                map_data.data[x,y-3,0] == @@PAT00
                
              current_map_data.data[x,y-3,LAZYLAYER] = @@PAT93 if @@PAT93 != 0
              current_map_data.data[x,y-2,LAZYLAYER] = @@PAT51 if @@PAT51 != 0
            end
            
            # Mur coin haut gauche - coin
            #
            #   X     W
            #         W
            #   XX    XX
            #   XO    XO
            #
            if  map_data.data[x,y,0] == @@PAT10 and 
                map_data.data[x-1,y,0] == @@PAT00 and
                map_data.data[x,y-1,0] == @@PAT00 and
                map_data.data[x-1,y-1,0] == @@PAT00 and
                map_data.data[x-1,y-3,0] == @@PAT00
                
              current_map_data.data[x-1,y-3,LAZYLAYER] = @@PAT94 if @@PAT94 != 0
              current_map_data.data[x-1,y-2,LAZYLAYER] = @@PAT41 if @@PAT41 != 0
            end
            
    
            # Mur plat droite
            #
            #    X     W
            #   OX    OX
            #   OX    OX
            #    X     X 
            
            #    X     W
            #   OX    OW
            #   OX    OX
            #   XX    XX 
            if  map_data.data[x-1,y-1,0] == @@PAT10 and 
                map_data.data[x-1,y-2,0] == @@PAT10 and
                map_data.data[x,y,0] == @@PAT00 and
                map_data.data[x,y-1,0] == @@PAT00 and
                map_data.data[x,y-2,0] == @@PAT00 and
                map_data.data[x,y-3,0] == @@PAT00
                
              current_map_data.data[x,y-3,LAZYLAYER] = @@PAT51 if @@PAT51 != 0
              
              if  map_data.data[x-1,y,0] == @@PAT00
                current_map_data.data[x,y-2,LAZYLAYER] = @@PAT51 if @@PAT51 != 0
              end
            end
            
            # Mur plat gauche
            #
            #    X     W
            #    XO    XO
            #    XO    XO
            #    X     X
            #
            #    X     W
            #    XO    WO
            #    XO    XO
            #    XX    XX
            if  map_data.data[x,y-1,0] == @@PAT10 and 
                map_data.data[x,y-2,0] == @@PAT10 and
                map_data.data[x-1,y,0] == @@PAT00 and
                map_data.data[x-1,y-1,0] == @@PAT00 and
                map_data.data[x-1,y-2,0] == @@PAT00 and
                map_data.data[x-1,y-3,0] == @@PAT00
                
              current_map_data.data[x-1,y-3,LAZYLAYER] = @@PAT41 if @@PAT41 != 0
              if  map_data.data[x,y,0] == @@PAT00
                current_map_data.data[x-1,y-2,LAZYLAYER] = @@PAT41 if @@PAT41 != 0
              end
            end
            
            
            # Mur bas coin droite
            #
            #   OO    OW
            #   OX    OX
            if  map_data.data[x-1,y,0] == @@PAT10 and 
                #map_data.data[x-1,y-1,0] == @@PAT10 and
                map_data.data[x,y-1,0] == @@PAT10 and
                map_data.data[x,y,0] == @@PAT00
                
              current_map_data.data[x,y-1,[LAZYLAYER,1].max] = @@PAT71 if @@PAT71 != 0
            end
            
            
            # Mur bas coin gauche
            #
            #   OO    WO
            #   XO    XO
            if  map_data.data[x,y,0] == @@PAT10 and 
                #map_data.data[x,y-1,0] == @@PAT10 and
                map_data.data[x-1,y-1,0] == @@PAT10 and
                map_data.data[x-1,y,0] == @@PAT00
                
              current_map_data.data[x-1,y-1,[LAZYLAYER,1].max] = @@PAT61 if @@PAT61 != 0
            end
            
            
            # Mur bas gauche - coin
            #
            #   XO    WO
            #   XX    XX
            #
            #   X     W
            #   XO    WO
            #   XX    XX
            if  map_data.data[x,y-1,0] == @@PAT10 and
                map_data.data[x-1,y-1,0] == @@PAT00 and
                map_data.data[x-1,y,0] == @@PAT00 and
                map_data.data[x,y,0] == @@PAT00
              
              current_map_data.data[x-1,y-1,LAZYLAYER] = @@PAT92 if @@PAT92 != 0
              if  map_data.data[x-1,y-2,0] == @@PAT00
                current_map_data.data[x-1,y-2,LAZYLAYER] = @@PAT41 if @@PAT41 != 0
              end
            end
            
            # Mur bas droite - coin
            #
            #   OX    OW
            #   XX    XX
            
            #    X     W
            #   OX    OW
            #   XX    XX
            if  map_data.data[x-1,y-1,0] == @@PAT10 and
                map_data.data[x,y-1,0] == @@PAT00 and
                map_data.data[x,y,0] == @@PAT00 and
                map_data.data[x-1,y,0] == @@PAT00
              
              current_map_data.data[x,y-1,LAZYLAYER] = @@PAT91 if @@PAT91 != 0
              if  map_data.data[x,y-2,0] == @@PAT00
                current_map_data.data[x,y-2,LAZYLAYER] = @@PAT51 if @@PAT51 != 0
              end
            end
            
          end
        end
        load_map(current_map_data)
      end
      
      
      def apply_change
        data = @main_tilemap.map_data
        map = load_data(sprintf("Data/Map%03d.rxdata", @current_map))
        map.data = data
        file = File.open(sprintf("Data/Map%03d.rxdata", @current_map), "w")
        Marshal.dump(map, file)
        file.close
      end
      
    end
    
    LM_Interface.new
    
  end
end



La carte modèle doit être construite suivant cet exemple :
image

Les instructions sont en tête de script.



Aucun commentaire n'a été posté pour le moment.

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