-
Notifications
You must be signed in to change notification settings - Fork 2
/
chinaset-mtraddon.nml
2165 lines (1708 loc) · 61.2 KB
/
chinaset-mtraddon.nml
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
# 0 "chinaset-mtraddon.pnml"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "chinaset-mtraddon.pnml"
// Define the GRF
# 1 "src/header.pnml" 1
grf {
grfid: "\5F\5F\03\02";
name: string(STR_GRF_NAME);
desc: string(STR_DESC_4, string(STR_GRF_DESC), string(STR_GRF_DESC_README),string(STR_GRF_DESC_MTR));
url: string(STR_GRF_URL);
version: 3;
min_compatible_version: 0;
param 0 {
param_loading_speed {
type: int;
name: string(STR_PARAM_LOADING_SPEED);
desc: string(STR_PARAM_LOADING_SPEED_DESC);
min_value: 0;
max_value: 3;
def_value: 1;
names: {
0: string(STR_PARAM_PERCENT_50);
1: string(STR_PARAM_PERCENT_100);
2: string(STR_PARAM_PERCENT_200);
3: string(STR_PARAM_PERCENT_400);
};
}
}
param 1 {
param_purchase_cost {
type: int;
name: string(STR_PARAM_PURCHASE_COST);
desc: string(STR_PARAM_PURCHASE_COST_DESC);
min_value: 0;
max_value: 8;
def_value: 2;
names: {
0: string(STR_PARAM_PERCENT_6);
1: string(STR_PARAM_PERCENT_13);
2: string(STR_PARAM_PERCENT_25);
3: string(STR_PARAM_PERCENT_50);
4: string(STR_PARAM_PERCENT_100);
5: string(STR_PARAM_PERCENT_200);
6: string(STR_PARAM_PERCENT_400);
7: string(STR_PARAM_PERCENT_800);
8: string(STR_PARAM_PERCENT_1600);
};
}
}
param 2 {
param_running_cost {
type: int;
name: string(STR_PARAM_RUNNING_COST);
desc: string(STR_PARAM_RUNNING_COST_DESC);
min_value: 0;
max_value: 8;
def_value: 2;
names: {
0: string(STR_PARAM_PERCENT_6);
1: string(STR_PARAM_PERCENT_13);
2: string(STR_PARAM_PERCENT_25);
3: string(STR_PARAM_PERCENT_50);
4: string(STR_PARAM_PERCENT_100);
5: string(STR_PARAM_PERCENT_200);
6: string(STR_PARAM_PERCENT_400);
7: string(STR_PARAM_PERCENT_800);
8: string(STR_PARAM_PERCENT_1600);
};
}
}
param 3 {
param_cargo_decay {
type: int;
name: string(STR_PARAM_CARGO_DECAY);
desc: string(STR_PARAM_CARGO_DECAY_DESC);
min_value: 0;
max_value: 2;
def_value: 0;
names: {
0: string(STR_PARAM_STANDARD);
1: string(STR_PARAM_LONG);
2: string(STR_PARAM_VERY_LONG);
};
}
}
param 4 {
param_cargo_capacity {
type: int;
name: string(STR_PARAM_CARGO_CAPACITY);
desc: string(STR_PARAM_CARGO_CAPACITY_DESC);
min_value: 0;
max_value: 5;
def_value: 2;
names: {
0: string(STR_PARAM_PERCENT_50);
1: string(STR_PARAM_PERCENT_75);
2: string(STR_PARAM_PERCENT_100);
3: string(STR_PARAM_PERCENT_125);
4: string(STR_PARAM_PERCENT_150);
5: string(STR_PARAM_PERCENT_200);
};
}
}
}
basecost {
PR_BUILD_VEHICLE_TRAIN: param_purchase_cost - 3;
PR_BUILD_VEHICLE_WAGON: param_purchase_cost + 1;
PR_RUNNING_TRAIN_STEAM: param_running_cost - 4;
PR_RUNNING_TRAIN_DIESEL: param_running_cost - 4;
PR_RUNNING_TRAIN_ELECTRIC: param_running_cost - 4;
}
/* disable original trains */
disable_item(FEAT_TRAINS, 0, 115);
/* only OpenTTD is supported, not enforced though */
if (ttd_platform != PLATFORM_OPENTTD) {
//requires OpenTTD
error(FATAL, USED_WITH, "OpenTTD");
}
else {
if (openttd_version < version_openttd(1, 4, 0, 26157)) {
//requires OpenTTD 1.4.0-beta1 or later since the introduction of cargo_age_period and articulated vehicle position.
error(FATAL, REQUIRES_OPENTTD, "1.4.0-beta1 / r26157");
}
}
//check if dynamic_engines is enabled
if (dynamic_engines == 0) {
//Required dynamic_engines to load all vehicles
error(FATAL, USED_WITH, string(STR_USED_WITH_DYNAMIC_ENGINES));
}
/* fix depot view */
train_width_32_px = 1;
traininfo_y_offset = 2;
# 3 "chinaset-mtraddon.pnml" 2
// Templates
# 1 "src/template.pnml" 1
// Begin template
// Learned from JP+ Shinkansen
// Empty Template
template template_empty() {
[0, 0, 2, 2, 0, 0, CROP, "gfx/empty.png"]
[0, 0, 2, 2, 0, 0, CROP, "gfx/empty.png"]
[0, 0, 2, 2, 0, 0, CROP, "gfx/empty.png"]
[0, 0, 2, 2, 0, 0, CROP, "gfx/empty.png"]
[0, 0, 2, 2, 0, 0, CROP, "gfx/empty.png"]
[0, 0, 2, 2, 0, 0, CROP, "gfx/empty.png"]
[0, 0, 2, 2, 0, 0, CROP, "gfx/empty.png"]
[0, 0, 2, 2, 0, 0, CROP, "gfx/empty.png"]
}
// Purchase Templates
template template_purchase_empty() {
// a: vehicle type (all lower cases), b: vehicle name (all lower cases)
[]
[]
[]
[]
[]
[]
[0, 0, 2, 2, 0, 0, "gfx/empty.png"]
[]
}
template template_purchase (a, b) {
// a: vehicle type (all lower cases), b: vehicle name (all lower cases)
[]
[]
[]
[]
[]
[]
[672, 0, 192, 80, -96, -60, "gfx/"+a+"/"+b+"_32bpp.png"]
[]
}
template template_standard (a, b) {
[ 0, 0, 36, 160, -12, -80, "gfx/"+a+"/"+b+"_32bpp.png"]
[ 44, 0, 120, 116, -72, -76, "gfx/"+a+"/"+b+"_32bpp.png"]
[172, 0, 192, 80, -96, -60, "gfx/"+a+"/"+b+"_32bpp.png"]
[372, 0, 120, 116, -40, -76, "gfx/"+a+"/"+b+"_32bpp.png"]
[500, 0, 36, 160, -12, -80, "gfx/"+a+"/"+b+"_32bpp.png"]
[544, 0, 120, 116, -72, -76, "gfx/"+a+"/"+b+"_32bpp.png"]
[672, 0, 192, 80, -96, -60, "gfx/"+a+"/"+b+"_32bpp.png"]
[872, 0, 120, 116, -40, -76, "gfx/"+a+"/"+b+"_32bpp.png"]
}
template template_reversed (a, b) {
[500, 0, 36, 160, -12, -80, "gfx/"+a+"/"+b+"_32bpp.png"]
[544, 0, 120, 116, -72, -76, "gfx/"+a+"/"+b+"_32bpp.png"]
[672, 0, 192, 80, -96, -60, "gfx/"+a+"/"+b+"_32bpp.png"]
[872, 0, 120, 116, -40, -76, "gfx/"+a+"/"+b+"_32bpp.png"]
[ 0, 0, 36, 160, -12, -80, "gfx/"+a+"/"+b+"_32bpp.png"]
[ 44, 0, 120, 116, -72, -76, "gfx/"+a+"/"+b+"_32bpp.png"]
[172, 0, 192, 80, -96, -60, "gfx/"+a+"/"+b+"_32bpp.png"]
[372, 0, 120, 116, -40, -76, "gfx/"+a+"/"+b+"_32bpp.png"]
}
// Below shamelessly stolen from JP+ Shinkansen
spriteset (spriteset_too_many_12) {
template_empty ()
}
alternative_sprites (spriteset_too_many_12, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "gfx/less12.png") {
[ 0, 0, 32, 144, -12, -72]
[ 40, 0, 120, 116, -72, -76]
[168, 0, 192, 80, -96, -60]
[368, 0, 120, 116, -40, -76]
[496, 0, 32, 144, -12, -72]
[536, 0, 120, 116, -72, -76]
[664, 0, 192, 80, -96, -60]
[864, 0, 120, 116, -40, -76]
}
spriteset (spriteset_erroremu) {
template_empty ()
}
alternative_sprites (spriteset_erroremu, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP, "gfx/erroremu.png") {
[ 0, 0, 32, 144, -12, -72]
[ 40, 0, 120, 116, -72, -76]
[168, 0, 192, 80, -96, -60]
[368, 0, 120, 116, -40, -76]
[496, 0, 32, 144, -12, -72]
[536, 0, 120, 116, -72, -76]
[664, 0, 192, 80, -96, -60]
[864, 0, 120, 116, -40, -76]
}
spriteset (empty_sprites, "gfx/empty.png") {
[0, 0, 2, 2, 0, 0, CROP]
}
# 6 "chinaset-mtraddon.pnml" 2
// Helpers
# 1 "src/railtypetable.pnml" 1
/*
Using Semi-Standardised Railtype Scheme.
The First Letter:
S - 1435 mm gauge
B - 1520 mm gauge
N - 1067(1000) mm gauge
n - 762(600) mm gauge
D - 1435/1520 mm gauge
d - 1435/1067(1000) mm gauge
c - 1067/762(600) mm gauge
M - Monorail;
L - Magnetic Levitation (Maglev);
The Second Letter:
For S, B, D gauges:
A - 80 km/h
B - 120 km/h
C - 160 km/h
D - 210 km/h
E - 250 km/h (unlimited for B gauge)
F - 310 km/h
G - Unlimited;
For N, d, c gauges:
A - 80 km/h
B - 100 km/h
C - 130 km/h
D - 160 km/h;
For n and c gauges:
A - 60 km/h;
For Monorail:
A - Unlimited;
For Maglev:
A - 120 km/h
B - Unlimited;
The Third Letter:
A - Very Low Axle Load - <= 15 t
B - Low Axle Load - 16-19 t
C - Medium Axle Load - 20-23 t
D - High Axle Load - 24-27 t
E - Very High Axle Load - >= 28 t;
The Last Letter:
N - Non-Electrified
A - 25 kV AC
d - 1.5 kV DC
( - 25 kV AC / 1.5 kV DC
3 - Third Rail Electrification;
*/
# 51 "src/railtypetable.pnml"
railtypetable {
RAIL,
ELRL,
MONO,
MGLV,
SAAN: [SAAN, RAIL], //NOT IN CHINA SET: RAILS
SABN: [SABN, SAAN, RAIL], //NOT IN CHINA SET: RAILS
SACN: [SACN, SAAN, RAIL], //NOT IN CHINA SET: RAILS
SADN: [SADN, SAAN, RAIL],
SAEN: [SAEN, SAAN, RAIL],
// SBDN: [SBDN, SADN, SAAN, RAIL],
// SBEN: [SBEN, SAEN, SAAN, RAIL],
// SCDN: [SCDN, SADN, SAAN, RAIL],
SAAA: [SAAA, SAAE, ELRL], //NOT IN CHINA SET: RAILS
SABA: [SABA, SAAA, SAAE, ELRL], //NOT IN CHINA SET: RAILS
SACA: [SACA, SAAA, SAAE, ELRL], //NOT IN CHINA SET: RAILS
SADA: [SADA, SAAA, SAAE, ELRL], //NOT IN CHINA SET: RAILS
SAEA: [SAEA, SAAA, SAAE, ELRL], //NOT IN CHINA SET: RAILS
// SBDA: [SBDA, SADA, SAAA, SAAE, ELRL],
// SBEA: [SBEA, SAEA, SAAA, SAAE, ELRL],
// SCCA: [SCCA, SACA, SAAA, SAAE, ELRL],
// SCDA: [SCDA, SADA, SAAA, SAAE, ELRL],
// SDCA: [SDCA, SACA, SAAA, SAAE, ELRL],
// SDDA: [SDDA, SADA, SAAA, SAAE, ELRL],
// SECA: [SECA, SACA, SAAA, SAAE, ELRL],
// SEDA: [SEDA, SADA, SAAA, SAAE, ELRL],
// SFCA: [SFCA, SACA, SAAA, SAAE, ELRL],
// SGCA: [SGCA, SACA, SAAA, SAAE, ELRL],
// SACB: [SACB, SAAB, SAAE, ELRL],
// SBCB: [SBCB, SACB, SAAB, SAAE, ELRL],
SACD: [SACD, SAAD, SAAE, ELRL],
// SBCD: [SBCD, SACD, SAAD, SAAE, ELRL],
// SCCD: [SCCD, SACD, SAAD, SAAE, ELRL],
SACd: [SACd, SAAd, SAAE, ELRL],
// SBCd: [SBCd, SACd, SAAd, SAAE, ELRL],
// SCCd: [SCCd, SACd, SAAd, SAAE, ELRL],
SAC3: [SAC3, SAA3, "3RDR", MTRO, ELRL],
// SBC3: [SBC3, SAC3, SAA3, "3RDR", MTRO, ELRL],
// SCC3: [SCC3, SAC3, SAA3, "3RDR", MTRO, ELRL],
NACN: [NACN, NAAN, NGRL], //NOT IN CHINA SET: RAILS
NADN: [NADN, NAAN, NGRL],
// NBDN: [NBDN, NADN, NAAN, NGRL],
// NCCN: [NCCN, NACN, NAAN, NGRL],
NADA: [NADA, NAAA, NAAE, ELNG],
// NBCA: [NBCA, NACA, NAAA, NAAE, ELNG],
// NBDA: [NBDA, NADA, NAAA, NAAE, ELNG],
// NCCA: [NCCA, NACA, NAAA, NAAE, ELNG],
// NCDA: [NCDA, NADA, NAAA, NAAE, ELNG],
// NDCA: [NDCA, NACA, NAAA, NAAE, ELNG],
nACN: [nACN, nAAN, NACN, NAAN, NGRL], //NOT IN CHINA SET: RAILS
nADN: [nADN, nAAN, NADN, NAAN, NGRL],
// nBDN: [nBDN, nADN, nAAN, NBDN, NADN, NAAN, NGRL],
nACA: [nACA, nAAA, nAAE, NACA, NAAA, NAAE, ELNG], //NOT IN CHINA SET: RAILS
nADA: [nADA, nAAA, nAAE, NADA, NAAA, NAAE, ELNG], //NOT IN CHINA SET: RAILS
// nBDA: [nBDA, nADA, nAAA, nAAE, NBDA, NADA, NAAA, NAAE, ELNG],
// nCCA: [nCCA, nACA, nAAA, nAAE, NCCA, NACA, NAAA, NAAE, ELNG],
// nDCA: [nDCA, nACA, nAAA, nAAE, NDCA, NACA, NAAA, NAAE, ELNG],
mACN: [mACN, mAAN, nACN, nAAN, NACN, NAAN, NGRL],
BACN: [BACN, BAAN, RLA0, RAIL], //NOT IN CHINA SET: RAILS
BADN: [BADN, BAAN, RLA0, RAIL],
BAEN: [BAEN, BAAN, RLA0, RAIL],
// BBDN: [BBDN, BADN, BAAN, RLA0, RAIL],
// BBEN: [BBEN, BAEN, BAAN, RLA0, RAIL],
// BCDN: [BCDN, BADN, BAAN, RLA0, RAIL],
BACA: [BACA, BAAA, BAAE, ERA1, ELRL], //NOT IN CHINA SET: RAILS
BADA: [BADA, BAAA, BAAE, ERA1, ELRL], //NOT IN CHINA SET: RAILS
BAEA: [BAEA, BAAA, BAAE, ERA1, ELRL], //NOT IN CHINA SET: RAILS
// BBDA: [BBDA, BADA, BAAA, BAAE, ERA1, ELRL],
// BBEA: [BBEA, BAEA, BAAA, BAAE, ERA1, ELRL],
// BCDA: [BCDA, BADA, BAAA, BAAE, ERA1, ELRL],
// BDDA: [BDDA, BADA, BAAA, BAAE, ERA1, ELRL],
// BECA: [BECA, BACA, BAAA, BAAE, ERA1, ELRL],
// DBDN: [DBDN, DADN, DAAN, RAIL],
// DCDA: [DCDA, DADA, DAAA, DAAE, ELRL],
// dBDN: [dBDN, dADN, dAAN, RAIL],
// dCDA: [dCDA, dADA, dAAA, dAAE, ELRL],
// CBDN: [CBDN, CADN, CAAN, RAIL],
// CCDA: [CCDA, CADA, CAAA, CAAE, ELRL],
// cACN: [cACN, cAAN, NGRL],
// LACN: [LACN, LAAN, MGLV],
}
# 10 "chinaset-mtraddon.pnml" 2
# 1 "src/cargotable.pnml" 1
cargotable {
PASS, COAL, MAIL, OIL_, LVST, GOOD, GRAI, WOOD,
IORE, STEL, VALU, PAPR, WHEA, FOOD, GOLD, RUBR,
FRUT, MAIZ, CORE, WATR, DIAM, SUGR, TOYS, BATT,
SWET, TOFF, COLA, CTCD, BUBL, PLST, FZDR, AORE,
BDMT, BEAN, BEER, BOOM, BRCK, CBLK, CERA, CERE,
CLAY, CMNT, COPR, CSTI, CTAR, DYES, ENSP, FECR,
FERT, FICR, FISH, FMSP, GLAS, GRVL, JAVA, KAOL,
LIME, MILK, OLSD, PEAT, PETR, PHOS, PLAS, PORE,
POTA, RFPR, SAND, SCMT, SULP, TOUR, TYRE, URAN,
VEHI, WDPR, WOOL, ZINC, ACID, ALUM, BAKE, CASS,
CHLO, CHSE, CIGR, COAT, COBL, COKE, ELTR, EOIL,
FRVG, FUEL, FURN, IRON, LYE_, MEAT, METL, MNO2,
MNSP, MOLS, MPTS, NH3_, NUTS, NICK, NITR, NKOR,
NUKF, NUKW, OILI, OILD, OTI1, OTI2, OYST, O2__,
PCL_, PIPE, POWR, QLME, RCYC, SALT, SASH, SEED,
SESP, SGBT, SGCN, SLAG, SOAP, STAL, STCB, STSE,
STSH, STST, STWR, TATO, TEXT, TBCO, TWOD, VBOD,
VENG, VPTS, WSTE, YETI, YETY, RSGR, SCRP, ALO_,
COCO, FOCA, PPAR, NHNO, C2H4, H2__, N7__ // This line is copied from xUSSR, I am not sure what they acctually are.
}
# 11 "chinaset-mtraddon.pnml" 2
# 1 "src/vehicleid.pnml" 1
//This file sets all vehicle IDs. Each type has a range of 32/64/128/256/512/768/1024 possible IDs.
//Steam Locomotive, available ID range: 512-767 (hex 0x0200..0x02FF)
//Narrow Guage Steam Locomotive, available ID range: 768-895 (hex 0x0300..0x037F)
//Diesel Locomotive, available ID range: 896-959 (hex 0x0380..0x03BF)
//Electric Locomotive, available ID range: 960-1023 (hex 0x03C0..0x03FF)
//Coaches, available ID range: 1024-1535 (hex 0x0400..0x05FF)
//Narrow Guage Coaches, available ID range: 1536-1663 (hex 0x0600..0x067F)
//Wagons, available ID range: 1664-1791 (hex 0x0680..0x06FF)
//Narrow Guage Wagons, available ID range: 1792-1855 (hex 0x0700..0x073F)
//Mutipile-Unit Wagons, available ID range: 1856-1983 (hex 0x0740..0x07BF)
item (FEAT_TRAINS, normal_emucoach, 1856) {}
item (FEAT_TRAINS, first_emucoach, 1857) {}
item (FEAT_TRAINS, first_emucoach_with_mailroom, 1858) {}
//25kV AC Electric Mutipile-Unit, available ID range: 1984-2239 (hex 0x07C0..0x08BF)
item (FEAT_TRAINS, yellowhead_exurb, 1984) {}
item (FEAT_TRAINS, yellowhead_suburb, 1985) {}
item (FEAT_TRAINS, mlr, 1986) {}
//1500V DC Electric Mutipile-Unit, available ID range: 2240-2751 (hex 0x08C0..0x0ABF)
//Misc, available ID range: 2240-2751 (hex 0x0AC0..0x0CBF)
item (FEAT_TRAINS, yellowhead_mailroom, 2240) {}
# 12 "chinaset-mtraddon.pnml" 2
# 1 "src/roadvehicleid.pnml" 1
# 13 "chinaset-mtraddon.pnml" 2
# 1 "src/vehicleid.pnml" 1
//This file sets all vehicle IDs. Each type has a range of 32/64/128/256/512/768/1024 possible IDs.
//Steam Locomotive, available ID range: 512-767 (hex 0x0200..0x02FF)
//Narrow Guage Steam Locomotive, available ID range: 768-895 (hex 0x0300..0x037F)
//Diesel Locomotive, available ID range: 896-959 (hex 0x0380..0x03BF)
//Electric Locomotive, available ID range: 960-1023 (hex 0x03C0..0x03FF)
//Coaches, available ID range: 1024-1535 (hex 0x0400..0x05FF)
//Narrow Guage Coaches, available ID range: 1536-1663 (hex 0x0600..0x067F)
//Wagons, available ID range: 1664-1791 (hex 0x0680..0x06FF)
//Narrow Guage Wagons, available ID range: 1792-1855 (hex 0x0700..0x073F)
//Mutipile-Unit Wagons, available ID range: 1856-1983 (hex 0x0740..0x07BF)
item (FEAT_TRAINS, normal_emucoach, 1856) {}
item (FEAT_TRAINS, first_emucoach, 1857) {}
item (FEAT_TRAINS, first_emucoach_with_mailroom, 1858) {}
//25kV AC Electric Mutipile-Unit, available ID range: 1984-2239 (hex 0x07C0..0x08BF)
item (FEAT_TRAINS, yellowhead_exurb, 1984) {}
item (FEAT_TRAINS, yellowhead_suburb, 1985) {}
item (FEAT_TRAINS, mlr, 1986) {}
//1500V DC Electric Mutipile-Unit, available ID range: 2240-2751 (hex 0x08C0..0x0ABF)
//Misc, available ID range: 2240-2751 (hex 0x0AC0..0x0CBF)
item (FEAT_TRAINS, yellowhead_mailroom, 2240) {}
# 14 "chinaset-mtraddon.pnml" 2
# 1 "src/functions.pnml" 1
/* Begin Functions */
// shamelessly stolen from jp+ shinkansen
switch (FEAT_TRAINS, PARENT, func_is_reversed, vehicle_is_reversed) {return;}
// Running cost factor depending on speed
switch (FEAT_TRAINS, SELF, runningcost60, current_speed) {
0: return 1;
1..3: return 2;
4..6: return 3;
7..10: return 4;
return 5;
}
switch (FEAT_TRAINS, SELF, runningcost80, current_speed) {
0: return 1;
1..5: return 2;
6..12: return 3;
13..20: return 4;
return 5;
}
switch (FEAT_TRAINS, SELF, runningcost120, current_speed) {
0: return 1;
1..8: return 2;
9..19: return 3;
20..30: return 4;
return 5;
}
switch (FEAT_TRAINS, SELF, runningcost160, current_speed) {
0: return 1;
1..12: return 2;
13..26: return 3;
27..40: return 4;
return 5;
}
switch (FEAT_TRAINS, SELF, runningcost200, current_speed) {
0: return 1;
1..15: return 2;
16..32: return 3;
33..50: return 4;
return 5;
}
switch (FEAT_TRAINS, SELF, runningcost250, current_speed) {
0: return 1;
1..18: return 2;
19..39: return 3;
40..60: return 4;
return 5;
}
switch (FEAT_TRAINS, SELF, runningcost280, current_speed) {
0: return 1;
1..21: return 2;
22..45: return 3;
46..70: return 4;
return 5;
}
switch (FEAT_TRAINS, SELF, runningcost300, current_speed) {
0: return 1;
1..24: return 2;
25..52: return 3;
53..80: return 4;
return 5;
}
switch (FEAT_TRAINS, SELF, runningcost350, current_speed) {
0: return 1;
1..27: return 2;
28..58: return 3;
59..90: return 4;
return 5;
}
switch (FEAT_TRAINS, SELF, runningcost400, current_speed) {
0: return 1;
1..30: return 2;
31..65: return 3;
66..100: return 4;
return 5;
}
switch (FEAT_TRAINS, SELF, runningcostfactor, max_speed) {
0..20: runningcost60; // < 75 km/h
21..30: runningcost80; // 75-110 km/h
31..40: runningcost120; // 110-145 km/h
41..50: runningcost160; // 145-180 km/h
51..60: runningcost200; // 180-220 km/h
61..70: runningcost250; // 220-255 km/h
71..80: runningcost280; // 255-290 km/h
81..90: runningcost300; // 290-325 km/h
91..100: runningcost350; // 325-360 km/h
runningcost400; // > 360 km/h
}
// For High-Speed Hexie EMUs, speed is limited to 310 km/h IRL, but they can go up to 350 even 380, but with increased running costs
switch (FEAT_TRAINS, SELF, switch_crh_c_cargo_subtype, cargo_subtype) {
0: return string(STR_310_KMH);
1: return string(STR_350_KMH);
return CB_RESULT_NO_TEXT;
}
switch (FEAT_TRAINS, SELF, switch_crh_c_speed, cargo_subtype) {
0: return 310;
return 350;
}
switch (FEAT_TRAINS, SELF, switch_crh380_cargo_subtype, cargo_subtype) {
0: return string(STR_310_KMH);
1: return string(STR_350_KMH);
2: return string(STR_380_KMH);
return CB_RESULT_NO_TEXT;
}
//也许可以给动感号用这些东西
switch (FEAT_TRAINS, SELF, switch_crh380_speed, cargo_subtype) {
0: return 310;
1: return 350;
return 380;
}
switch (FEAT_TRAINS, SELF, crh350costpower, vehicle_is_potentially_powered) {
1: return 10;
return 4;
}
switch (FEAT_TRAINS, SELF, crh380costpower, vehicle_is_potentially_powered) {
1: return 25;
return 10;
}
switch (FEAT_TRAINS, PARENT, crhspeedcost, max_speed) {
0..87: return 0;
88..98: crh350costpower;
crh380costpower;
}
/*
BITMASK SHEET
bitmask(0): to return error consists
bitmask(1): restaurant car
bitmask(2): air condition generator car
bitmask(3): ////
bitmask(4): brake van
For example,
bitmask_vehicle_info: bitmask(1, 3);
*/
# 149 "src/functions.pnml"
// Pushpull trains should have locomotives on their front/end, not middle
switch (FEAT_TRAINS, SELF, switch_pushpull_consist_correction, ((position_in_consist < 3) || (position_in_consist_from_end < 3))) {
1: return bitmask(2);
return bitmask(0, 2);
}
// Another running cost factor depending on the existence of restaurant car - changed in v0.0.8 - now halves the runing costs of passenger cars instead of elimination
switch (FEAT_TRAINS, PARENT, cafecostfactor, hasbit(bitmask_consist_info, 1)) {
1: return 1;
return 2;
}
// Running cost factor of AC Generator Cars (and also locomotives able to supply electricity for cars) - added in v0.0.8 - now varies according to the number of cars with need of air condition (including some passenger cars and a few refrigerator wagons)
// The costs are not coded into AC Generator Cars, but into cars with need of AC.
switch (FEAT_TRAINS, PARENT, accostfactor, hasbit(bitmask_consist_info, 2)) {
1: return 2;
return 0;
}
// Cargo age period factor depending on Restaurant Car: attaching restaurant car increases cargo age period of medium and long range passenger cars (i.e. not commuter cars) by 1/4
switch (FEAT_TRAINS, PARENT, cafedecayfactor, hasbit(bitmask_consist_info, 1)) {
1: return 5;
return 4;
}
// Cargo age period factor depending on Air Conditioner: If the train is not pulled by an locomotive able to supply electricity for cars, nor is there an air condition generator car (bitmask 2), the cargo_age_period of this passenger car reduces by 1/5.
switch (FEAT_TRAINS, PARENT, acdecayfactor, hasbit(bitmask_consist_info, 2)) {
0: return 4;
return 5;
}
// Electric Engines MUST BE ELECTRIFIED to supply electricity
switch (FEAT_TRAINS, SELF, airconditioner, vehicle_is_powered) {
1: return bitmask(2);
return 0;
}
/* switch (FEAT_TRAINS, SELF, crhwagon, vehicle_type_id) {
1024..1035: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
return CB_RESULT_ATTACH_DISALLOW;
}
switch (FEAT_TRAINS, SELF, muhead, vehicle_type_id) {
1024..1051: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
8192..14335: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
return CB_RESULT_ATTACH_DISALLOW;
}
switch (FEAT_TRAINS, SELF, singlemu, vehicle_type_id) {
1024..1051: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
return CB_RESULT_ATTACH_DISALLOW;
}
switch (FEAT_TRAINS, SELF, locowagon, vehicle_type_id) {
1024..1051: return CB_RESULT_ATTACH_DISALLOW;
8192..14335: return CB_RESULT_ATTACH_DISALLOW;
return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
} */
# 210 "src/functions.pnml"
/* switch (FEAT_TRAINS, SELF, muwagon, vehicle_type_id) {
1856..2751: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
return CB_RESULT_ATTACH_DISALLOW;
}
switch (FEAT_TRAINS, SELF, muhead_mtr, vehicle_type_id) {
1856: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
return CB_RESULT_ATTACH_DISALLOW;
} */
# 219 "src/functions.pnml"
//Atention: Different from China Set : Trains, can_attach swiths' name are named by type cars whivh use them
switch (FEAT_TRAINS, SELF, mu_with_first_class, vehicle_type_id) {
1856..1859: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
1984: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
1986: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
return CB_RESULT_ATTACH_DISALLOW;
}
switch (FEAT_TRAINS, SELF, mu_of_mtr, vehicle_type_id) {
1856..2751: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
return CB_RESULT_ATTACH_DISALLOW;
}
switch (FEAT_TRAINS, SELF, muhead_with_first_class, vehicle_type_id) {
1856..1857: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
return CB_RESULT_ATTACH_DISALLOW;
}
switch (FEAT_TRAINS, SELF, muhead_yellowhead_exurb, vehicle_type_id) {
1856..1858: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
return CB_RESULT_ATTACH_DISALLOW;
}
switch (FEAT_TRAINS, SELF, muhead_airport_express, vehicle_type_id) {
1857: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
1859: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
return CB_RESULT_ATTACH_DISALLOW;
}
switch (FEAT_TRAINS, SELF, muhead_without_first_class, vehicle_type_id) {
1856: return CB_RESULT_ATTACH_ALLOW_IF_RAILTYPES;
return CB_RESULT_ATTACH_DISALLOW;
}
switch (FEAT_TRAINS, SELF, switch_visual_effect_and_powered, ((position_in_articulated_veh == 0) && !func_is_reversed()) || ((position_in_articulated_veh_from_end == 0) && func_is_reversed()) ) {
1: return visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 0, ENABLE_WAGON_POWER);
return visual_effect_and_powered(VISUAL_EFFECT_DISABLE, 0, DISABLE_WAGON_POWER);
}
// MUs need at least 4 cars to start
switch (FEAT_TRAINS, SELF, mu4car, num_vehs_in_consist < 12) {
1: return string(STR_TOO_SHORT);
return CB_RESULT_NO_TEXT;
}
// MUs need at least 4 and at most 24 cars to start
switch (FEAT_TRAINS, SELF, mu4to24car, (num_vehs_in_consist < 12) || (num_vehs_in_consist > 72)) {
1: return string(STR_MUST_BE_4_TO_24_CARS);
return CB_RESULT_NO_TEXT;
}
// MUs need at least 8 and at most 24 cars to start
switch (FEAT_TRAINS, SELF, mu8to24car, (num_vehs_in_consist < 12) || (num_vehs_in_consist > 72)) {
1: return string(STR_MUST_BE_8_TO_24_CARS);
return CB_RESULT_NO_TEXT;
}
// Long MUs need at least 4 cars to start
switch (FEAT_TRAINS, SELF, mu8car, num_vehs_in_consist < 24) {
1: return string(STR_TOO_SHORT);
return CB_RESULT_NO_TEXT;
}
switch (FEAT_TRAINS, SELF, mu481216car, num_vehs_in_consist) {
12: return CB_RESULT_NO_TEXT;
24: return CB_RESULT_NO_TEXT;
36: return CB_RESULT_NO_TEXT;
48: return CB_RESULT_NO_TEXT;
return string(STR_MUST_BE_4_8_12_16_CARS);
}
switch (FEAT_TRAINS, SELF, mu3multicar, num_vehs_in_consist) {
9: return CB_RESULT_NO_TEXT;
18: return CB_RESULT_NO_TEXT;
27: return CB_RESULT_NO_TEXT;
36: return CB_RESULT_NO_TEXT;
45: return CB_RESULT_NO_TEXT;
54: return CB_RESULT_NO_TEXT;
return string(STR_MUST_BE_3MULTI_CARS);
}
switch (FEAT_TRAINS, SELF, mu5to17car, num_vehs_in_consist) {
15..51: return CB_RESULT_NO_TEXT;
return string(STR_MUST_BE_5_TO_17_CARS);
}
/* LENGTHS */
// Standard 2-8-2 Length
switch (FEAT_TRAINS, SELF, switch_length_2_8_2, position_in_articulated_veh % 3) {
1: return 8;
return 2;
}
// Standard 2-7-2 Length
switch (FEAT_TRAINS, SELF, switch_length_2_7_2, position_in_articulated_veh % 3) {
1: return 7;
return 2;
}
// Standard 2-6-2 Length
switch (FEAT_TRAINS, SELF, switch_length_2_6_2, position_in_articulated_veh % 3) {
1: return 6;
return 2;
}
// Standard 2-5-2 Length
switch (FEAT_TRAINS, SELF, switch_length_2_5_2, position_in_articulated_veh % 3) {
1: return 5;
return 2;
}
// Standard 2-4-2 Length
switch (FEAT_TRAINS, SELF, switch_length_2_4_2, position_in_articulated_veh % 3) {
1: return 4;
return 2;
}
// Standard 2-3-2 Length
switch (FEAT_TRAINS, SELF, switch_length_2_3_2, position_in_articulated_veh % 3) {
1: return 3;
return 2;
}
// Standard 2-2-2 Length
switch (FEAT_TRAINS, SELF, switch_length_2_2_2, position_in_articulated_veh % 3) {
1: return 2;
return 2;
}
/* End Functions */
//the train is too long
switch (FEAT_TRAINS, SELF, too_many_graphics_12, position_in_articulated_veh % 3) {
1: spriteset_too_many_12;
empty_sprites;
}
# 16 "chinaset-mtraddon.pnml" 2
# 1 "src/misc/mailroom.pnml" 1
item(FEAT_TRAINS, yellowhead_mailroom) {
property {
introduction_date: date(1,1,1);
model_life: VEHICLE_NEVER_EXPIRES;
vehicle_life: 255;
loading_speed: 24 << param_loading_speed;
misc_flags: bitmask(TRAIN_FLAG_AUTOREFIT);
cost_factor: 0;
running_cost_factor: 0;
speed: 0 km/h;
power: 0 hpM;
cargo_capacity: 24;
weight: 0 ton;
tractive_effort_coefficient: 0;
air_drag_coefficient: 0;
reliability_decay: 10;
refittable_cargo_classes: bitmask(CC_MAIL, CC_EXPRESS);
cargo_allow_refit: [MAIL, VALU, GOLD, DIAM];
cargo_disallow_refit: [];
cargo_age_period: 185;
refit_cost: 0;
default_cargo_type: MAIL;
track_type: SAAN;
ai_special_flag: 0;
running_cost_base: RUNNING_COST_ELECTRIC;
engine_class: ENGINE_CLASS_ELECTRIC;
visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC, 0, DISABLE_WAGON_POWER);
climates_available: NO_CLIMATE;
retire_early: 0;
sprite_id: SPRITE_ID_NEW_TRAIN;
length: 2;
extra_power_per_wagon: 0;
bitmask_vehicle_info: 0;
}
graphics {
cargo_capacity: 24;
purchase_cargo_capacity: 24;
default: empty_sprites;
}
}
# 17 "chinaset-mtraddon.pnml" 2
# 1 "src/function2.pnml" 1
/* Begin Functions Again */
/* switch (FEAT_TRAINS, SELF, switch_crh_wagon_articulated_part, vehicle_type_id) {