Day.png);">
Apprendre


Vous êtes
nouveau sur
Oniromancie?

Visite guidée
du site


Découvrir
RPG Maker


Apprendre
RPG Maker

Tutoriels
Guides
Making-of

Dans le
Forum

Section Entraide

Jeux: puie z / Jeux: Citymaime - Chapitre 1 / Jeux: Mer, îles et fous / News: Du neuf dans le making / News: Muma|Rope est disponible en (...) / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

649 connectés actuellement

30729217 visiteurs
depuis l'ouverture

2834 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Zarok

Alex d'Or

Hellsoft

RPG Fusion

Kingdom Ultimate

Tous nos partenaires

Devenir
partenaire



First Person RPG

Crée une vue de type FPS (First Person Shooter) à partir d'images

Script pour RPG Maker XP
Ecrit par BigKevSexyMan & David Ceel
Publié par julienhora (lui envoyer un message privé)
Signaler un script cassé

❤ 0

Auteur : BigKevSexyMan & David Ceel
Logiciel : RPG Maker XP
Nombre de scripts : 2

Fonctionnalités
- crée une vue de type FPS (First Person Shooter) à partir d'images

Ce script comprend différents bugs d'affichages (on peut voir à travers certains blocs, la vue n'est pas en perspective 3D et il y a un problème d'alignement des sprites par rapport à la position spécifiée). ~ DerVVulfman. Source : https://save-point.org/thread-5082-post-37978.html#pid37978)

image

Installation
A placer dans l'ordre au-dessus de Main.

Utilisation
Vous pouvez éditer le nom des terrains utilisés. Et c'est tout.
Vous pouvez utiliser 18 images pour créer une perspective, dont l'id est placé comme suit dans le champ de vision du joueur (P) :

Citation:

12 13 14 15 16 17 18
7 8 9 10 11
4 5 6
1 2 3
P



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
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
# ----------------------------------------------------------------
# Script Name: First Person RPG
# Created by: BigKevSexyMan
# Finished by: 7/28/06
# Adapted by: David Ceel
# ----------------------------------------------------------------
 
class First_Person
  
  attr_accessor :transition
  # Picture Positions
  # 12 13 14 15 16 17 18
  #          7 8 9  10 11
  #             4 5 6
  #             1 2 3
  #                P  
  #  These are the number and rough placement of the images that will be used.
  #  There are a total of eighteen.  This is the placement of the images from the forwards perspective.
  def designer_modifications
    # This method is meant to establish what bitmaps will be used for all the images.
    # This method should be the ONLY thing you should modify.
    # First we cycle through all the images
    for i in 1...55
      
      case $game_map.tileset_name  # Next, we check to see what tileset is being used.        
      when "FPRPG_Forest"
        @background.bitmap = RPG::Cache.picture("back")
        @transition = "back"        
        case $game_map.terrain_tag(@positionX[i], @positionY[i])
        when 1 # Terrain Tag 1
          @image[i].bitmap = RPG::Cache.picture("Pierre")
          @graphic[i] = "Pierre"
          
        when 2 # Terrain Tag 2
          @image[i].bitmap = RPG::Cache.picture("herbe")
          @graphic[i] = "herbe"
          
        when 3 # Terrain Tag 3
          @image[i].bitmap = RPG::Cache.picture("arbre")
          @graphic[i] = "arbre"
          
        when 4 # Terrain Tag 4
          @image[i].bitmap = RPG::Cache.picture("caillou")
          @graphic[i] = "caillou"
          
        when 5 # Terrain Tag 5
          @image[i].bitmap = RPG::Cache.picture("maison")
          @graphic[i] = "maison"
          
        when 6 # Terrain Tag 6
          @image[i].bitmap = RPG::Cache.picture("montagne")
          @graphic[i] = "montagne"
          
        else
          @image[i].bitmap = nil
          @graphic[i] = nil
        end
        
      end
      # Now we determine if there are any events that you want to show up.
      for k in 1...$game_map.events.size+1
        if $game_map.events[k] != nil
          # Checking to see if those events are in any of the designated slots
          if $game_map.events[k].event.x == @positionX[i]
            if $game_map.events[k].event.y == @positionY[i]
              # Checking the name of each event.  These can be reused from map to map,
              # but be sure not to put two "Treasure1"s on the same map or bugs will occur.
              case $game_map.events[k].event.name
              # Switch based events are kinda tricky to do.
              # Just remember that we cannot see the actual map.  
              # Simply have the event facing down for the normal, and
              # change the events direction when something has happened.
              # 2 = down, 4 = left, 6 = right, 8 = up
              # Keep in mind that you must use the $fprpg.refesh line using the call script
              # command every time you change an events graphic
              when "panneau"
                if $game_player.direction == 8
                  @image[i].bitmap = RPG::Cache.picture("panneau3")
                  @graphic[i] = "panneau3"
                  elsif $game_player.direction == 2
                  @image[i].bitmap = RPG::Cache.picture("panneau4")
                  @graphic[i] = "panneau4"
                elsif $game_player.direction == 4
                  @image[i].bitmap = RPG::Cache.picture("panneau2")
                  @graphic[i] = "panneau2"
                elsif $game_player.direction == 6
                  @image[i].bitmap = RPG::Cache.picture("panneau")
                  @graphic[i] = "panneau"
                  end
                
                    when "homme"
                  @image[i].bitmap = RPG::Cache.picture("homme")
                  @graphic[i] = "homme"
                
              when "suicide"
                  @image[i].bitmap = RPG::Cache.picture("suicide")
                  @graphic[i] = @suicide
                  @image[i].bitmap = RPG::Cache.picture("suicide")
                  @graphic[i] = @suicide
                when "mort"
                  @image[i].bitmap = RPG::Cache.picture("mort")
                  @graphic[i] = "mort"
              end
          end
        end
      end
    end
  end
  end
  def initialize  #  Declaring all the images being used.
    @background = Sprite.new
    @background.z = 50
    @graphic = []
    @image = []
    for i in 1...55
      @image[i] = Sprite.new
    end
    refresh
  end
  
  
  def side_images(direction)
    # 1-18 Front Facing
    # 19-36 Left Side
    # 37-54 Right Side
    case direction
    when "up"
      # Left Side
      @positionY[37] = $game_player.y - 1
      @positionY[38] = $game_player.y
      @positionY[39] = $game_player.y + 1
      @positionY[40] = $game_player.y - 1
      @positionY[41] = $game_player.y
      @positionY[42] = $game_player.y + 1
      @positionY[43] = $game_player.y - 2
      @positionY[44] = $game_player.y - 1
      @positionY[45] = $game_player.y
      @positionY[46] = $game_player.y + 1
      @positionY[47] = $game_player.y + 2
      @positionY[48] = $game_player.y - 3
      @positionY[49] = $game_player.y - 2
      @positionY[50] = $game_player.y - 1
      @positionY[51] = $game_player.y
      @positionY[52] = $game_player.y + 1
      @positionY[53] = $game_player.y + 2
      @positionY[54] = $game_player.y + 3
      @q = 1
      for i in 37...55
        @positionX[i] = $game_player.x + @q
        if i == 39 or i == 42 or i == 47
          @q += 1
        end
      end
      
      # Right Side
      @positionY[19] = $game_player.y + 1
      @positionY[20] = $game_player.y
      @positionY[21] = $game_player.y - 1
      @positionY[22] = $game_player.y + 1
      @positionY[23] = $game_player.y
      @positionY[24] = $game_player.y - 1
      @positionY[25] = $game_player.y + 2
      @positionY[26] = $game_player.y + 1
      @positionY[27] = $game_player.y
      @positionY[28] = $game_player.y - 1
      @positionY[29] = $game_player.y - 2
      @positionY[30] = $game_player.y + 3
      @positionY[31] = $game_player.y + 2
      @positionY[32] = $game_player.y + 1
      @positionY[33] = $game_player.y
      @positionY[34] = $game_player.y - 1
      @positionY[35] = $game_player.y - 2
      @positionY[36] = $game_player.y - 3
      @q = 1
      for i in 19...37
        @positionX[i] = $game_player.x - @q
        if i == 21 or i == 24 or i == 29
          @q += 1
        end
      end
      
    when "down"
      # Left Side
      @positionY[19] = $game_player.y - 1
      @positionY[20] = $game_player.y
      @positionY[21] = $game_player.y + 1
      @positionY[22] = $game_player.y - 1
      @positionY[23] = $game_player.y
      @positionY[24] = $game_player.y + 1
      @positionY[25] = $game_player.y - 2
      @positionY[26] = $game_player.y - 1
      @positionY[27] = $game_player.y
      @positionY[28] = $game_player.y + 1
      @positionY[29] = $game_player.y + 2
      @positionY[30] = $game_player.y - 3
      @positionY[31] = $game_player.y - 2
      @positionY[32] = $game_player.y - 1
      @positionY[33] = $game_player.y
      @positionY[34] = $game_player.y + 1
      @positionY[35] = $game_player.y + 2
      @positionY[36] = $game_player.y + 3
      @q = 1
      for i in 19...37
        @positionX[i] = $game_player.x + @q
        if i == 21 or i == 24 or i == 29
          @q += 1
        end
      end
      
      # Right Side
      @positionY[37] = $game_player.y + 1
      @positionY[38] = $game_player.y
      @positionY[39] = $game_player.y - 1
      @positionY[40] = $game_player.y + 1
      @positionY[41] = $game_player.y
      @positionY[42] = $game_player.y - 1
      @positionY[43] = $game_player.y + 2
      @positionY[44] = $game_player.y + 1
      @positionY[45] = $game_player.y
      @positionY[46] = $game_player.y - 1
      @positionY[47] = $game_player.y - 2
      @positionY[48] = $game_player.y + 3
      @positionY[49] = $game_player.y + 2
      @positionY[50] = $game_player.y + 1
      @positionY[51] = $game_player.y
      @positionY[52] = $game_player.y - 1
      @positionY[53] = $game_player.y - 2
      @positionY[54] = $game_player.y - 3
      @q = 1
      for i in 37...55
        @positionX[i] = $game_player.x - @q
        if i == 39 or i == 42 or i == 47
          @q += 1
        end
      end
    when "left"
      # Left Side
      @positionX[19] = $game_player.x + 1
      @positionX[20] = $game_player.x
      @positionX[21] = $game_player.x - 1
      @positionX[22] = $game_player.x + 1
      @positionX[23] = $game_player.x
      @positionX[24] = $game_player.x - 1
      @positionX[25] = $game_player.x + 2
      @positionX[26] = $game_player.x + 1
      @positionX[27] = $game_player.x
      @positionX[28] = $game_player.x - 1
      @positionX[29] = $game_player.x - 2
      @positionX[30] = $game_player.x + 3
      @positionX[31] = $game_player.x + 2
      @positionX[32] = $game_player.x + 1
      @positionX[33] = $game_player.x
      @positionX[34] = $game_player.x - 1
      @positionX[35] = $game_player.x - 2    
      @positionX[36] = $game_player.x - 3    
      @q = 1
      for i in 19...37
        @positionY[i] = $game_player.y + @q
        if i == 21 or i == 24 or i == 29
          @q += 1
        end
      end
      
      # Right Side
      @positionX[37] = $game_player.x - 1
      @positionX[38] = $game_player.x
      @positionX[39] = $game_player.x + 1
      @positionX[40] = $game_player.x - 1
      @positionX[41] = $game_player.x
      @positionX[42] = $game_player.x + 1
      @positionX[43] = $game_player.x - 2
      @positionX[44] = $game_player.x - 1
      @positionX[45] = $game_player.x
      @positionX[46] = $game_player.x + 1
      @positionX[47] = $game_player.x + 2
      @positionX[48] = $game_player.x - 3
      @positionX[49] = $game_player.x - 2
      @positionX[50] = $game_player.x - 1
      @positionX[51] = $game_player.x
      @positionX[52] = $game_player.x + 1
      @positionX[53] = $game_player.x + 2
      @positionX[54] = $game_player.x + 3
      @q = 1
      for i in 37...55
        @positionY[i] = $game_player.y - @q
        if i == 39 or i == 42 or i == 47
          @q += 1
        end
      end
      
    when "right"
      # Left Side
      @positionX[19] = $game_player.x - 1
      @positionX[20] = $game_player.x
      @positionX[21] = $game_player.x + 1
      @positionX[22] = $game_player.x - 1
      @positionX[23] = $game_player.x
      @positionX[24] = $game_player.x + 1
      @positionX[25] = $game_player.x - 2
      @positionX[26] = $game_player.x - 1
      @positionX[27] = $game_player.x
      @positionX[28] = $game_player.x + 1
      @positionX[29] = $game_player.x + 2
      @positionX[30] = $game_player.x - 3
      @positionX[31] = $game_player.x - 2
      @positionX[32] = $game_player.x - 1
      @positionX[33] = $game_player.x
      @positionX[34] = $game_player.x + 1
      @positionX[35] = $game_player.x + 2
      @positionX[36] = $game_player.x + 3
      @q = 1
      for i in 19...37
        @positionY[i] = $game_player.y - @q
        if i == 21 or i == 24 or i == 29
          @q += 1
        end
      end
      
      # Right Side
      @positionX[37] = $game_player.x + 1
      @positionX[38] = $game_player.x
      @positionX[39] = $game_player.x - 1
      @positionX[40] = $game_player.x + 1
      @positionX[41] = $game_player.x
      @positionX[42] = $game_player.x - 1
      @positionX[43] = $game_player.x + 2
      @positionX[44] = $game_player.x + 1
      @positionX[45] = $game_player.x
      @positionX[46] = $game_player.x - 1
      @positionX[47] = $game_player.x - 2
      @positionX[48] = $game_player.x + 3
      @positionX[49] = $game_player.x + 2
      @positionX[50] = $game_player.x + 1
      @positionX[51] = $game_player.x
      @positionX[52] = $game_player.x - 1
      @positionX[53] = $game_player.x - 2    
      @positionX[54] = $game_player.x - 3    
      @q = 1
      for i in 37...55
        @positionY[i] = $game_player.y + @q
        if i == 39 or i == 42 or i == 47
          @q += 1
        end
      end
    end
  end
  
  
  
  # The refresh method is used when the update method is finished and when the script first starts.
  # The refresh method basically checks and rechecks to make sure that the right slots are filled
  # in with the right images.
  def refresh
    # First, we must see where the character is facing.
    case $game_player.direction
    when 2 #down
      # After that is done we find the x and y coor. of all the slots being used relevant to the
      # player's position and direction.
      @positionX = []
      @positionX[1] = $game_player.x + 1
      @positionX[2] = $game_player.x
      @positionX[3] = $game_player.x - 1
      @positionX[4] = $game_player.x + 1
      @positionX[5] = $game_player.x
      @positionX[6] = $game_player.x - 1
      @positionX[7] = $game_player.x + 2
      @positionX[8] = $game_player.x + 1
      @positionX[9] = $game_player.x
      @positionX[10] = $game_player.x - 1
      @positionX[11] = $game_player.x - 2
      @positionX[12] = $game_player.x + 3
      @positionX[13] = $game_player.x + 2
      @positionX[14] = $game_player.x + 1
      @positionX[15] = $game_player.x
      @positionX[16] = $game_player.x - 1
      @positionX[17] = $game_player.x - 2    
      @positionX[18] = $game_player.x - 3    
      @positionY = []
      @q = 1
      for i in 1...19
        @positionY[i] = $game_player.y + @q
        if i == 3 or i == 6 or i == 11
          @q += 1
        end
      end
      side_images("down")
      
      
    when 4 #left
      @positionY = []
      @positionY[1] = $game_player.y + 1
      @positionY[2] = $game_player.y
      @positionY[3] = $game_player.y - 1
      @positionY[4] = $game_player.y + 1
      @positionY[5] = $game_player.y
      @positionY[6] = $game_player.y - 1
      @positionY[7] = $game_player.y + 2
      @positionY[8] = $game_player.y + 1
      @positionY[9] = $game_player.y
      @positionY[10] = $game_player.y - 1
      @positionY[11] = $game_player.y - 2
      @positionY[12] = $game_player.y + 3
      @positionY[13] = $game_player.y + 2
      @positionY[14] = $game_player.y + 1
      @positionY[15] = $game_player.y
      @positionY[16] = $game_player.y - 1
      @positionY[17] = $game_player.y - 2
      @positionY[18] = $game_player.y - 3
      @positionX = []
      @q = 1
      for i in 1...19
        @positionX[i] = $game_player.x - @q
        if i == 3 or i == 6 or i == 11
          @q += 1
        end
      end
      side_images("left")
      
    when 6 #right
      @positionY = []
      @positionY[1] = $game_player.y - 1
      @positionY[2] = $game_player.y
      @positionY[3] = $game_player.y + 1
      @positionY[4] = $game_player.y - 1
      @positionY[5] = $game_player.y
      @positionY[6] = $game_player.y + 1
      @positionY[7] = $game_player.y - 2
      @positionY[8] = $game_player.y - 1
      @positionY[9] = $game_player.y
      @positionY[10] = $game_player.y + 1
      @positionY[11] = $game_player.y + 2
      @positionY[12] = $game_player.y - 3
      @positionY[13] = $game_player.y - 2
      @positionY[14] = $game_player.y - 1
      @positionY[15] = $game_player.y
      @positionY[16] = $game_player.y + 1
      @positionY[17] = $game_player.y + 2
      @positionY[18] = $game_player.y + 3
      @positionX = []
      @q = 1
      for i in 1...19
        @positionX[i] = $game_player.x + @q
        if i == 3 or i == 6 or i == 11
          @q += 1
        end
      end
      side_images("right")
 
    when 8 #up
      @positionX = []
      @positionX[1] = $game_player.x - 1
      @positionX[2] = $game_player.x
      @positionX[3] = $game_player.x + 1
      @positionX[4] = $game_player.x - 1
      @positionX[5] = $game_player.x
      @positionX[6] = $game_player.x + 1
      @positionX[7] = $game_player.x - 2
      @positionX[8] = $game_player.x - 1
      @positionX[9] = $game_player.x
      @positionX[10] = $game_player.x + 1
      @positionX[11] = $game_player.x + 2
      @positionX[12] = $game_player.x - 3
      @positionX[13] = $game_player.x - 2
      @positionX[14] = $game_player.x - 1
      @positionX[15] = $game_player.x
      @positionX[16] = $game_player.x + 1
      @positionX[17] = $game_player.x + 2
      @positionX[18] = $game_player.x + 3
      @positionY = []
      @q = 1
      for i in 1...19
        @positionY[i] = $game_player.y - @q
        if i == 3 or i == 6 or i == 11
          @q += 1
        end
      end
      side_images("up")
    end
    
    designer_modifications  # Calling the method that the game designer modifies.
    
    # This is the last piece of the refresh method.
    # Here is where we make sure every image has the right x and y coor.,
    # and the right zoom
 
    @q = -160
    for i in 1...4
      @image[i].x = @q
      @image[i].y = 0
      @image[i].z = 54
      @image[i].zoom_x = 1
      @image[i].zoom_y = 1
      @image[i+18].x = @q - 960
      @image[i+18].y = 0
      @image[i+18].z = 54
      @image[i+18].zoom_x = 1
      @image[i+18].zoom_y = 1
      @image[i+36].x = @q + 960
      @image[i+36].y = 0
      @image[i+36].z = 54
      @image[i+36].zoom_x = 1
      @image[i+36].zoom_y = 1
      @q += 320
    end
 
    @q = -40
    for i in 4...7
      @image[i].x = @q
      @image[i].y = 20
      @image[i].z = 53
      @image[i].zoom_x = 0.75
      @image[i].zoom_y = 0.75
      @image[i+18].x = @q - 720
      @image[i+18].y = 20
      @image[i+18].z = 53
      @image[i+18].zoom_x = 0.75
      @image[i+18].zoom_y = 0.75
      @image[i+36].x = @q + 720
      @image[i+36].y = 20
      @image[i+36].z = 53
      @image[i+36].zoom_x = 0.75
      @image[i+36].zoom_y = 0.75
      @q += 240
    end
    
    @q = -80
    for i in 7...12
      @image[i].x = @q
      @image[i].y = 40
      @image[i].z = 52
      @image[i].zoom_x = 0.5
      @image[i].zoom_y = 0.5
      @image[i+18].x = @q - 800
      @image[i+18].y = 40
      @image[i+18].z = 52
      @image[i+18].zoom_x = 0.5
      @image[i+18].zoom_y = 0.5
      @image[i+36].x = @q + 800
      @image[i+36].y = 40
      @image[i+36].z = 52
      @image[i+36].zoom_x = 0.5
      @image[i+36].zoom_y = 0.5
      @q += 160
    end
 
    @q = 40
    for i in 12...19
      @image[i].x = @q
      @image[i].y = 60
      @image[i].z = 51
      @image[i].zoom_x = 0.25
      @image[i].zoom_y = 0.25
      @image[i+18].x = @q - 640
      @image[i+18].y = 60
      @image[i+18].z = 51
      @image[i+18].zoom_x = 0.25
      @image[i+18].zoom_y = 0.25
      @image[i+36].x = @q + 640
      @image[i+36].y = 60
      @image[i+36].z = 51
      @image[i+36].zoom_x = 0.25
      @image[i+36].zoom_y = 0.25
      @q += 80
    end
  end
  
 
  def update(type = "")  # The update method is used when it's time to move those images around.
    # This is the moment where we move all the images using my Free Picture Movement Script,
    # but first we have to establish where the player is facing. 
    case type # type is a string describing the type of movement the player is doing.
    when "forward"
      # All the images under the "forward" case will move towards you, or seem like it.
      # This is done by moving the pictures x, y, zoom_x, and zoom_y using the FPM script.
      @q = -160
      @r = -360
      for i in 1...4
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @r, 12)
          $fpm.movement_y(@image[i], @graphic[i], i, 0, -20, 12)
          $fpm.movement_zoom_x(@image[i], @graphic[i], i, 1, 1.25, 12)
          $fpm.movement_zoom_y(@image[i], @graphic[i], i, 1, 1.25, 12)
        end
        @q += 320
        @r += 480
      end
      
      @q = -40
      @r = -160
      for i in 4...7
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @r, 12)
          $fpm.movement_y(@image[i], @graphic[i], i, 20, 0, 12)
          $fpm.movement_zoom_x(@image[i], @graphic[i], i, 0.75, 1, 12)
          $fpm.movement_zoom_y(@image[i], @graphic[i], i, 0.75, 1, 12)
        end
        @q += 240
        @r += 320
      end
      
      @q = -80
      @r = -280
      for i in 7...12
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @r, 12)
          $fpm.movement_y(@image[i], @graphic[i], i, 40, 20, 12)
          $fpm.movement_zoom_x(@image[i], @graphic[i], i, 0.5, 0.75, 12)
          $fpm.movement_zoom_y(@image[i], @graphic[i], i, 0.5, 0.75, 12)
        end
        @q += 160
        @r += 240
      end
      
      @q = 40
      @r = -240
      for i in 12...19
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @r, 12)
          $fpm.movement_y(@image[i], @graphic[i], i, 60, 40, 12)
          $fpm.movement_zoom_x(@image[i], @graphic[i], i, 0.25, 0.5, 12)
          $fpm.movement_zoom_y(@image[i], @graphic[i], i, 0.25, 0.5, 12)
        end
        @q += 80
        @r += 160
      end
      
    when "back"
      # All the images under the "back" case will move away from you, or seem like it.
      @q = -160
      @r = -40
      for i in 1...4
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @r, 12)
          $fpm.movement_y(@image[i], @graphic[i], i, 0, 20, 12)
          $fpm.movement_zoom_x(@image[i], @graphic[i], i, 1, 0.75, 12)
          $fpm.movement_zoom_y(@image[i], @graphic[i], i, 1, 0.75, 12)
        end
        @q += 320
        @r += 240
      end
      
      @q = -40
      @r = 80
      for i in 4...7
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @r, 12)
          $fpm.movement_y(@image[i], @graphic[i], i, 20, 40, 12)
          $fpm.movement_zoom_x(@image[i], @graphic[i], i, 0.75, 0.5, 12)
          $fpm.movement_zoom_y(@image[i], @graphic[i], i, 0.75, 0.5, 12)
        end
        @q += 240
        @r += 160
      end
      
      @q = -80
      @r = 120
      for i in 7...12
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @r, 12)
          $fpm.movement_y(@image[i], @graphic[i], i, 40, 60, 12)
          $fpm.movement_zoom_x(@image[i], @graphic[i], i, 0.5, 0.25, 12)
          $fpm.movement_zoom_y(@image[i], @graphic[i], i, 0.5, 0.25, 12)
        end
        @q += 160
        @r += 80
      end
      
      @q = 40
      @r = 208
      for i in 12...19
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @r, 12)
          $fpm.movement_y(@image[i], @graphic[i], i, 60, 70, 12)
          $fpm.movement_zoom_x(@image[i], @graphic[i], i, 0.25, 0.1, 12)
          $fpm.movement_zoom_y(@image[i], @graphic[i], i, 0.25, 0.1, 12)
        end
        @q += 80
        @r += 32
      end
      
    when "left"
      $fpm.movement_x(@background, @transition, 0, -640, 0, 12)
      # All the images under the "left" case will simply move to the right,
      # since you will be turning left.
 
      @q = -160
      for i in 1...4
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @q+960, 12)
        end
        if @graphic[i+18] != nil
          $fpm.movement_x(@image[i+18], @graphic[i+18], i+18, @q-960, @q, 12)
        end
        @q += 320
      end
      
      @q = -40
      for i in 4...7
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @q+720, 12)
        end
        if @graphic[i+18] != nil
          $fpm.movement_x(@image[i+18], @graphic[i+18], i+18, @q-720, @q, 12)
        end
        @q += 240
      end
      
      @q = -80
      for i in 7...12
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @q+800, 12)
        end
        if @graphic[i+18] != nil
          $fpm.movement_x(@image[i+18], @graphic[i+18], i+18, @q-800, @q, 12)
        end
        @q += 160
      end
      
      @q = 40
      for i in 12...19
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @q+640, 12)
        end
        if @graphic[i+18] != nil
          $fpm.movement_x(@image[i+18], @graphic[i+18], i+18, @q-640, @q, 12)
        end
        @q += 80
      end
      
      
    when "right"
      # All the images under the "right" case will simply move to the left,
      # since you will be turning right.
      $fpm.movement_x(@background, @transition, 0, 0, -640, 12)
      
      @q = -160
      for i in 1...4
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @q-960, 12)
        end
        if @graphic[i+36] != nil
          $fpm.movement_x(@image[i+36], @graphic[i+36], i+36, @q+960, @q, 12)
        end
        @q += 320
      end
      
      @q = -40
      for i in 4...7
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @q-720, 12)
        end
        if @graphic[i+36] != nil
          $fpm.movement_x(@image[i+36], @graphic[i+36], i+36, @q+720, @q, 12)
        end
        @q += 240
      end
      
      @q = -80
      for i in 7...12
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @q-800, 12)
        end
        if @graphic[i+36] != nil
          $fpm.movement_x(@image[i+36], @graphic[i+36], i+36, @q+800, @q, 12)
        end
        @q += 160
      end
      
      @q = 40
      for i in 12...19
        if @graphic[i] != nil
          $fpm.movement_x(@image[i], @graphic[i], i, @q, @q-640, 12)
        end
        if @graphic[i+36] != nil
          $fpm.movement_x(@image[i+36], @graphic[i+36], i+36, @q+640, @q, 12)
        end
        @q += 80
      end
    end
    # For further expainations on how the $fpm methods work, consult the
    # Free Picture movement script.
  end
  
  def dispose
    for i in 1...55
      @image[i].dispose
    end
  end
end
 
class Game_Player < Game_Character
  alias bksm_fprpg_gameplayer_update update
  
  def update
    if $FPRPG_Active == true
      # The @moving variable is just there to act as sort of a grace period,
      # so you don't turn to fast, or move before the transition is done.
      if @moving != nil and @moving >= 13 
        # When @moving reaches 8 it triggers the refresh method and resets itself back to nil
        @moving = nil
        $fprpg.refresh
      end
      if @moving != nil and @moving >= 1
        @moving += 1
      end
 
      if @moving == nil
        unless moving? or $game_system.map_interpreter.running? or
               @move_route_forcing or $game_temp.message_window_showing
          case Input.dir4
          when 2
            # move_backwards isn't part of the original coding for RMXP.
            # the original is move_backward.  I did this so I wouldn't mess up
            # any call methods used by RMXP
            move_backwards
            @moving = 1
          when 4
            turn_left_90
            @moving = 1
            $fprpg.update("left") # "left" refers to the type string mentioned earlier
          when 6
            turn_right_90
            @moving = 1
            $fprpg.update("right") # So does "right"
          when 8
            # The same that was said about move_backwards can be said about move_forwards
            move_forwards
            @moving = 1
          end
        end
      end
      last_real_x = @real_x
      last_real_y = @real_y
      super
      if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
        $game_map.scroll_down(@real_y - last_real_y)
      end
      if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
        $game_map.scroll_left(last_real_x - @real_x)
      end
      if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
        $game_map.scroll_right(@real_x - last_real_x)
      end
      if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
        $game_map.scroll_up(last_real_y - @real_y)
      end
      unless moving?
        if @moving == 13
          result = check_event_trigger_here([1,2])
          if result == false
            unless $DEBUG and Input.press?(Input::CTRL)
              if @encounter_count > 0
                @encounter_count -= 1
              end
            end
          end
        end
        if Input.trigger?(Input::C)
          check_event_trigger_here([0])
          check_event_trigger_there([0,1,2])
        end
      end
    else
      bksm_fprpg_gameplayer_update
    end
  end
end
 
class Game_Character
  alias bksm_fprpg_movedown move_down
  alias bksm_fprpg_moveup move_up
  alias bksm_fprpg_moveleft move_left
  alias bksm_fprpg_moveright move_right
  def move_forwards
    case @direction
    when 2
      move_down(false, "forward")
    when 4
      move_left(false, "forward")
    when 6
      move_right(false, "forward")
    when 8
      move_up(false, "forward")
    end
  end
 
  def move_backwards
    last_direction_fix = @direction_fix
    @direction_fix = true
    case @direction
    when 2
      move_up(false, "back")
    when 4
      move_right(false, "back")
    when 6
      move_left(false, "back")
    when 8
      move_down(false, "back")
    end
    @direction_fix = last_direction_fix
  end
  
  # The below methods are modified so that the eighteen images will
  # only update and move if you can move in the forward direction.
  def move_down(turn_enabled = true, type = "")
    if $FPRPG_Active == true
      if turn_enabled
        turn_down
      end
      if passable?(@x, @y, 2)
        $fprpg.update(type)
        turn_down
        @y += 1
        increase_steps
      else
        check_event_trigger_touch(@x, @y+1)
      end
    else
      bksm_fprpg_movedown
    end
  end
  
  def move_left(turn_enabled = true, type = "")
    if $FPRPG_Active == true
      if turn_enabled
        turn_left
      end
      if passable?(@x, @y, 4)
        $fprpg.update(type)
        turn_left
        @x -= 1
        increase_steps
      else
        check_event_trigger_touch(@x-1, @y)
      end
    else
      bksm_fprpg_moveleft
    end
  end
 
  def move_right(turn_enabled = true, type = "")
    if $FPRPG_Active == true
      if turn_enabled
        turn_right
      end
      if passable?(@x, @y, 6)
        $fprpg.update(type)
        turn_right
        @x += 1
        increase_steps
      else
        check_event_trigger_touch(@x+1, @y)
      end
    else
      bksm_fprpg_moveright
    end
  end
  
  def move_up(turn_enabled = true, type = "")
    if $FPRPG_Active == true
      if turn_enabled
        turn_up
      end
      if passable?(@x, @y, 8)
        $fprpg.update(type)
        turn_up
        @y -= 1
        increase_steps
      else
        check_event_trigger_touch(@x, @y-1)
      end
    else
      bksm_fprpg_moveup
    end
  end
end
 
class Scene_Map
  alias bksm_fprpg_main main
  alias bksm_fprpg_update update
  alias bksm_fprpg_transfer transfer_player
  def main
    bksm_fprpg_main
    if $FPRPG_Active == true
      if $fprpg != nil
        $fprpg.dispose
      end
      $fprpg = First_Person.new
    end
  end
  
  def update
    if $FPRPG_Active == true
      if @transition_counter != nil
        @transition_counter += 1
        if @transition_counter == 8
          $fpm.movement_opacity(@transition, $fprpg.transition, 19, 255, 0, 8)
          @transition_counter == nil
        end
      end
    end
    bksm_fprpg_update
  end
  
  def transfer_player
    if $FPRPG_Active == true
      @transition = Sprite.new
      @transition.bitmap = RPG::Cache.picture($fprpg.transition)
      @transition.z = 55
      @transition.opacity = 0
      @transition.tone = Tone.new(-255,-255, -255, 0)
      $fpm.movement_opacity(@transition, $fprpg.transition, 19, 0, 255, 8)
      @transition_counter = 1
    end
    bksm_fprpg_transfer
  end
end
 
class Game_Event < Game_Character
  attr_reader   :event  
end
 
class Spriteset_Battle
  alias bksm_fprpg_initialize initialize
  def initialize
    bksm_fprpg_initialize
    if $FPRPG_Active == true
      @viewport1.z = 60
      @battleback_sprite.dispose
      @battleback_sprite = Sprite.new
      @battleback_sprite.z = 0
    end
  end
end
 
class Scene_Save < Scene_File
  alias bksm_fprpg_writesavedata write_save_data
  def write_save_data(file)
    bksm_fprpg_writesavedata(file)
    Marshal.dump($FPRPG_Active, file)
  end
end
 
class Scene_Load < Scene_File
  alias bksm_fprpg_readsavedata read_save_data
  def read_save_data(file)
    bksm_fprpg_readsavedata(file)
    $FPRPG_Active = Marshal.load(file)
    if $FPRPG_Active == true
      $fprpg = First_Person.new
    end
  end
end



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
# ----------------------------------------------------------------
# Script Name: Free Picture Movement v1.1
# Created by: BigKevSexyMan
# Finished by: 12/18/05
# Updated on: 12/19/05
# ----------------------------------------------------------------
class Free_Picture_Movement
 
  attr_accessor :rotation
  attr_accessor :incrimentX
  attr_accessor :incrimentY
  attr_accessor :incrimentZ
  attr_accessor :incrimentAngle
  attr_accessor :incrimentZoomX
  attr_accessor :incrimentZoomY
  attr_accessor :incrimentOpacity
  attr_accessor :incrimentCircle
  attr_accessor :OpacityRound
  attr_accessor :XRound
  attr_accessor :YRound
  attr_accessor :ZRound
  attr_accessor :move_x
  attr_accessor :move_y
  attr_accessor :move_z
  attr_accessor :move_angle
  attr_accessor :move_zoomx
  attr_accessor :move_zoomy
  attr_accessor :move_opacity
  attr_accessor :move_circle
  attr_accessor :PicName
  attr_accessor :FramesX
  attr_accessor :FramesY
  attr_accessor :FramesZ
  attr_accessor :FramesAngle
  attr_accessor :FramesZoomX
  attr_accessor :FramesZoomY
  attr_accessor :FramesOpacity
  attr_accessor :FramesCircle
  attr_accessor :CirclePictureX
  attr_accessor :CirclePictureY
 
  def initialize
    @rotation = 0.0
    @incrimentX = []
    @incrimentY = []
    @incrimentZ = []
    @incrimentAngle = []
    @incrimentZoomX = []
    @incrimentZoomY = []
    @incrimentOpacity = []
    @incrimentCircle = []
    @OpacityRound = []
    @XRound = []
    @YRound = []
    @ZRound = []
    @move_x = []
    @move_y = []
    @move_z = []
    @move_angle = []
    @move_zoomx = []
    @move_zoomy = []
    @move_opacity = []
    @move_circle = []
    @PicName = []
    @FramesX = []
    @FramesY = []
    @FramesZ = []
    @FramesAngle = []
    @FramesZoomX = []
    @FramesZoomY = []
    @FramesOpacity = []
    @FramesCircle = []
    @CirclePictureX = []
    @CirclePictureY = []
  end
  # Setup to move horizontal
  def movement_x(name, bitmap, index, point_ax, point_bx, incriment = 10)
    @incrimentX[index] = 0.0
    @incrimentX[index] = (point_bx - point_ax)/incriment.to_f
    if name == nil
      name = Sprite.new
    end
    name.bitmap = RPG::Cache.picture(bitmap)
    @XRound[index] = point_ax
    @PicName[index] = name
    name.x = point_ax
    @FramesX[index] = incriment
    @move_x[index] = true  
  end
  # Setup to move vertical
  def movement_y(name, bitmap, index, point_ay, point_by, incriment = 10)
    @incrimentY[index] = 0.0
    @incrimentY[index] = (point_by - point_ay)/incriment.to_f
    if name == nil
      name = Sprite.new
    end
    name.bitmap = RPG::Cache.picture(bitmap)
    @YRound[index] = point_ay
    @PicName[index] = name
    name.y = point_ay
    @FramesY[index] = incriment
    @move_y[index] = true
  end
 
  # Setup to move above or below other objects
  def movement_z(name, bitmap, index, point_az, point_bz, incriment = 10)
    @incrimentZ[index] = 0.0
    @incrimentZ[index] = (point_bz - point_az)/incriment.to_f
    if name == nil
      name = Sprite.new
    end
    name.bitmap = RPG::Cache.picture(bitmap)
    @ZRound[index] = point_az
    @PicName[index] = name
    name.z = point_az
    @FramesZ[index] = incriment
    @move_z[index] = true
  end
 
  # Setup to rotate angle
  def movement_rotation(name, bitmap, index, angle_a, angle_b, incriment = 10)
    @incrimentAngle[index] = 0.0
    @incrimentAngle[index] = (angle_b - angle_a)/incriment.to_f
    if name == nil
      name = Sprite.new
    end
    name.bitmap = RPG::Cache.picture(bitmap)
    @PicName[index] = name
    name.angle = angle_a
    @FramesAngle[index] = incriment
    @move_angle[index] = true
  end
 
  # Setup to change width
  def movement_zoom_x(name, bitmap, index, zoom_ax = 1.0, zoom_bx = 1.0, incriment = 10)
    @incrimentZoomX[index] = 0.0
    @incrimentZoomX[index] = (zoom_bx - zoom_ax)/incriment.to_f
    if name == nil
      name = Sprite.new
    end
    name.bitmap = RPG::Cache.picture(bitmap)
    @PicName[index] = name
    name.zoom_x = zoom_ax
    @FramesZoomX[index] = incriment
    @move_zoomx[index] = true
  end
 
  # Setup to change height
  def movement_zoom_y(name, bitmap, index, zoom_ay = 1.0, zoom_by = 1.0, incriment = 10)
    @incrimentZoomY[index] = 0.0
    @incrimentZoomY[index] = (zoom_by - zoom_ay)/incriment.to_f
    if name == nil
      name = Sprite.new
    end
    name.bitmap = RPG::Cache.picture(bitmap)
    @PicName[index] = name
    name.zoom_y = zoom_ay
    @FramesZoomY[index] = incriment
    @move_zoomy[index] = true
  end
 
  # Setup to change opacity
  def movement_opacity(name, bitmap, index, opacity_a = 255, opacity_b = 255, incriment = 10)
    @incrimentOpacity[index] = 0.0
    if opacity_a > 255
      opaicty_a = 255
    end
    if opacity_b > 255
      opaicty_b = 255
    end
    if opacity_a < 0
      opaicty_a = 0
    end
    if opacity_b < 0
      opaicty_b = 0
    end
    @incrimentOpacity[index] = (opacity_b - opacity_a)/incriment.to_f
    if name == nil
      name = Sprite.new
    end
    name.bitmap = RPG::Cache.picture(bitmap)
    @OpacityRound[index] = opacity_a
    @PicName[index] = name
    name.opacity = opacity_a
    @FramesOpacity[index] = incriment
    @move_opacity[index] = true
  end
 
  # Sets picture's angle to point at (point_bx, point_by)
  def angle_to_direction(name, point_ax, point_ay, point_bx, point_by)
    @px = point_bx - point_ax
    @py = point_by - point_ay
 
    if @px != 0
      @slope = @py/@px
      @rotation = ((Math.atan(@slope) * 360)/6.28).round
    end
     
    if @px > 0
      if @py > 0
        @rotation -= 90
      elsif @py < 0
        @rotation += 90
      elsif @py == 0
        @rotation = 0
      end
    elsif @px < 0
      if @py > 0
        @rotation += 180
      elsif @py < 0
        @rotation += 180
      elsif @py == 0
        @rotation = 180
      end
    elsif @px == 0
      if @py > 0
        @rotation = 270
      elsif @py < 0
        @rotation = 90
      elsif @py == 0
        @rotation = 0
      end
    end
    name.x = point_ax
    name.y = point_ay
    name.angle = @rotation
  end
 
  # Set's up picture to go in a circle in "turn's" direction.  A negative number makes the picture
  # go clockwise.  A positive number make it go counter clockwise.  To rotate the picture from
  # the center use:
  # $fpm.movement_circle(name, bitmap, index, x, y, turn,    -15   , loops, incriment)
  def movement_circle(name, bitmap, index, x, y, turn, radius, loops, incriment = 10)
    @incrimentCircle[index] = 0.0
    @incrimentCircle[index] = (loops * 360)/incriment.to_f
    if name == nil
      name = Sprite.new
    end
    name.bitmap = RPG::Cache.picture(bitmap)
    @CirclePictureX[index] = x
    @CirclePictureY[index] = y
    name.x = @CirclePictureX[index]
    name.y = @CirclePictureY[index]
    name.ox = 0
    name.oy = 0
    if turn == 'left'
      name.x -= radius * name.zoom_x
      name.y += name.bitmap.height * name.zoom_y
      name.ox = -1 * radius
      name.oy = name.bitmap.height
    elsif turn == 'right'
      name.x += (name.bitmap.width + radius) * name.zoom_x
      name.y += name.bitmap.height * name.zoom_y
      name.ox = name.bitmap.width + radius
      name.oy = name.bitmap.height
      @bksm = Sprite.new
      @bksm.x = name.x
      @bksm.y = name.y
      @bksm.bitmap = RPG::Cache.picture("bksm1")
    elsif turn == 'up'
      name.x += name.bitmap.width / 2 * name.zoom_x
      name.y -= radius * name.zoom_y
      name.ox = name.bitmap.width / 2
      name.oy = -1 * radius
    elsif turn == 'down'
      name.x += name.bitmap.width / 2 * name.zoom_x
      name.y += (name.bitmap.height + radius) * name.zoom_y
      name.ox = name.bitmap.width / 2
      name.oy = name.bitmap.height + radius
    end
    @PicName[index] = name
    @FramesCircle[index] = incriment
    @move_circle[index] = true
  end
 
end
 
class Scene_Map
  alias moving_pictures update
  def update
    for i in 0...$fpm.PicName.size
      # Moves the coresponding picture horizontally
      if $fpm.move_x[i] == true
        if $fpm.PicName[i] != nil
          if $fpm.FramesX[i] != 0
            $fpm.XRound[i] += $fpm.incrimentX[i].to_f
            $fpm.PicName[i].x = $fpm.XRound[i].round
            $fpm.FramesX[i] -= 1
          else
            $fpm.move_x[i] = false
            $fpm.FramesX[i] = nil
            $fpm.incrimentX[i] = nil
          end
        end
      end
     
      # Moves the coresponding picture vertically
      if $fpm.move_y[i] == true
        if $fpm.PicName[i] != nil
          if $fpm.FramesY[i] != 0
            $fpm.YRound[i] += $fpm.incrimentY[i].to_f
            $fpm.PicName[i].y = $fpm.YRound[i].round
            $fpm.FramesY[i] -= 1
          else
            $fpm.move_y[i] = false
            $fpm.FramesY[i] = nil
            $fpm.incrimentY[i] = nil
          end
        end
      end
     
      # Moves the coresponding picture above or below other objects
      if $fpm.move_z[i] == true
        if $fpm.PicName[i] != nil
          if $fpm.FramesZ[i] != 0
            $fpm.ZRound[i] += $fpm.incrimentZ[i].to_f
            $fpm.PicName[i].z = $fpm.ZRound[i].round
            $fpm.FramesZ[i] -= 1
          else
            $fpm.move_z[i] = false
            $fpm.FramesZ[i] = nil
            $fpm.incrimentZ[i] = nil
          end
        end
      end
     
      # Moves the coresponding picture's angle
      if $fpm.move_angle[i] == true
        if $fpm.PicName[i] != nil
          if $fpm.FramesAngle[i] != 0
            $fpm.PicName[i].angle += $fpm.incrimentAngle[i]
            $fpm.FramesAngle[i] -= 1
          else
            $fpm.move_angle[i] = false
            $fpm.FramesAngle[i] = nil
            $fpm.incrimentAngle[i] = nil
          end
        end
      end
     
      # Makes the coresponding picture grow in width
      if $fpm.move_zoomx[i] == true
        if $fpm.PicName[i] != nil
          if $fpm.FramesZoomX[i] != 0
            $fpm.PicName[i].zoom_x += $fpm.incrimentZoomX[i]
            $fpm.FramesZoomX[i] -= 1
          else
            $fpm.move_zoomx[i] = false
            $fpm.FramesZoomX[i] = nil
            $fpm.incrimentZoomX[i] = nil
          end
        end
      end
     
      # Makes the coresponding picture grow in height
      if $fpm.move_zoomy[i] == true
        if $fpm.PicName[i] != nil
          if $fpm.FramesZoomY[i] != 0
            $fpm.PicName[i].zoom_y += $fpm.incrimentZoomY[i]
            $fpm.FramesZoomY[i] -= 1
          else
            $fpm.move_zoomy[i] = false
            $fpm.FramesZoomY[i] = nil
            $fpm.incrimentZoomY[i] = nil
          end
        end
      end
     
      # Changes the coresponding picture's opacity
      if $fpm.move_opacity[i] == true
        if $fpm.PicName[i] != nil
          if $fpm.FramesOpacity[i] != 0
            $fpm.OpacityRound[i] += $fpm.incrimentOpacity[i].to_f
            $fpm.PicName[i].opacity = $fpm.OpacityRound[i].round
            $fpm.FramesOpacity[i] -= 1
          else
            $fpm.move_opacity[i] = false
            $fpm.FramesOpacity[i] = nil
            $fpm.incrimentOpacity[i] = nil
          end
        end
      end
     
      # Moves the picture in the designated circle direction
      if $fpm.move_circle[i] == true
        if $fpm.PicName[i] != nil
          if $fpm.FramesCircle[i] != 0
            $fpm.PicName[i].angle += $fpm.incrimentCircle[i]
            $fpm.FramesCircle[i] -= 1
          else
            $fpm.move_circle[i] = false
            $fpm.FramesCircle[i] = nil
            $fpm.incrimentCircle[i] = nil
            $fpm.PicName[i].ox = 0
            $fpm.PicName[i].oy = 0
            $fpm.PicName[i].x = $fpm.CirclePictureX[i]
            $fpm.PicName[i].y = $fpm.CirclePictureY[i]
          end
        end
      end
    end
    moving_pictures
  end
end
 
# Declares class Free_Picture_Movement
class Scene_Title
  alias declaring command_new_game
  alias declaring2 battle_test
  alias declaring_continue command_continue
  def command_new_game
    $fpm = Free_Picture_Movement.new
    declaring
  end
  
  def command_continue
    $fpm = Free_Picture_Movement.new
    declaring_continue
  end
 
  def battle_test
    $fpm = Free_Picture_Movement.new
    declaring2
  end
end




Mis à jour le 10 novembre 2020.






TracerTong - posté le 25/03/2009 à 10:46:00 (27 messages postés)

❤ 0

[/color] Woooouuuuu ! Mais voila qui est rudemeeeeent interessant ! je l'ai pas encore testé, mais, à la première personne, ça doit être..Laclasse ! Sauf que, a mon avis, faudrait utiliser d'autres chipstets en 3d pour ça ^^:sfrog [color=white][bgcolor=black]


gloubyboulga - posté le 03/05/2009 à 08:51:43 (38 messages postés)

❤ 0

UN SCREEN ?


valentinx69 - posté le 02/10/2009 à 22:59:39 (37 messages postés)

❤ 0

VSARASMCorp will win

Dites, si quelqu'un a les images, merci de poster un lien svp. Merci:D

EDIT: En fait, le lien des images est mort, si quelqu'un les a, merci de me donner un lien en mp svp. Ce script me permettrait de faire de belles choses.:D

When you begin 3D, it's for ever ;)


Sharin - posté le 14/10/2009 à 17:25:08 (16 messages postés)

❤ 0

My name is... DarkLink !!!

Salut je voudrais pas vous embêter mais moi j'y comprend rien : ce script ne fait pas grand chose à part tout faire laguer (sauf si c'est mon ordi qui fait tout laguer dans ce cas là le script ne fait rien du tout :p ) enfin bon en bref :help.

Dans son ombre je vis, tous ces geste sont les miens, je suis aussi fort que lui, je suis... DarkLink !!!


acireld - posté le 01/12/2009 à 20:16:44 (173 messages postés)

❤ 0

Beuh, ton lien est dead -_- Tant qu'a faire commencer le C++ et faire un bon fps, parce qu'avec ceux qui postent des scripts bidonnés..:noel


Jakylla - posté le 07/08/2010 à 17:04:39 (45 messages postés)

❤ 0

Heureux

Je l'ai téléchargé, corrigé... Il marche mais...

A quoi sert-il ? Aucuns changements repérés !

Bienvenues à tous et bonne chance pour vos RPG !

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