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 |