Night.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", (...) / Tutos: Checklist de la composition (...) / Sorties: Dread Mac Farlane - episode 8 / Sorties: Dread Mac Farlane - episode 7 / Jeux: Ce qui vit Dessous / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

345 connectés actuellement

29416449 visiteurs
depuis l'ouverture

8989 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

ConsoleFun

Lunae - le bazar d'Emz0

Tashiroworld

Lumen

Planète Glutko

Tous nos partenaires

Devenir
partenaire



forums

Index du forum > Entraide > [RESOLU] [Rpg maker vx ace] Faceset qui s'adapte selon le héros choisi


zleekezl - posté le 01/05/2016 à 23:39:39 (9 messages postés)

❤ 0

Domaine concerné: Dialogue
Logiciel utilisé: Rpg maker vx ace
Bonjour,

Je suis bloqué depuis un moment et je n'ai pas trouvé de solution. Au début de mon jeux je donne au joueur la possibilité de choisir un nom. Ce nom peut s'afficher dans les dialogue avec \n[1]. Ensuite je donne le choix en 6 apparences de héro au joueur, pour cela le joueur va vers un des 6 skins proposés et lorsqu'il clique dessus un événement modifie l’apparence du joueur. Le soucis est que je n'arrive pas à faire en sorte que, quelque soit le skin choisi, l'image du joueur dans les dialogue soit la bonne. Je veut dire par là que je voudrait savoir si il y a une commande ou un script (mais je n'y connais rien en script et je ne sait pas les utiliser) comme le \n[x] des noms mais pour l'image du héros de tel sorte que l'image se mette automatiquement.
Merci d'avance ^^


La Machine Infernal - posté le 02/05/2016 à 00:16:00 (172 messages postés)

❤ 0

Je ne connais pas de tel plugins.

Par contre tu peux reproduire la même chose en créant une variable qui prends une valeurs différente en fonction du skin que le joueur choisit. Ensuite dans les dialogues, tu fait plusieurs variantes des paroles du perso avec les différentes images et les dialogues s'affichent en fonction de la valeur de la variable et donc du choix du Skin.

Avec une simple suite de condition c'est possible.
Par contre ca risque d’alourdir les événements.


Danzaiver - posté le 02/05/2016 à 03:33:57 (364 messages postés)

❤ 0

sinon en plus chiant mais en plus compréhensible pour les nouveaux c'est encore d'utiliser les interrupteur, et les conditions.

Condition l’interrupteur 1 est activé
changer l'apparence du héros en personnage 1
sinon
condition l’interrupteur 2 est activé
changer l'apparence du héros en personnage 2
sinon

ect ect ect jusqu'à 6.

et tu place un interrupteur par choix de skin et tu t'arrange pour que le joueur ne puissent en activer plusieurs a la fois.

Sinon en effet le mieux c'est d'(utiliser une variable pour optimiser.


Aurora - posté le 02/05/2016 à 07:37:21 (437 messages postés)

❤ 0

Le jeu ne mémorise t-il pas le changement d'apparence en utilisant la commande "changer apparence du héros" ?
Sur mon jeu Gems on peut choisir 16 apparences, le jeu garde bien celle choisie tout le long, y compris dans les sauvegardes.

Je ne pense pas qu'un switch soit nécessaire.
Tu choisis ton apparence et à ce moment là tu définis le Face avec "modifier apparence du héros"


zleekezl - posté le 02/05/2016 à 08:18:57 (9 messages postés)

❤ 0

Oui j'avais déjà pensé à cette possibilité : utiliser les interrupteurs pour créer différentes pages d’événements pour un dialogue. Mais si je veux cette commande c'est justement pour ne pas à avoir à faire toute ces pages de dialogues.
J'ai trouvé, en cherchant un peu hier, une page qui nous propose un script permettant de faire ce que je souhaite (enfin je crois) mais encore une fois je ne sais pas m'en servir. J'ai quand même essayé mais sa n'a pas marché. Donc est ce que quelqu'un pourrais me dire comment le faire fonctionner si c'est possible.
Merci d'avance ^^

lien : https://yanflychannel.wordpress.com/rmvxa/core-scripts/ace-message-system/






Citation:

Le jeu ne mémorise t-il pas le changement d'apparence en utilisant la commande "changer apparence du héros" ?
Sur mon jeu Gems on peut choisir 16 apparences, le jeu garde bien celle choisie tout le long, y compris dans les sauvegardes.

Je ne pense pas qu'un switch soit nécessaire.
Tu choisis ton apparence et à ce moment là tu définis le Face avec "modifier apparence du héros"



Oui mais moi je propose 6 skins au joueur, donc au début du jeux il choisi un des 6 skin proposé. Donc lorsque je créer un dialogue je ne peux pas, à moins de créer 6 pages de dialogue grâce à des interrupteurs, choisir la bonne image à placer dans chaque dialogue.
Et c'est justement c'est 6 pages par dialogue que je voudrais évité.


el leopo - posté le 02/05/2016 à 08:39:35 (75 messages postés)

❤ 0

Pas besoin de faire 6 pages d'event , t'as juste a faire une "fonction"

je te mets deux screen pour que tu comprennes

image

image

Bon sur le deuxieme screen j'ai toujours mis le même visage mais le principe est la .

Après tu peux creer autant de face dans ta fonction , t'as juste a donner la valeur a ta variable avant .

Si tu comprends pas , je peux reexpliquer :)


zleekezl - posté le 02/05/2016 à 09:08:21 (9 messages postés)

❤ 0

Non désolé je suis un peu perdu ^^, j'ai déjà utilisé des variables mais je n'arrive pas à comprendre comment ils permettent de modifier le visage dans un dialogue. Malheureusement je ne peu pas rester plus longtemps mais je serai disponible après 18h si tu as le temps pour mieux m'expliquer ^^


Noein - posté le 02/05/2016 à 09:53:33 (155 messages postés)

❤ 0

Salut,

Tu ne pourras pas utiliser la technique de El Leopo tout simplement parce qu'il utilise une commande d'évènement qui n'existe pas sur Ace. Sur Ace le choix du faceset se fait directement dans l'option des messages, ce n'est pas deux commandes d'event distinctes comme sur 2k3.

Pour ce que tu veux faire le script de Yanfly ça devrait marcher mais tu as peut être omis quelque chose. Certains codes messages dont celui qui t'intéresse \af[x] nécessite que le script Class System soit installé.

Je te remet le script Class System ici, ça t'évitera d'avoir à le rechercher :

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
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
#==============================================================================
# 
# ▼ Yanfly Engine Ace - Class System v1.10
# -- Last Updated: 2012.01.29
# -- Level: Normal, Hard
# -- Requires: n/a
# 
#==============================================================================
 
$imported = {} if $imported.nil?
$imported["YEA-ClassSystem"] = true
 
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.08.06 - Leveling issue if class level exceeds actor level.
# 2012.01.29 - Visual Bug: Disabled classes now have faded icons.
# 2012.01.08 - Compatibility Update: Learn Skill Engine
# 2012.01.05 - Bug Fixed: Equipment no longer gets duplicated.
# 2012.01.04 - Update: Autobattle will no longer use skills not available to
#              that class for specific actors.
# 2012.01.02 - Efficiency Update.
# 2011.12.26 - Added custom command functionality.
# 2011.12.23 - Compatibility Update: Class Specifics.
# 2011.12.22 - Compatibility Update: Ace Menu Engine.
# 2011.12.20 - Compatibility Update: Class Unlock Level.
# 2011.12.19 - Started Script and Finished.
# 
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script adds the ability for your player to freely change the classes of
# actors outside of battle from a menu. When changing classes, this script
# gives the option for the developer to choose whether or not classes have
# their own levels (causing the actor's level to reset back to the class's
# level) or to maintain the current level. In addition to providing the ability
# to change classes, equipping a subclass is also doable, and the mechanics of
# having a subclass can also be defined within this script.
# 
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
# 
# -----------------------------------------------------------------------------
# Actor Notetags - These notetags go in the actors notebox in the database.
# -----------------------------------------------------------------------------
# <unlocked classes: x>
# <unlocked classes: x, x>
# This will set the default classes as unlocked for the actor. This does not
# override the default classes unlocked in the module, but instead, adds on
# to the number of unlocked classes.
# 
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
# <icon: x>
# Sets the icon representing the class to x.
# 
# <help description>
#  string
#  string
# </help description>
# Sets the text used for the help window in the class scene. Multiple lines in
# the notebox will be strung together. Use | for a line break.
# 
# -----------------------------------------------------------------------------
# Script Calls - These commands are used with script calls.
# -----------------------------------------------------------------------------
# $game_actors[x].unlock_class(y)
# This allows actor x to unlock class y, making it available for switching in
# and out in the Class scene.
# 
# $game_actors[x].remove_class(y)
# This causes actor x to remove class y from being able to switch to and from.
# If the actor is currently class y, the class will not be removed. If the
# actor's current subclass is y, the subclass will be unequipped.
# 
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
# 
#==============================================================================
 
module YEA
  module CLASS_SYSTEM
    
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - General Class Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # These are the general settings regarding the whole script. They control
    # various rules and regulations that this script undergoes. These settings
    # will also determine what a subclass can do for a player.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    CLASS_MENU_TEXT = "Class"  # Text that appears in the Main Menu.
    MAINTAIN_LEVELS = false    # Maintain through all classes. Default: false.
    DEFAULT_UNLOCKS = [ 1, 11, 21, 31]   # Classes unlocked by default.
    
    # The display between a primary class and a subclass when written in a
    # window will appear as such.
    SUBCLASS_TEXT = "%s/%s"
    
    # This adjusts the stat rate inheritance for an actor if an actor has a
    # subclass equipped. If you want to disable this, set the rate to 0.0.
    SUBCLASS_STAT_RATE = 0.20
    
    # This adds subclass skill types to the available skill types usable.
    SUBCLASS_SKILL_TYPES = true
    
    # This adds subclass weapons to equippable weapon types.
    SUBCLASS_WEAPON_TYPES = true
    
    # This adds subclass weapons to equippable armour types.
    SUBCLASS_ARMOUR_TYPES = true
    
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Class Scene Commands -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # These settings adjust how the class scene appears. Here, you can adjust
    # the command list and the order at which items appear. These are mostly
    # visual settings. Adjust them as you see fit.
    # 
    # -------------------------------------------------------------------------
    # :command         Description
    # -------------------------------------------------------------------------
    # :primary         Allows the player to change the primary class.
    # :subclass        Allows the player to change the subclass.
    # 
    # :learn_skill     Requires YEA - Learn Skill Engine
    # 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    COMMANDS =[ # The order at which the menu items are shown.
    # [ :command,   "Display"],
      [ :primary,   "Primary"],
      [:subclass,  "Subclass"],
      [:learn_skill, "Custom"],
    # [ :custom1,   "Custom1"],
    # [ :custom2,   "Custom2"],
    ] # Do not remove this.
    
    #--------------------------------------------------------------------------
    # - Status Class Commands -
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # For those who use scripts to that may produce unique effects for the
    # class menu, use this hash to manage the custom commands for the Class
    # Command Window. You can disable certain commands or prevent them from
    # appearing by using switches. If you don't wish to bind them to a switch,
    # set the proper switch to 0 for it to have no impact.
    #--------------------------------------------------------------------------
    CUSTOM_CLASS_COMMANDS ={
    # :command => [EnableSwitch, ShowSwitch, Handler Method,
      :custom1 => [           0,          0, :command_name1],
      :custom2 => [           0,          0, :command_name2],
    } # Do not remove this.
    
    # These settings adjust the colour displays for classes.
    CURRENT_CLASS_COLOUR = 17     # "Window" colour used for current class.
    SUBCLASS_COLOUR      = 4      # "Window" colour used for subclass.
    
    # This adjusts the display for class levels if MAINTAIN_LEVELS is false.
    CLASS_LEVEL     = "LV%s"      # Text display for level.
    LEVEL_FONT_SIZE = 16          # Font size used for level.
    
    # This array sets the order of how classes are ordered in the class listing
    # window. Any class ID's unlisted will not be shown.
    CLASS_ORDER = [41..999, 1..40]
    
    # This adjusts the font size for the Parameters window.
    PARAM_FONT_SIZE = 20
    
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Switch Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # These are the switches that govern whether or not certain menu items will
    # appear and/or will be enabled. By binding them to a Switch, you can just
    # set the Switch ON/OFF to show/hide or enable/disable a menu command. If
    # you do not wish to use this feature, set these commands to 0.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    SWITCH_SHOW_CLASS      = 0    # Switch that shows Class in Main Menu.
    SWITCH_ENABLE_CLASS    = 0    # Switch that enables Class in Main Menu.
    SWITCH_SHOW_PRIMARY    = 0    # Switch that shows Subclass in Class Menu.
    SWITCH_ENABLE_PRIMARY  = 0    # Switch that enables Subclass in Class Menu.
    SWITCH_SHOW_SUBCLASS   = 0    # Switch that shows Subclass in Class Menu.
    SWITCH_ENABLE_SUBCLASS = 0    # Switch that enables Subclass in Class Menu.
    
  end # CLASS_SYSTEM
end # YEA
 
#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================
 
module YEA
  module CLASS_SYSTEM
    module_function
    #--------------------------------------------------------------------------
    # convert_integer_array
    #--------------------------------------------------------------------------
    def convert_integer_array(array)
      result = []
      array.each { |i|
        case i
        when Range; result |= i.to_a
        when Integer; result |= [i]
        end }
      return result
    end
    #--------------------------------------------------------------------------
    # converted_contants
    #--------------------------------------------------------------------------
    DEFAULT_UNLOCKS = convert_integer_array(DEFAULT_UNLOCKS)
    CLASS_ORDER = convert_integer_array(CLASS_ORDER)
  end # CLASS_SYSTEM
  module REGEXP
  module ACTOR
    
    UNLOCKED_CLASSES = 
      /<(?:UNLOCKED_CLASSES|unlocked classes):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
    
  end # ACTOR
  module CLASS
    
    ICON_INDEX = /<(?:ICON_INDEX|icon index|icon):[ ](\d+)>/i
    HELP_DESCRIPTION_ON  = /<(?:HELP_DESCRIPTION|help description)>/i
    HELP_DESCRIPTION_OFF = /<\/(?:HELP_DESCRIPTION|help description)>/i
    
  end # CLASS
  end # REGEXP
end # YEA
 
#==============================================================================
# ■ Switch
#==============================================================================
 
module Switch
  
  #--------------------------------------------------------------------------
  # self.class_show
  #--------------------------------------------------------------------------
  def self.class_show
    return true if YEA::CLASS_SYSTEM::SWITCH_SHOW_CLASS <= 0
    return $game_switches[YEA::CLASS_SYSTEM::SWITCH_SHOW_CLASS]
  end
  
  #--------------------------------------------------------------------------
  # self.class_enable
  #--------------------------------------------------------------------------
  def self.class_enable
    return true if YEA::CLASS_SYSTEM::SWITCH_ENABLE_CLASS <= 0
    return $game_switches[YEA::CLASS_SYSTEM::SWITCH_ENABLE_CLASS]
  end
  
  #--------------------------------------------------------------------------
  # self.primary_show
  #--------------------------------------------------------------------------
  def self.primary_show
    return true if YEA::CLASS_SYSTEM::SWITCH_SHOW_PRIMARY <= 0
    return $game_switches[YEA::CLASS_SYSTEM::SWITCH_SHOW_PRIMARY]
  end
  
  #--------------------------------------------------------------------------
  # self.primary_enable
  #--------------------------------------------------------------------------
  def self.primary_enable
    return true if YEA::CLASS_SYSTEM::SWITCH_ENABLE_PRIMARY <= 0
    return $game_switches[YEA::CLASS_SYSTEM::SWITCH_ENABLE_PRIMARY]
  end
  
  #--------------------------------------------------------------------------
  # self.subclass_show
  #--------------------------------------------------------------------------
  def self.subclass_show
    return true if YEA::CLASS_SYSTEM::SWITCH_SHOW_SUBCLASS <= 0
    return $game_switches[YEA::CLASS_SYSTEM::SWITCH_SHOW_SUBCLASS]
  end
  
  #--------------------------------------------------------------------------
  # self.subclass_enable
  #--------------------------------------------------------------------------
  def self.subclass_enable
    return true if YEA::CLASS_SYSTEM::SWITCH_ENABLE_SUBCLASS <= 0
    return $game_switches[YEA::CLASS_SYSTEM::SWITCH_ENABLE_SUBCLASS]
  end
    
end # Switch
 
#==============================================================================
# ■ Numeric
#==============================================================================
 
class Numeric
  
  #--------------------------------------------------------------------------
  # new method: group_digits
  #--------------------------------------------------------------------------
  unless $imported["YEA-CoreEngine"]
  def group; return self.to_s; end
  end # $imported["YEA-CoreEngine"]
    
end # Numeric
 
#==============================================================================
# ■ DataManager
#==============================================================================
 
module DataManager
  
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_cs load_database; end
  def self.load_database
    load_database_cs
    load_notetags_cs
  end
  
  #--------------------------------------------------------------------------
  # new method: load_notetags_cs
  #--------------------------------------------------------------------------
  def self.load_notetags_cs
    groups = [$data_actors, $data_classes]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_cs
      end
    end
  end
  
end # DataManager
 
#==============================================================================
# ■ RPG::Actor
#==============================================================================
 
class RPG::Actor < RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :unlocked_classes
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_cs
  #--------------------------------------------------------------------------
  def load_notetags_cs
    @unlocked_classes = []
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::ACTOR::UNLOCKED_CLASSES
        $1.scan(/\d+/).each { |num| 
        @unlocked_classes.push(num.to_i) if num.to_i > 0 }
      #---
      end
    } # self.note.split
    #---
  end
  
end # RPG::Actor
 
#==============================================================================
# ■ RPG::Class
#==============================================================================
 
class RPG::Class < RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :icon_index
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_cs
  #--------------------------------------------------------------------------
  def load_notetags_cs
    @icon_index = 0
    @help_description_on = false
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::CLASS::ICON_INDEX
        @icon_index = $1.to_i
      #---
      when YEA::REGEXP::CLASS::HELP_DESCRIPTION_ON
        @help_description_on = true
      when YEA::REGEXP::CLASS::HELP_DESCRIPTION_OFF
        @help_description_on = false
      #---
      else
        @description += line.to_s if @help_description_on
      end
    } # self.note.split
    #---
    @description.gsub!(/[|]/i) { "\n" }
  end
  
end # RPG::Class
 
#==============================================================================
# ■ Game_Temp
#==============================================================================
 
class Game_Temp
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :scene_class_index
  attr_accessor :scene_class_oy
  
end # Game_Temp
 
#==============================================================================
# ■ Game_Action
#==============================================================================
 
class Game_Action
  
  #--------------------------------------------------------------------------
  # alias method: valid?
  #--------------------------------------------------------------------------
  alias game_action_valid_cs valid?
  def valid?
    return false if check_auto_battle_class
    return game_action_valid_cs
  end
  
  #--------------------------------------------------------------------------
  # new method: check_auto_battle_class
  #--------------------------------------------------------------------------
  def check_auto_battle_class
    return false unless subject.actor?
    return false unless subject.auto_battle?
    return false if item.nil?
    return false if subject.added_skill_types.include?(item.stype_id)
    return false if item.id == subject.attack_skill_id
    return true
  end
  
end # Game_Action
 
#==============================================================================
# ■ Game_BattlerBase
#==============================================================================
 
class Game_BattlerBase
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :temp_flag
  
  #--------------------------------------------------------------------------
  # alias method: added_skill_types
  #--------------------------------------------------------------------------
  alias game_battlerbase_added_skill_types_cs added_skill_types
  def added_skill_types
    result = game_battlerbase_added_skill_types_cs
    result |= subclass_skill_types
    return result
  end
  
  #--------------------------------------------------------------------------
  # new method: subclass_skill_types
  #--------------------------------------------------------------------------
  def subclass_skill_types; return []; end
  
  #--------------------------------------------------------------------------
  # alias method: equip_wtype_ok?
  #--------------------------------------------------------------------------
  alias game_battlerbase_equip_wtype_ok_cs equip_wtype_ok?
  def equip_wtype_ok?(wtype_id)
    return true if subclass_equip_wtype?(wtype_id)
    return game_battlerbase_equip_wtype_ok_cs(wtype_id)
  end
  
  #--------------------------------------------------------------------------
  # new method: subclass_equip_wtype?
  #--------------------------------------------------------------------------
  def subclass_equip_wtype?(wtype_id); return false; end
  
  #--------------------------------------------------------------------------
  # alias method: equip_atype_ok?
  #--------------------------------------------------------------------------
  alias game_battlerbase_equip_atype_ok_cs equip_atype_ok?
  def equip_atype_ok?(atype_id)
    return true if subclass_equip_atype?(atype_id)
    return game_battlerbase_equip_atype_ok_cs(atype_id)
  end
  
  #--------------------------------------------------------------------------
  # new method: subclass_equip_atype?
  #--------------------------------------------------------------------------
  def subclass_equip_atype?(atype_id); return false; end
  
end # Game_BattlerBase
 
#==============================================================================
# ■ Game_Actor
#==============================================================================
 
class Game_Actor < Game_Battler
  
  #--------------------------------------------------------------------------
  # alias method: setup
  #--------------------------------------------------------------------------
  alias game_actor_setup_cs setup
  def setup(actor_id)
    game_actor_setup_cs(actor_id)
    init_unlocked_classes
    init_subclass
  end
  
  #--------------------------------------------------------------------------
  # new method: init_unlocked_classes
  #--------------------------------------------------------------------------
  def init_unlocked_classes
    @unlocked_classes = actor.unlocked_classes.clone
    @unlocked_classes.push(@class_id) if !@unlocked_classes.include?(@class_id)
    @unlocked_classes.sort!
  end
  
  #--------------------------------------------------------------------------
  # new method: init_subclass
  #--------------------------------------------------------------------------
  def init_subclass
    @subclass_id = 0
  end
  
  #--------------------------------------------------------------------------
  # new method: unlocked_classes
  #--------------------------------------------------------------------------
  def unlocked_classes
    init_unlocked_classes if @unlocked_classes.nil?
    return @unlocked_classes
  end
  
  #--------------------------------------------------------------------------
  # new method: unlock_class
  #--------------------------------------------------------------------------
  def unlock_class(class_id)
    init_unlocked_classes if @unlocked_classes.nil?
    return if @unlocked_classes.include?(class_id)
    @unlocked_classes.push(class_id)
    learn_class_skills(class_id)
  end
  
  #--------------------------------------------------------------------------
  # new method: remove_class
  #--------------------------------------------------------------------------
  def remove_class(class_id)
    init_unlocked_classes if @unlocked_classes.nil?
    return if class_id == @class_id
    @unlocked_classes.delete(class_id)
    @subclass_id = 0 if class_id == @subclass_id
    refresh
  end
  
  #--------------------------------------------------------------------------
  # new method: subclass
  #--------------------------------------------------------------------------
  def subclass
    init_subclass if @subclass_id.nil?
    return $data_classes[@subclass_id]
  end
  
  #--------------------------------------------------------------------------
  # alias method: change_class
  #--------------------------------------------------------------------------
  alias game_actor_change_class_cs change_class
  def change_class(class_id, keep_exp = false)
    @subclass_id = 0 if @subclass_id == class_id
    game_actor_change_class_cs(class_id, keep_exp)
    learn_class_skills(class_id)
    unlock_class(class_id)
  end
  
  #--------------------------------------------------------------------------
  # new method: learn_class_skills
  #--------------------------------------------------------------------------
  def learn_class_skills(class_id)
    return if class_id <= 0
    return if $data_classes[class_id].nil?
    $data_classes[class_id].learnings.each do |learning|
      learn_skill(learning.skill_id) if learning.level == class_level(class_id)
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: change_subclass
  #--------------------------------------------------------------------------
  def change_subclass(class_id)
    return if class_id == @class_id
    unlock_class(class_id)
    @subclass_id = @subclass_id == class_id ? 0 : class_id
    learn_class_skills(@subclass_id)
    refresh
  end
        #————————————————————————–
        # new method: class_level Edited by DisturbedInside
        #————————————————————————–
        def class_level(class_id)
                return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
                        temp_class = $data_classes[class_id]
                        @exp[class_id] = 0 if @exp[class_id].nil?
                        #declare a max level (using EXP)
                        #If you can’t find it, go to the class database and select exp curve
                        #then switch view to total at the top
                        @exp[max_level] = 2547133 #This is the value to change. It declares a max level
                        #You need to calculate how much exp for max level
                        #Do it manually if using Yanfly-Adjusting Limits
                        #To calculate max level exp if using Yanfly-adjusting limits is all math!!
 
                        # Level 99 = 2547133
                        # to calculate past there…. have to add on multiples of 50744
                        # Level 110 = 3156061
                        # To go from 99 -> 110 have to add on 12 multiples of 50744.
                        n = 1                   
                        loop do
                                break if temp_class.exp_for_level(n+1) > @exp[class_id]
                                n += 1
                                #add a restriction to “kick out” of loop if exp exceeds max level exp
                                break if temp_class.exp_for_level(n+1) > @exp[max_level]
                        end
                return n
        end
  
  #--------------------------------------------------------------------------
  # new method: subclass_level
  #--------------------------------------------------------------------------
  def subclass_level
    return 0 if @subclass_id == 0
    return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
    return class_level(@subclass_id)
  end
  
  #--------------------------------------------------------------------------
  # alias method: param_base
  #--------------------------------------------------------------------------
  alias game_actor_param_base_cs param_base
  def param_base(param_id)
    result = game_actor_param_base_cs(param_id)
    unless subclass.nil?
      subclass_rate = YEA::CLASS_SYSTEM::SUBCLASS_STAT_RATE
      slevel = subclass_level
      result += subclass.params[param_id, slevel] * subclass_rate
    end
    return result.to_i
  end
  
  #--------------------------------------------------------------------------
  # new method: subclass_skill_types
  #--------------------------------------------------------------------------
  def subclass_skill_types
    return [] unless YEA::CLASS_SYSTEM::SUBCLASS_SKILL_TYPES
    return [] if subclass.nil?
    array = []
    for feature in subclass.features
      next unless feature.code == FEATURE_STYPE_ADD
      next if features_set(FEATURE_STYPE_ADD).include?(feature.data_id)
      array.push(feature.data_id)
    end
    return array
  end
  
  #--------------------------------------------------------------------------
  # new method: subclass_equip_wtype?
  #--------------------------------------------------------------------------
  def subclass_equip_wtype?(wtype_id)
    return false unless YEA::CLASS_SYSTEM::SUBCLASS_WEAPON_TYPES
    return false if subclass.nil?
    for feature in subclass.features
      next unless feature.code == FEATURE_EQUIP_WTYPE
      return true if wtype_id == feature.data_id
    end
    return super
  end
  
  #--------------------------------------------------------------------------
  # new method: subclass_equip_atype?
  #--------------------------------------------------------------------------
  def subclass_equip_atype?(atype_id)
    return false unless YEA::CLASS_SYSTEM::SUBCLASS_ARMOUR_TYPES
    return false if subclass.nil?
    for feature in subclass.features
      next unless feature.code == FEATURE_EQUIP_ATYPE
      return true if atype_id == feature.data_id
    end
    return super
  end
  
  #--------------------------------------------------------------------------
  # alias method: release_unequippable_items
  #--------------------------------------------------------------------------
  alias game_actor_release_unequippable_items_cs release_unequippable_items
  def release_unequippable_items(item_gain = true)
    item_gain = false if @temp_flag
    game_actor_release_unequippable_items_cs(item_gain)
  end
  
end # Game_Actor
 
#==============================================================================
# ■ Game_Interpreter
#==============================================================================
 
class Game_Interpreter
  
  #--------------------------------------------------------------------------
  # overwrite method: command_321
  #--------------------------------------------------------------------------
  def command_321
    actor = $game_actors[@params[0]]
    if actor && $data_classes[@params[1]]
      maintain = YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
      actor.change_class(@params[1], maintain)
    end
  end
  
end # Game_Interpreter
 
#==============================================================================
# ■ Window_Base
#==============================================================================
 
class Window_Base < Window
  
  #--------------------------------------------------------------------------
  # overwrite method: draw_actor_class
  #--------------------------------------------------------------------------
  def draw_actor_class(actor, x, y, width = 112)
    change_color(normal_color)
    if actor.subclass.nil?
      text = actor.class.name
    else
      fmt = YEA::CLASS_SYSTEM::SUBCLASS_TEXT
      text = sprintf(fmt, actor.class.name, actor.subclass.name)
    end
    draw_text(x, y, width, line_height, text)
  end
  
end # Window_Base
 
#==============================================================================
# ■ Window_MenuCommand
#==============================================================================
 
class Window_MenuCommand < Window_Command
  
  #--------------------------------------------------------------------------
  # alias method: add_formation_command
  #--------------------------------------------------------------------------
  alias window_menucommand_add_formation_command_cs add_formation_command
  def add_formation_command
    add_class_command unless $imported["YEA-AceMenuEngine"]
    window_menucommand_add_formation_command_cs
  end
  
  #--------------------------------------------------------------------------
  # new method: add_class_command
  #--------------------------------------------------------------------------
  def add_class_command
    return unless Switch.class_show
    text = YEA::CLASS_SYSTEM::CLASS_MENU_TEXT
    add_command(text, :class, Switch.class_enable)
  end
  
end # Window_MenuCommand
 
#==============================================================================
# ■ Window_ClassCommand
#==============================================================================
 
class Window_ClassCommand < Window_Command
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y)
    @actor = nil
  end
  
  #--------------------------------------------------------------------------
  # ● ウィンドウ幅の取得
  #--------------------------------------------------------------------------
  def window_width; return 160; end
  
  #--------------------------------------------------------------------------
  # actor=
  #--------------------------------------------------------------------------
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
  
  #--------------------------------------------------------------------------
  # item_window=
  #--------------------------------------------------------------------------
  def item_window=(window)
    @item_window = window
  end
  
  #--------------------------------------------------------------------------
  # visible_line_number
  #--------------------------------------------------------------------------
  def visible_line_number; return 4; end
  
  #--------------------------------------------------------------------------
  # make_command_list
  #--------------------------------------------------------------------------
  def make_command_list
    return if @actor.nil?
    for command in YEA::CLASS_SYSTEM::COMMANDS
      case command[0]
      when :primary
        next unless Switch.primary_show
        add_command(command[1], command[0], Switch.primary_enable)
      when :subclass
        next unless Switch.subclass_show
        add_command(command[1], command[0], Switch.subclass_enable)
      when :learn_skill
        next unless $imported["YEA-LearnSkillEngine"]
        add_learn_skill_command
      else
        process_custom_command(command)
      end
    end
    if !$game_temp.scene_class_index.nil?
      select($game_temp.scene_class_index)
      self.oy = $game_temp.scene_class_oy
    end
    $game_temp.scene_class_index = nil
    $game_temp.scene_class_oy = nil
  end
  
  #--------------------------------------------------------------------------
  # process_ok
  #--------------------------------------------------------------------------
  def process_ok
    $game_temp.scene_class_index = index
    $game_temp.scene_class_oy = self.oy
    super
  end
  
  #--------------------------------------------------------------------------
  # process_custom_command
  #--------------------------------------------------------------------------
  def process_custom_command(command)
    return unless YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS.include?(command[0])
    show = YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS[command[0]][1]
    continue = show <= 0 ? true : $game_switches[show]
    return unless continue
    text = command[1]
    switch = YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS[command[0]][0]
    enabled = switch <= 0 ? true : $game_switches[switch]
    add_command(text, command[0], enabled)
  end
  
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    super
    update_visible_windows
  end
  
  #--------------------------------------------------------------------------
  # update_visible_windows
  #--------------------------------------------------------------------------
  def update_visible_windows
    return if @current_index == current_symbol
    @current_index = current_symbol
    @item_window.refresh unless @item_window.nil?
  end
  
  #--------------------------------------------------------------------------
  # add_learn_skill_command
  #--------------------------------------------------------------------------
  def add_learn_skill_command
    return unless Switch.show_learn_skill
    name = YEA::LEARN_SKILL::COMMAND_NAME
    add_command(name, :learn_skill, true)
  end
  
end # Window_ClassCommand
 
#==============================================================================
# ■ Window_ClassStatus
#==============================================================================
 
class Window_ClassStatus < Window_Base
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(dx, dy)
    super(dx, dy, window_width, fitting_height(4))
    @actor = nil
  end
  
  #--------------------------------------------------------------------------
  # window_width
  #--------------------------------------------------------------------------
  def window_width; Graphics.width - 160; end
  
  #--------------------------------------------------------------------------
  # actor=
  #--------------------------------------------------------------------------
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
  
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    return if @actor.nil?
    draw_actor_face(@actor, 0, 0)
    draw_actor_simple_status(@actor, 108, line_height / 2)
  end
  
end # Window_ClassStatus
 
#==============================================================================
# ■ Window_ClassParam
#==============================================================================
 
class Window_ClassParam < Window_Base
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(dx, dy)
    super(dx, dy, window_width, Graphics.height - dy)
    @actor = nil
    @temp_actor = nil
    refresh
  end
  
  #--------------------------------------------------------------------------
  # window_width
  #--------------------------------------------------------------------------
  def window_width; return Graphics.width * 2 / 5; end
  
  #--------------------------------------------------------------------------
  # actor=
  #--------------------------------------------------------------------------
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
  
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    8.times {|i| draw_item(0, line_height * i, i) }
  end
  
  #--------------------------------------------------------------------------
  # set_temp_actor
  #--------------------------------------------------------------------------
  def set_temp_actor(temp_actor)
    return if @temp_actor == temp_actor
    @temp_actor = temp_actor
    refresh
  end
  
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(dx, dy, param_id)
    draw_background_colour(dx, dy)
    draw_param_name(dx + 4, dy, param_id)
    draw_current_param(dx + 4, dy, param_id) if @actor
    drx = (contents.width + 22) / 2
    draw_right_arrow(drx, dy)
    draw_new_param(drx + 22, dy, param_id) if @temp_actor
    reset_font_settings
  end
  
  #--------------------------------------------------------------------------
  # draw_background_colour
  #--------------------------------------------------------------------------
  def draw_background_colour(dx, dy)
    colour = Color.new(0, 0, 0, translucent_alpha/2)
    rect = Rect.new(dx+1, dy+1, contents.width - 2, line_height - 2)
    contents.fill_rect(rect, colour)
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: draw_param_name
  #--------------------------------------------------------------------------
  def draw_param_name(dx, dy, param_id)
    contents.font.size = YEA::CLASS_SYSTEM::PARAM_FONT_SIZE
    change_color(system_color)
    draw_text(dx, dy, contents.width, line_height, Vocab::param(param_id))
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: draw_current_param
  #--------------------------------------------------------------------------
  def draw_current_param(dx, dy, param_id)
    change_color(normal_color)
    dw = (contents.width + 22) / 2
    draw_text(0, dy, dw, line_height, @actor.param(param_id).group, 2)
    reset_font_settings
  end
  
  #--------------------------------------------------------------------------
  # draw_right_arrow
  #--------------------------------------------------------------------------
  def draw_right_arrow(x, y)
    change_color(system_color)
    draw_text(x, y, 22, line_height, "→", 1)
  end
  
  #--------------------------------------------------------------------------
  # draw_new_param
  #--------------------------------------------------------------------------
  def draw_new_param(dx, dy, param_id)
    contents.font.size = YEA::CLASS_SYSTEM::PARAM_FONT_SIZE
    new_value = @temp_actor.param(param_id)
    change_color(param_change_color(new_value - @actor.param(param_id)))
    draw_text(0, dy, contents.width-4, line_height, new_value.group, 2)
    reset_font_settings
  end
  
end # Window_ClassParam
 
#==============================================================================
# ■ Window_ClassList
#==============================================================================
 
class Window_ClassList < Window_Selectable
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(dx, dy)
    dw = Graphics.width - (Graphics.width * 2 / 5)
    dh = Graphics.height - dy
    super(dx, dy, dw, dh)
    @actor = nil
    @command_window = nil
    @status_window
    @data = []
  end
  
  #--------------------------------------------------------------------------
  # actor=
  #--------------------------------------------------------------------------
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    @last_item = nil
    refresh
    self.oy = 0
  end
  
  #--------------------------------------------------------------------------
  # command_window=
  #--------------------------------------------------------------------------
  def command_window=(command_window)
    @command_window = command_window
  end
  
  #--------------------------------------------------------------------------
  # status_window=
  #--------------------------------------------------------------------------
  def status_window=(status_window)
    @status_window = status_window
  end
  
  #--------------------------------------------------------------------------
  # item_max
  #--------------------------------------------------------------------------
  def item_max; return @data ? @data.size : 1; end
  
  #--------------------------------------------------------------------------
  # item
  #--------------------------------------------------------------------------
  def item; return @data && index >= 0 ? @data[index] : nil; end
  
  #--------------------------------------------------------------------------
  # current_item_enabled?
  #--------------------------------------------------------------------------
  def current_item_enabled?; return enable?(@data[index]); end
  
  #--------------------------------------------------------------------------
  # include?
  #--------------------------------------------------------------------------
  def include?(item)
    return true if YEA::CLASS_SYSTEM::DEFAULT_UNLOCKS.include?(item.id)
    return @actor.unlocked_classes.include?(item.id)
  end
  
  #--------------------------------------------------------------------------
  # enable?
  #--------------------------------------------------------------------------
  def enable?(item)
    return false if item == @actor.class
    return true
  end
  
  #--------------------------------------------------------------------------
  # make_item_list
  #--------------------------------------------------------------------------
  def make_item_list
    @data = []
    for class_id in YEA::CLASS_SYSTEM::CLASS_ORDER
      next if $data_classes[class_id].nil?
      item = $data_classes[class_id]
      @data.push(item) if include?(item)
    end
  end
  
  #--------------------------------------------------------------------------
  # select_last
  #--------------------------------------------------------------------------
  def select_last
    case @command_window.current_symbol
    when :primary
      select(@data.index(@actor.class))
    when :subclass
      select(0) if @actor.subclass.nil?
      select(@data.index(@actor.subclass)) unless @actor.subclass.nil?
    else
      select(0)
    end
  end
  
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    return if item.nil?
    rect = item_rect(index)
    rect.width -= 4
    reset_font_settings
    set_item_colour(item)
    draw_class_icon(item, rect)
    draw_class_name(item, rect)
    draw_class_level(item, rect)
  end
  
  #--------------------------------------------------------------------------
  # set_item_colour
  #--------------------------------------------------------------------------
  def set_item_colour(item)
    if item == @actor.class
      change_color(text_color(YEA::CLASS_SYSTEM::CURRENT_CLASS_COLOUR))
    elsif item == @actor.subclass
      change_color(text_color(YEA::CLASS_SYSTEM::SUBCLASS_COLOUR))
    else
      change_color(normal_color, enable?(item))
    end
  end
  
  #--------------------------------------------------------------------------
  # draw_class_icon
  #--------------------------------------------------------------------------
  def draw_class_icon(item, rect)
    icon = item.icon_index
    draw_icon(icon, rect.x, rect.y, enable?(item))
  end
  
  #--------------------------------------------------------------------------
  # draw_class_name
  #--------------------------------------------------------------------------
  def draw_class_name(item, rect)
    text = item.name
    draw_text(24, rect.y, rect.width-24, line_height, text)
  end
  
  #--------------------------------------------------------------------------
  # draw_class_level
  #--------------------------------------------------------------------------
  def draw_class_level(item, rect)
    return if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
    return if @actor.nil?
    level = @actor.class_level(item.id)
    contents.font.size = YEA::CLASS_SYSTEM::LEVEL_FONT_SIZE
    text = sprintf(YEA::CLASS_SYSTEM::CLASS_LEVEL, level.group)
    draw_text(rect, text, 2)
  end
  
  #--------------------------------------------------------------------------
  # update_help
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_item(item)
    return if @actor.nil?
    return if @status_window.nil?
    update_param_window
  end
  
  #--------------------------------------------------------------------------
  # update_param_window
  #--------------------------------------------------------------------------
  def update_param_window
    return if @last_item == item
    @last_item = item
    class_id = item.nil? ? @actor.class_id : item.id
    temp_actor = Marshal.load(Marshal.dump(@actor))
    temp_actor.temp_flag = true
    case @command_window.current_symbol
    when :primary
      temp_actor.change_class(class_id, YEA::CLASS_SYSTEM::MAINTAIN_LEVELS)
    when :subclass
      temp_actor.change_subclass(class_id)
    end
    @status_window.set_temp_actor(temp_actor)
  end
  
  #--------------------------------------------------------------------------
  # update_class
  #--------------------------------------------------------------------------
  def update_class
    @last_item = nil
    update_help
    refresh
    activate
  end
  
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    make_item_list
    create_contents
    draw_all_items
  end
  
end # Window_ClassList
 
#==============================================================================
# ■ Scene_Menu
#==============================================================================
 
class Scene_Menu < Scene_MenuBase
  
  #--------------------------------------------------------------------------
  # alias method: create_command_window
  #--------------------------------------------------------------------------
  alias scene_menu_create_command_window_cs create_command_window
  def create_command_window
    scene_menu_create_command_window_cs
    @command_window.set_handler(:class, method(:command_personal))
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_personal_ok
  #--------------------------------------------------------------------------
  alias scene_menu_on_personal_ok_cs on_personal_ok
  def on_personal_ok
    case @command_window.current_symbol
    when :class
      SceneManager.call(Scene_Class)
    else
      scene_menu_on_personal_ok_cs
    end
  end
  
end # Scene_Menu
 
#==============================================================================
# ■ Scene_Class
#==============================================================================
 
class Scene_Class < Scene_MenuBase
  
  #--------------------------------------------------------------------------
  # start
  #--------------------------------------------------------------------------
  def start
    super
    create_help_window
    create_command_window
    create_status_window
    create_param_window
    create_item_window
    relocate_windows
  end
  
  #--------------------------------------------------------------------------
  # create_command_window
  #--------------------------------------------------------------------------
  def create_command_window
    wy = @help_window.height
    @command_window = Window_ClassCommand.new(0, wy)
    @command_window.viewport = @viewport
    @command_window.help_window = @help_window
    @command_window.actor = @actor
    @command_window.set_handler(:cancel,   method(:return_scene))
    @command_window.set_handler(:primary,  method(:command_class_change))
    @command_window.set_handler(:subclass, method(:command_class_change))
    process_custom_class_commands
    return if $game_party.in_battle
    @command_window.set_handler(:pagedown, method(:next_actor))
    @command_window.set_handler(:pageup,   method(:prev_actor))
    @command_window.set_handler(:learn_skill, method(:command_learn_skill))
  end
  
  #--------------------------------------------------------------------------
  # process_custom_class_commands
  #--------------------------------------------------------------------------
  def process_custom_class_commands
    for command in YEA::CLASS_SYSTEM::COMMANDS
      next unless YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS.include?(command[0])
      called_method = YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS[command[0]][2]
      @command_window.set_handler(command[0], method(called_method))
    end
  end
  
  #--------------------------------------------------------------------------
  # create_status_window
  #--------------------------------------------------------------------------
  def create_status_window
    wy = @help_window.height
    @status_window = Window_ClassStatus.new(@command_window.width, wy)
    @status_window.viewport = @viewport
    @status_window.actor = @actor
  end
  
  #--------------------------------------------------------------------------
  # create_param_window
  #--------------------------------------------------------------------------
  def create_param_window
    dx = Graphics.width - (Graphics.width * 2 / 5)
    dy = @status_window.y + @status_window.height
    @param_window = Window_ClassParam.new(dx, dy)
    @param_window.viewport = @viewport
    @param_window.actor = @actor
  end
  
  #--------------------------------------------------------------------------
  # create_item_window
  #--------------------------------------------------------------------------
  def create_item_window
    dy = @status_window.y + @status_window.height
    @item_window = Window_ClassList.new(0, dy)
    @item_window.help_window = @help_window
    @item_window.command_window = @command_window
    @item_window.status_window = @param_window
    @item_window.viewport = @viewport
    @item_window.actor = @actor
    @command_window.item_window = @item_window
    @item_window.set_handler(:ok,     method(:on_class_ok))
    @item_window.set_handler(:cancel, method(:on_class_cancel))
  end
  
  #--------------------------------------------------------------------------
  # relocate_windows
  #--------------------------------------------------------------------------
  def relocate_windows
    return unless $imported["YEA-AceMenuEngine"]
    case Menu.help_window_location
    when 0 # Top
      @help_window.y = 0
      @command_window.y = @help_window.height
      @param_window.y = @command_window.y + @command_window.height
    when 1 # Middle
      @command_window.y = 0
      @help_window.y = @command_window.height
      @param_window.y = @help_window.y + @help_window.height
    else # Bottom
      @command_window.y = 0
      @param_window.y = @command_window.height
      @help_window.y = @param_window.y + @param_window.height
    end
    @status_window.y = @command_window.y
    @item_window.y = @param_window.y
  end
  
  #--------------------------------------------------------------------------
  # on_actor_change
  #--------------------------------------------------------------------------
  def on_actor_change
    @command_window.actor = @actor
    @status_window.actor = @actor
    @param_window.actor = @actor
    @item_window.actor = @actor
    @command_window.activate
  end
  
  #--------------------------------------------------------------------------
  # command_class_change
  #--------------------------------------------------------------------------
  def command_class_change
    @item_window.activate
    @item_window.select_last
  end
  
  #--------------------------------------------------------------------------
  # on_class_cancel
  #--------------------------------------------------------------------------
  def on_class_cancel
    @item_window.unselect
    @command_window.activate
    @param_window.set_temp_actor(nil)
  end
  
  #--------------------------------------------------------------------------
  # on_class_ok
  #--------------------------------------------------------------------------
  def on_class_ok
    Sound.play_equip
    class_id = @item_window.item.id
    maintain = YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
    hp = @actor.hp * 1.0 / @actor.mhp
    mp = @actor.mp * 1.0 / [@actor.mmp, 1].max
    case @command_window.current_symbol
    when :primary
      @actor.change_class(class_id, maintain)
    when :subclass
      @actor.change_subclass(class_id)
    else
      @item_window.activate
      return
    end
    @actor.hp = (@actor.mhp * hp).to_i
    @actor.mp = (@actor.mmp * mp).to_i
    @status_window.refresh
    @item_window.update_class
  end
  
  #--------------------------------------------------------------------------
  # new method: command_learn_skill
  #--------------------------------------------------------------------------
  def command_learn_skill
    return unless $imported["YEA-LearnSkillEngine"]
    SceneManager.call(Scene_LearnSkill)
  end
  
  #--------------------------------------------------------------------------
  # command_name1
  #--------------------------------------------------------------------------
  def command_name1
    # Do nothing.
  end
  
  #--------------------------------------------------------------------------
  # command_name2
  #--------------------------------------------------------------------------
  def command_name2
    # Do nothing.
  end
  
end # Scene_Class
 
#==============================================================================
# 
# ▼ End of File
# 
#==============================================================================





el leopo - posté le 02/05/2016 à 09:59:53 (75 messages postés)

❤ 0

Ah mince désolé , faut que je me mette à jour .

Faites comme si j'avais rien dis :)


Noein - posté le 02/05/2016 à 11:32:34 (155 messages postés)

❤ 0

J'apporte quelques informations supplémentaires parce que même en utilisant le code \af[x] ça n'automatisera pas plus ton système. Dans le code message x correspond à la position du personnage dans la base de données et du coup ça va afficher la face correspondante (définie elle aussi dans la base de donnée). Au préalable il faut que pour chacun de tes skins, que tu crées un personnage dans la base de donnée avec le charset et faceset correspond. Ensuite tu crées une variable que tu peux appeler Choix Skin dont la valeur devra être celle de la position du personnage dans la base de données. Dans tes évènements qui permettent de sélectionner un skin il te suffit de rendre égale ta variable Choix Skin à la position du personnage dans ta base de données.

Pour que le faceset voulu s'affiche dans tes messages, il suffit d'écrire \af[\V[n]], n étant l'ID de ta variable Choix Skin.


zleekezl - posté le 02/05/2016 à 19:21:45 (9 messages postés)

❤ 0

Dites moi le script de Yanfly, il donne un lien vers sont script... c'est toute la page qu'il faut copier ou une parti de la page ?

Index du forum > Entraide > [RESOLU] [Rpg maker vx ace] Faceset qui s'adapte selon le héros choisi

repondre up

Suite à de nombreux abus, le post en invités a été désactivé. Veuillez vous inscrire si vous souhaitez participer à la conversation.

Haut de page

Merci de ne pas reproduire le contenu de ce site sans autorisation.
Contacter l'équipe - Mentions légales

Plan du site

Communauté: Accueil | Forum | Chat | Commentaires | News | Flash-news | Screen de la semaine | Sorties | Tests | Gaming-Live | Interviews | Galerie | OST | Blogs | Recherche
Apprendre: Visite guidée | RPG Maker 95 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker MV | Tutoriels | Guides | Making-of
Télécharger: Programmes | Scripts/Plugins | Ressources graphiques / sonores | Packs de ressources | Midis | Eléments séparés | Sprites
Jeux: Au hasard | Notre sélection | Sélection des membres | Tous les jeux | Jeux complets | Le cimetière | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Proposer
Ressources RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
Ressources RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
Ressources RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes
Ressources RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis
Archives: Palmarès | L'Annuaire | Livre d'or | Le Wiki | Divers