-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvertexlit_anime_heavy_l4d2.vmt
2036 lines (1721 loc) · 88 KB
/
vertexlit_anime_heavy_l4d2.vmt
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
VertexLitGeneric
{
//////////////////////////////////////////////////////////////////////////////////
// Version 3.4
// WIP based on Ellies Heavy DMG system to BBQ + IT + BurnLevel + Health + Pupil proxies as standalone
// Honkai Impact 3rd preset by Debiddo specially for Left 4 Dead 2
// Burn + Bille Effects and dynamic color modulation based at entity gaze.
// The purpose is avoid overexposure for Anime-like characters
//
// Note: this works only for entities! static props will make the game crash!
//
//
//
// By: Davi (Debiddo) Gooz
// Steam: https://steamcommunity.com/id/Debiddo
//////////////////////////////////////////////////////////////////////////////////
// include this file with:
////
// path {
// include "materials/shared/vertexlit_anime_heavy_l4d2.vmt"
// insert {
// $BaseTexture "your_albedo_texture_here"
// $EmissiveBlendBaseTexture "your_albedo_texture_here_gain"
// // rest of your desired vmt parameters
// }
// }
//
//////
//
// "Manual" here: https://github.com/LoveRenamon/Debiddos-Shared-Materials/blob/dev/materials/shared/vertexlit_anime_heavy_l4d2.vmt
//////////////////////////////////////////////////////////////////////////////////
$basetexture "vgui/white"
// We don't really need a normal map, use if you wish to...
//$bumpmap "dev/flat_normal"
// in case you have a $bumpmap and you have a Phong Mask or $EnvMap Mask at Alpha Channel remember to disable:
$basemapluminancephongmask "1"
// Here the magic of a lightwarp with some amount of red for some faked skin scattering
$lightwarptexture "shared/lightwarp_honkai3rd_l4d2"
// Or use this one which is the most common lightwarp used by most anime characters over workshop
//$lightwarptexture "shared/lightwarp_anime"
// many more lightwarps at: https://github.com/LoveRenamon/Debiddos-Shared-Materials/tree/dev/materials/shared
//////////////////////////////////////////////////////////////////////////////////
// Swtich values
//////////////////////////////////////////////////////////////////////////////////
// set "1" to disable cull and render both sides or allow cull for performace and avoid Z-Fighting
$nocull "1"
// allow decals for damage effects by bullets, If you'r model is expensive and unoptimized, you will need to set "1"
// NOTE: FOR ALL SOURCE ENGINE x86 BRANCHES: MODELS WITH >= 32768 VERTICES DO NEED THIS BE "1", NO EXCEPTIONS!
$nodecal "0"
// Set 0 to ignore my Proxie setup (bring back original behaviour)
$ColorProxie "1"
$PhongProxie "1"
$EnvMapProxie "1"
$DetailProxie "1"
$EmissiveProxie "1"
//////////////////////////////////////////////////////////////////////////////////
// Enable / Disable tilling
// It will expose your shitty made UVMap
//////////////////////////////////////////////////////////////////////////////////
$ClampS "1" // Clamp S/X texture coordinates by default
$ClampT "1" // Clamp T/Y texture coordinates by default
$ClampU "0" // Clamp U/Z texture coordinates by default
//////////////////////////////////////////////////////////////////////////////////
// Tweak diffuse
// Only have effect with $HalfLambert "0"
//////////////////////////////////////////////////////////////////////////////////
//$halflambert "0" // When true, warp radiosity to be at {{ 0.5 .. 1 }} range.
//$diffuseexp ".2" // create nice diffuse gradients by warp the entire lambertian radiosity,
//NOTE: $diffuseexp Empty value have a different effect than "0" and without the declared parameter.
//////////////////////////////////////////////////////////////////////////////////
// Phong
// Phong is an old specular method. Small amounts are good for a dry skin or opaque micro surface
// it computes exponent driven by a additive $phongboot and exponencial $phongexponent
// Fresnel is same as the every fresnel, that can be boosted by $phongfresnelranges
//////////////////////////////////////////////////////////////////////////////////
$phong "1" // We'll use phong specular render pass
$forcephong "1" // force phong for potato PCs
$phongdisablehalflambert "0" // if true, make phong be lambertian
// engine default white texture to enable phong tint
$phongexponenttexture "vgui/white"
// make phong weaker, required for most cases, use only one of th bellow recommended
//$phongboost ".02" // 2% effect. almost invisible
//$phongboost ".2" // 20% effect
$phongboost ".5" // 50% effect, seens rasionable if the texture is too bright
//$phongboost "1" // 100% effect, seens rasionable if you have a custom mask
$phongalbedotint "1" // use the $BaseTexture's RGB as tint value per textel
// Phong Fresnel Ranges are like "intensity modulator" as:
// X direct view ( 0 radian angle)
// Y indirect view ( 45 radian angle)
// Z indirect view (180 radian angle)
// As XYZ fresnel vectors, you can use any float values
// i.e: $phongfresnelranges " [ X Y Z ] "
// NOTE: bellow Phong Fresnel Ranges take effect only at HLMV since will be later modulated by Proxies
$phongfresnelranges " [ .3 .65 1.1 ] " // my recommended values
//$phongfresnelranges " [ .12 .5 1 ] " // my recommended values warped at Valve's default range
//$phongfresnelranges " [ 1 .1 .1 ] " // the most used values over the steam workshop
//$phongfresnelranges " [ .002 .05 7 ] "
// Phong Exponent
// for override the default $phongexponenttexture's Red Channel (255 for this sample file)
// you can unset with: $phongexponent ""
// Exponent means how hard the surface is and higher values make phong gradient be sharper; 0 means smoother and 255 means a irrealistic hard surface
// rasionable values are {{ 0 .. 127 }}
//$phongexponent "" // NOTE: you can set empty to disable and let $phongexponenttexture Red Channel takes it place.
$phongexponent "1" // my recommended safe value, good for general HalfLambertian skin/surface
//$phongexponent "7" // starts to go more sharper phong gradients, "kinda" better for leather, and harder micro surface
//$phongexponent "14" // you may wanna use this one for pseudo metalic or when $bumpmap will spread the entire phong
//$phongexponent "40" // for metalic surfaces or $bumpmap which have aberrant bumps
//////////////////////////////////////////////////////////////////////////////////
// Tweak Phong
// WARNING: IT BREAK THE WHOLE EFFECT
// Gives a better look to the blood
//////////////////////////////////////////////////////////////////////////////////
$shinyblood "0" // Set as False as failsafe parameter
//$shinybloodexponent "8" //
//////////////////////////////////////////////////////////////////////////////////
// Alpha
//////////////////////////////////////////////////////////////////////////////////
// set "1" to enable binary transparency
$alphatest "0"
// Translucent SHOULD NOT be used along $alphatest
$translucent "0" // set "1" to enable gradient transparency, This will potentialy add Z-Fighting if you don't know when and how to use it
// for $alphatest be antialiased, allow different "opaque" steps based on MSAA Amount
$allowalphatocoverage "1"
// YOU SHOULD NEVER USE THIS SHIT, DONT BE SO LAZY TO DISABLE THE COVERAGE EFFECT!!
//$alphatestreference ".7" // .7 is the default value
//////////////////////////////////////////////////////////////////////////////////
// Emissive Blend
// NOTE: Use with caution since it double the amount of tringles being draw
//////////////////////////////////////////////////////////////////////////////////
"GPU>=2" // necessary to avoid make the model even more expensive for no good reason
{
$emissiveblendenabled "1" // It was earlier disabled by default, but for this sample and onwards would be enabled by default
}
$emissiveblendstrength ".8" // This sets actual strength for Emissive effect, however, it'll be modulated by $EmissiveStrength at Proxie setups
$emissiveblendbasetexture "vgui/white" // The trick is use the $BaseTexture here
$emissiveblendtexture "vgui/white" // how much effect modulation. Note that by use $BaseTexture you may result into a effect strenght mismatch pulse, however, for a most cases archives a really good effect
$emissiveblendflowtexture "vgui/white" // unless you'll make animated effect leave as "vgui/white"
$emissiveblendtint " [ .4 .4 .4 ] " // how much of this effect should be tinted over $BaseTexture. Default: " [ .1 .1 .1 ] "
$emissiveblendscrollvector " [ 0 0 ] " // X Y animation scroll speed
//////////////////////////////////////////////////////////////////////////////////
// Color Modulation
//////////////////////////////////////////////////////////////////////////////////
// Prevents the model's material from being tinted by $color2 or rendercolor.
$allowdiffusemodulation "1"
// Tint before apply the $BaseTexture
$blendtintcoloroverbase "0"
// this is a reference color to be applyed along the $color parameter
//$color2 " [ .973 .973 .975 ] "
// we may have a too saturated color which allow use "greywish" color
$color2 " [ .89 .89 .89 ] "
// This Parameter will be modulated by proxies, used just for HLMV reference, incase you want edit, use $MinLighting and $MaxLighting
$color " [ .973 .973 .973 ] "
//////////////////////////////////////////////////////////////////////////////////
// Rim Light
//////////////////////////////////////////////////////////////////////////////////
// ShoutAFuckUp $RimLight, you don't have ANY visible effect in Left 4 Dead 2 due how light works for this game
$rimlight "0"
$rimlightboost "2.8"
$rimlightexponent "7"
$rimmask "0"
//////////////////////////////////////////////////////////////////////////////////
// Env Map
// Envmap / Reflections, recommended use a mask
//////////////////////////////////////////////////////////////////////////////////
//$envmap "env_cubemap" // The Envirovment texture. "env_cubemap" for auto. Change to make static.
//$envmapcontrast "0" // how much is multply by color*color . 0 is the "natural" value ( not compatible with $Phong "1" )
$envmapfresnel ".8" // Multiply Fresnel Envirovment by this value
$envmaptint " [ .9 .9 .9 ] " // {RGB} or [vector] values to tune EnvMap
//$envmapfresnelminmaxexp " [ 0 1 2 ] " // Override the Min, Max and Exponent Fresnel values ( not compatible with $BumpMap )
// just store a simpler variable for pupil light modulation
// it behave like a ramp smoother for dark/light ambients
// appear that .073 is our Open/Brighter magic number and .4 our Close/Darkener magic number
$PupilOpenRate "1.1073" // referece values: 1.1 (fast) || .3 (slower)
$PupilCloseRate "1.14" // referece values: 1.1 (fast) || .3 (slower)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ___ ___ _ _ ___ ___ _____ ___ ___ ___ _ __ __ _ ___ ___ ______ ______
// | _ \ __| /_\ | | |_ _/ __|_ _|_ _/ __| | \ /_\ | \/ | /_\ / __| __| |_ / \_ / \
// | / _| / _ \| |__ | |\__ \ | | | | (__ | |) / _ \| |\/| |/ _ \ (_ | _| / / () / / () |
// |_|_\___/_/ \_\____|___|___/ |_| |___\___| |___/_/ \_\_| |_/_/ \_\___|___| /___\__/___\__/
//
//
// ++++++++++++++++++++++++++++ HEAVY VERSION (V1.1) - NO ALPHA ++++++++++++++++++++++++++++
//
// By Ellie, ask your questions here : https://steamcommunity.com/id/ellie_williams/
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// DEFAULT VARIABLES
//
// These variables are defined by default here. Most of them will probably be changed by the user, but they are here as a safe net in case one is forgotten
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$alpha "1" // This is if this VMT must show or not by default (0 = is invisible ; 1 = is visible (default))
$detail "shared/burn" // This is the Bloodmap that will be used for this VMT or this is the Burn/Vomit map if $basetexture has the blood
$detailscale "10"
$frame0ifbelow "100" // Display frame 0 if the survivor is below that amount of health
$frame1ifbelow "-1" // Display frame 1 if the survivor is below that amount of health
$frame2ifbelow "-1" // Display frame 2 if the survivor is below that amount of health
$frame3ifbelow "-1" // Display frame 3 if the survivor is below that amount of health
$frame4ifbelow "-1" // Display frame 4 if the survivor is below that amount of health
$frame5ifbelow "-1" // Display frame 5 if the survivor is below that amount of health
$frame6ifbelow "-1" // Display frame 6 if the survivor is below that amount of health
$frame7ifbelow "-1" // Display frame 7 if the survivor is below that amount of health
$frame8ifbelow "-1" // Display frame 8 if the survivor is below that amount of health
$frameIfDown "0" // Set the frame to display when the survivor is down (it can be one of the above)
$canOnlyGetWorse "0" // Can the Realistic Damage disappear if the survivor uses a Medkit ? (0 = yes ; 1 = no)
$randomBloodPosition "1" // Will the blood/vomit/scorch stains have a randomized position? (0 = no ; 1 = yes)
$randomBloodAngle "1" // Will the blood/vomit/scorch stains have a randomized angle ? (0 = no ; 1 = yes)
$ScaleDET "0.125" // Scale of the blood/burn/vomit texture. The bigger it is, the smaller it will be. You can input [256 divided by your basetexture width] to make them match size.
$CenterDET "0.5" // Center of rotation of the blood/burn/vomit texture, you should normally not change that
$RotateDET "0.0" // Rotation of the blood/burn/vomit texture in degrees. Can be used if no RNG to position the texture precisely.
$TranslationDET "0.0" // Translation of the blood/burn/vomit texture. 0.25 = 25%, shift, 0.5 = 50% shift, 0.75 = 75% shift, 1 = 100% shift, which is the same as 0% shift.
$MinLighting ".74" // Min $lighting allowed
$MaxLighting ".99" // Max $lighting allowed
$LightingBoost ".0" // Additive boost the character $lighting ilumination by this ammount (default: 1)
$BBQMult ".337" // Multiply BBQLevel to tune each phong fresnel channel
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The values in the next block are only useful if you want texture RNG (=/= blood RNG).
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$differentSkins "0" // Amount of different skins you have and you want to RNG for the clothes under the blood (0 = RNG for clothes is deactivated)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The values in the next block are only useful if you have custom made blood textures for the diffuse ($basetexture)
// OR if you only want Fire and Boomer damage and no blood at all
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$useBaseTextureInstead "0" // Must the code use $bastexture instead of $detail for the blood ? (1 = yes ; 0 = no). Change to 1 only if you have custom blood textures painted over the diffuse.
$useDetailAsBoomerVomit "1" // Must the code use $detail as boomer vomit? (1 = yes ; 0 = no). Must be set to 0 if $forceUseBoomerFireSpecial is set to 1. Can be used instead of the blood or with the blood effect if you have custom blood textures painted over the diffuse.
$useDetailAsFireDamage "1" // Must the code use $detail as fire damage? (1 = yes ; 0 = no). Can be used instead of the blood or with the blood effect if you have custom blood textures painted over the diffuse
$fireEffectDecayTime "33" // Time in seconds it takes for the fire effect to disappear. Useful only if the previous value is set to 1
$forceNoDecayIfMax "1" // If the maximum burn amount is reach, should the code stop making it gradually disappear ? (0 = no ; 1 = yes) (if it wears off it can't be triggered again until next map)
$bileFrame "1" // Frame of the $detail where the bile effect is. If you use the Realistic Bloodmap resources mod, do not change (default = 1)
$bothFrame "2" // Frame of the $detail where both the bile effect and fire effect is. If you use the Realistic Bloodmap resources mod, do not change (default = 2)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The values in the next block are only useful for debug and testing purposes
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$scrollShowcase "0" // Debug feature to scroll through different $detail. Set the number to the amount of different blood levels the $detail you're using has (does not worth if you have custom blood textures painted over the diffuse)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The next value should normally not be changed, unless you did a mistake
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$detailblendmode "0" // $detail blend mode. Should normally be set to 0. Do not change it unless you know what you're doing.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// DO NOT MODIFY ANYTHING BELOW THIS
// DO NOT MODIFY ANYTHING BELOW THIS
// DO NOT MODIFY ANYTHING BELOW THIS
// DO NOT MODIFY ANYTHING BELOW THIS
// DO NOT MODIFY ANYTHING BELOW THIS
// DO NOT MODIFY ANYTHING BELOW THIS
// DO NOT MODIFY ANYTHING BELOW THIS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The next values should not be changed, they're part of Debiddo's injection blocks
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$false "0"
$true "1"
$clr ".0"
$dummy ".0"
$DetailFactor ".0"
$lighting ".5"
$LightingWarped ".0"
$LightingQuarter ".0"
$Modulator ".0" // this is $clr difference. equals to: $Modulator = 1 - $clr
$Emissive ".0" // where to store my whole emissive calcs
$MinEmissive ".0" // generated by proxies equals to: $MinEmissive = $emissiveblendstrength * 0.25
$MaxEmissive ".0" // generated by proxies equals to: $MaxEmissive = $emissiveblendstrength + $MinEmissive
$EmissiveThreshold ".08" // if $lighting is bellow this, $MinEmissive will not be added at end of computation
$EmissiveIsBellowThreshold ".0" // if $lighting >= $EmissiveThreshold then $EmissiveIsBellowThreshold == $clr else $lighting
$EmissiveStrength ".09" // the strength of $emissiveblendtexture ( clamped between 0.000 ~ 1.000 at shader level )
$EmissiveStrengthCached ".0" // prevent undesired ramp, also allow user disable the whole effect with $EmissiveProxie "0"
$EmissiveBlendTint_0 ".0" // reference fetch by $emissiveblendtint Red Channel
$EmissiveBlendTint_1 ".0" // reference fetch by $emissiveblendtint Green Channel
$EmissiveBlendTint_2 ".0" // reference fetch by $emissiveblendtint Blue Channel
$EmissiveBlendTintR ".0" // EmissiveBlend read-only $emissiveblendtint Red Channel
$EmissiveBlendTintG ".0" // EmissiveBlend read-only $emissiveblendtint Green Channel
$EmissiveBlendTintB ".0" // EmissiveBlend read-only $emissiveblendtint Blue Channel
$EnvMapReference ".99" // EnvMap reference used for modulate $envmaptint
$EnvMapModulator ".0"
$EnvMapTint_0 ".0" // reference fetch by $envmaptint Red Channel
$EnvMapTint_1 ".0" // reference fetch by $envmaptint Green Channel
$EnvMapTint_2 ".0" // reference fetch by $envmaptint Blue Channel
$EnvMapTintR ".0" // EnvMap read-only $envmaptint Red Channel
$EnvMapTintG ".0" // EnvMap read-only $envmaptint Green Channel
$EnvMapTintB ".0" // EnvMap read-only $envmaptint Blue Channel
$color_0 ".0" // reference fetch by $color Red Channel
$color_1 ".0" // reference fetch by $color Green Channel
$color_2 ".0" // reference fetch by $color Blue Channel
$colorR ".0" // Color read-only $color Red Channel
$colorG ".0" // Color read-only $color Green Channel
$colorB ".0" // Color read-only $color Blue Channel
$PhongFresnelRangeX ".0" // 0º fresnel value used by proxie
$PhongFresnelRangeY ".0" // 45º fresnel value used by proxie
$PhongFresnelRangeZ ".0" // 180º fresnel value used by proxie
$PhongFresnelRange_0 ".0" // 0º $phongfresnelranges read-only
$PhongFresnelRange_1 ".0" // 45º $phongfresnelranges read-only
$PhongFresnelRange_2 ".0" // 180º $phongfresnelranges read-only
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$detailtexturetransform "center .5 .5 scale 1 1 rotate 0 translate 0 0" // Initiatlisation of the detail position variable (engine)
$detailblendfactor ".0" // Initiatlisation of the detail blend factor (engine)
$detailframe "0" // Initiatlisation of the detailframe (engine)
$frame "0" // Initiatlisation of the frame (engine)
$blendTintByBaseAlpha "0" // Failstate if colorRNG needs to be used with other VMTs that do not have it
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CODE VARIABLES
// These variables are the ones the code will use. The user is not supposed to change any of them. Any change can result in the code breaking
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Numerical variables
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$moo ".01"
$mo "-1"
$Quarter ".25"
$Half ".5"
$zero "0"
$one "1.0"
$onn "1.98"
$two "2"
$three "3"
$four "4"
$five "5"
$six "6"
$seven "7"
$eight "8"
$oh "100"
$oho "101"
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Variables for BLOCK 1 - Debug feature showcase (initialisation)
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$showcaseRamp "0" // Used to store a ramp to create a looping number
$showcaseRampInv "0" // Used to store the opposite of a ramp to create a looping number
$showcaseRampOffset "0" // Used to offset a ramp
$showcaseRampTemp "0" // Used to store the result of the ramp plus an offset
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Variables for BLOCK 2 - Blood effect manipulation
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$rand ".0" // Used to store a random number to shift and rotate the blood effect accordingly
$randFixed ".0" // Used to store a random number only once. Must be initiated to 0.
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Variables for BLOCK 3 - Retrieve data
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$sine "0" // This is used just to store a sine wave (used as a buffer)
//-------------------------- Health related
$scale "100"
$healthCurrent "100" // This is used to store the % of health the survivor currently has (note that the "health" is 100 if the survivor is down)
$worstHealth "100" // This is used to store the worst health the survivor has had during the map. Useful if $canOnlyGetWorse is set to 1
$healthPercent "100" // This is a temporary variable used to make comparisons to find the correct frame to display (either $healthCurrent or $worstHealth is injected into)
$hasTakenDamage "0" // This is used to store if the survivor has ever been below 100 health (0 = no ; 1 = yes)
$noInjectWorstHealth "0" // This is used to prevent the injection of the health level if it is 0
$worstHealthToInject "0" // This is used as temporary storage
$mustHeal "0" // This is used to know if the survivor still must heal after being down
$mapRestartTPK "0" // This is used to know if the map restarted after a TPK on the first map of the campaign
//-------------------------- Speed related
$ismoving "0" // This is used to store if the entity is moving (0.0000 = no, 0.0001+ = yes)
$playerSpeed "0" // This is used to store the player speed itself (and not the entity or survivor speed)
//-------------------------- Position related
$pos " [ 0 0 0 ] " // Used to store the position of the player when he spawns
$posX ".0" // The X coordinate position of the player
$posXStored ".0" // The X position of the player stored when he first spawned
$posY ".0" // Ditto Y coordinate
$posYStored ".0"
$posZ ".0" // Ditto Z coordinate
$posZStored ".0"
$entityorigin " [ 0 0 0 ] " // Engine variable that tells the material origin when the corresponding Proxy sets it
$posXDELTA ".0" // Used to store the difference between the current and starting position (X coordinate)
$posYDELTA ".0" // Ditto Y coordinate
$posZDELTA ".0" // Ditto Z coordinate
$posTOLERANCE "600.0" // [CRITICAL] : If the player is this units away from spawn, he'll be considered out of spawn
$isNearTheStart "0" // Used to determine if the player is near the place where the survivor spawned
//-------------------------- Fire related
$burnRaw ".0" // This is used to store the raw amount of "burn" (BBQLevel) of the survivor or infected
$burnAmount ".0" // This is used to store the real amount of burn (between 0 = no burn to 1 = max burn)
$worstBurnAmount ".0" // This is used to store the worst burn amount ever reached and force a loop to restart
$BBQ ".0" // store the BBQ math to phong fresnel
$forceMaxSoot "0" // [SPECIAL] : if is equal to 2, force the biggest possible burn effect no matter what
$fireDecayConverted ".0" // The "converted" value from user specified seconds to decimal
$decayRamp ".0" // This is used to store an ever increasing value (decay of the burn effect)
$decayRampInv ".0" // This is used to store the opposite of this ever increasing value
$decayRampTemp ".0" // Although its name, this is used to pass the final result of the decay ramp and offsetting to the later code, for it to (maybe) be subtracted from the fire
$decayRampOffset ".0" // Used to offset the decay ramp
//-------------------------- Vomit (Boomer) related
$bileRaw ".0" // This is used to store the raw amount of vomit on the survivor (it goes back to 0 on its own when the vomits wears off)
$bileAmount ".0" // This is used to store the amount of boomer bile to work with (clamped variable)
//-------------------------- Time related
$serverTime ".0" // This is used to know if the server just started
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Variable for BLOCK 4 - Get Frame to display
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$frametodisplay "0" // This is used to store the frame we need to display after it has been "identified" according to the comparison health
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Variable for BLOCK 5 - Check if down
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$isdown "0" // This is used to store the status of the survivor (0 = up and walking) (1 = downed but still alive)
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Variable for BLOCK 6 - Injector Detailblendfactor
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$dbfToInject ".0" // This is used to store the starting hypothesis for what $detailblendfactor will be
$burnOrBile "0" // If this is above 0, either the burn of vomit effects are active and therefore a frame change can occur
$dbfDecayToSubtract ".0" // This is used to store the number to subtract from the burn amount the burn effect is set to decay
$dbfAfterDecay ".0" // This is used to store the result of the subtracting operation just mentionned
$dbfAfterDecayClamp ".0" // Ditto but after clamping of the value
$forceUseBoomerFireSpecial "0" // Although its name, this just equals 1 if both effects are in use, if not it equals 0 (the code checks it)
$boomerMaxPriority ".0" // This stores if the Boomer effect must have absolute priority
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Variable for BLOCK 7 - Injector Frame and Detailframe
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$frameIsEntity "0" // This is used to make comparisons (temp value)
$frametoinjectTemp "0" // This is used to make comparisons (temp value)
$detailframetoinjectTemp "0" // This is used to make comparisons (temp value)
$frametoinject "0" // This is used to store the frame we need to display
$detailframetoinject "0" // This is used to store the detailframe we need to display
$bileFrameSelected "0" // This is used to store the correct $detailframe to display if bile effect is active (the vomit alone or vomit+burn effect)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// PROXIES
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Proxies
{
// #######################################################################################################
// BLOCK 1 : SHOWCASE GALLERY - Debug feature that allow modders to see all the textures scrolling
// #######################################################################################################
// ========================================================================================================================
// Generates a looping number between 0 and the value defined in $scrollShowcase
// ========================================================================================================================
LinearRamp // Generates an every increasing value and stores it into $showcaseRamp
{
rate $one
resultVar $showcaseRamp
}
Multiply // Gets the opposite of $showcaseRamp and stores it into $showcaseRampInv
{
srcVar1 $mo
srcVar2 $showcaseRamp
resultVar $showcaseRampInv
}
LessOrEqual // If the final result of the Ramp is over $scrollShowcase, the Ramp Offset is set to the opposite of itself
{
LessEqualVar $showcaseRampOffset
greaterVar $showcaseRampInv
srcVar1 $showcaseRampTemp
srcVar2 $scrollShowcase
resultVar $showcaseRampOffset
}
Add // Adding the Ramp and its Offset. If the Offset is equal to minus the ramp, it creates a looping number
{
srcVar1 $showcaseRamp
srcVar2 $showcaseRampOffset
resultVar $showcaseRampTemp // This value is later used in the injection step (frame&detail) in BLOCK 10
}
// #######################################################################################################
// BLOCK 2 : RANDOM BLOOD ANGLE & POSITION - If toggled by the user, modifies the angle and position of the $detail to give RNG blood
// #######################################################################################################
// ========================================================================================================================
// Gets a random number between 0 and 359, only once, then injects it into the translation and rotate variables if the user activated the effect
// ========================================================================================================================
EntityRandom // Stores a random number from 0 to 359 (359 is needed to have all the possible rotation angles)
{
scale "359"
resultVar $rand
}
LessOrEqual // Ensures that the number is stored only once by putting it in $randFixed only if it has (still) its initial value of 0
{
LessEqualVar $rand
greaterVar $randFixed
srcVar1 $randFixed
srcVar2 $zero
resultVar $randFixed
}
LessOrEqual // If $randomBloodPosition is higher than 0, injects the random number into the Translation variable
{
LessEqualVar $TranslationDET
greaterVar $randFixed
srcVar1 $randomBloodPosition
srcVar2 $zero
resultVar $TranslationDET
// N.b. the only thing that matters for the translation is the decimal part of the random number.
}
LessOrEqual // If $randomBloodAngle is higher than 0, injects the random number into the Rotation variable
{
LessEqualVar $TranslationDET
greaterVar $randFixed
srcVar1 $randomBloodAngle
srcVar2 $zero
resultVar $RotateDET
}
TextureTransform // Injects the values (either user defined and/or randomized) into $detailtexturetransform (engine variable)
{
centerVar $CenterDET
scaleVar $ScaleDET
rotateVar $RotateDET
translateVar $TranslationDET
resultVar $detailtexturetransform // This is a FINAL INJECTION, the value is not used afterwards.
}
// #######################################################################################################
// BLOCK 3 : PARAMETERS IMPORT - This block imports parameters from within the game
// #######################################################################################################
// ========================================================================================================================
// This blocks generates a sine wave, that goes from -1 to 2 to -1 in 2 seconds
// ========================================================================================================================
Sine // Sine wave, that goes from -1 to 2 to -1 in 2 seconds
{
sineperiod $two
sinemin $mo
sinemax $two
resultVar $sine
}
// N.b. This is used at various places in the code to create buffers while checking if conditions are met only once per second instead of all the time
// ========================================================================================================================
// This blocks gets the current position of the player
// ========================================================================================================================
PlayerPosition // Stores the player position in a matrix
{
scale "1"
resultVar $pos
}
Clamp // Sends the first row of the position matrix into a $poxX variable
{
srcVar1 $zero
min "$pos[0]"
max "$pos[0]"
resultVar $posX
}
Clamp // Sends the first row of the position matrix into a $poxY variable
{
srcVar1 $zero
min "$pos[1]"
max "$pos[1]"
resultVar $posY
}
Clamp // Sends the first row of the position matrix into a $poxZ variable
{
srcVar1 $zero
min "$pos[2]"
max "$pos[2]"
resultVar $posZ
}
Abs // Makes sure the position is positive
{
srcVar1 $posX
resultVar $posX
}
Abs // Makes sure the position is positive
{
srcVar1 $posY
resultVar $posY
}
Abs // Makes sure the position is positive
{
srcVar1 $posZ
resultVar $posZ
}
LessOrEqual // Stores the X coordinate only once when the player spawns
{
LessEqualVar $posX
greaterVar $posXStored
srcVar1 $posXStored
srcVar2 $zero
resultVar $posXStored
}
LessOrEqual // Stores the Y coordinate only once when the player spawns
{
LessEqualVar $posY
greaterVar $posYStored
srcVar1 $posYStored
srcVar2 $zero
resultVar $posYStored
}
LessOrEqual // Stores the Z coordinate only once when the player spawns
{
LessEqualVar $posZ
greaterVar $posZStored
srcVar1 $posZStored
srcVar2 $zero
resultVar $posZStored
}
// ========================================================================================================================
// This blocks gets the difference between the origin and current position of the player and check if it's at least $posTOLERANCE units away in any direction
// ========================================================================================================================
Subtract // Getting the position difference on X axis
{
srcVar1 $posXStored
srcVar2 $posX
resultVar $posXDELTA
}
Subtract // Getting the position difference on Y axis
{
srcVar1 $posYStored
srcVar2 $posY
resultVar $posYDELTA
}
Subtract // Getting the position difference on Z axis
{
srcVar1 $posZStored
srcVar2 $posZ
resultVar $posZDELTA
}
Abs // Making the difference positive for the comparison below
{
srcVar1 $posXDELTA
resultVar $posXDELTA
}
Abs // Making the difference positive for the comparison below
{
srcVar1 $posYDELTA
resultVar $posYDELTA
}
Abs // Making the difference positive for the comparison below
{
srcVar1 $posZDELTA
resultVar $posZDELTA
}
LessOrEqual // If the difference between the values (X axis) is less than $posTOLERANCE, we are near the start
{
LessEqualVar $one
greaterVar $zero
srcVar1 $posXDELTA
srcVar2 $posTOLERANCE
resultVar $isNearTheStart
}
LessOrEqual // Ditto check for Y axis. If the position isn't near, it flags $isNearTheStart to 0
{
LessEqualVar $isNearTheStart
greaterVar $zero
srcVar1 $posYDELTA
srcVar2 $posTOLERANCE
resultVar $isNearTheStart
}
LessOrEqual // Ditto check for Y axis. If the position isn't near, it flags $isNearTheStart to 1
{
LessEqualVar $isNearTheStart
greaterVar $zero
srcVar1 $posZDELTA
srcVar2 $posTOLERANCE
resultVar $isNearTheStart
}
// ========================================================================================================================
// This blocks gets the % of health the survivor currently has (in $healthCurrent) and scales it to match 100 (default is between 0 and 1)
// ========================================================================================================================
Health
{
scale $scale
resultVar $healthCurrent // This is used immediadly after to calculate the worst health
} // This is also used later in the code to make various comparisons
// N.b. This gets the value of the "real" health the survivor has. The decaying health (after eating pain pills or adrenaline) doesn't count.
// N.b. This goes to 400 when the survivor is down but is automatically clamped to 100. Therefore, when the survivor goes goes, its "health" goes to 100
// ========================================================================================================================
// This blocks gets a timing value related to the server active time
// ========================================================================================================================
CurrentTime
{
resultVar $serverTime
}
// ========================================================================================================================
// This blocks gets the worst health level the survivor has ever had since the beginning of the map
// ========================================================================================================================
LessOrEqual // If the health is 0.00, it should not be injected, because it's a "fake" health given by the FPS arms or the dead corpse
{
LessEqualVar $one
greaterVar $zero
srcVar1 $healthCurrent
srcVar2 $zero
resultVar $noInjectWorstHealth
}
LessOrEqual // Stores the current health in $worstHealthToInject only if it's worse than the worst health ever
{
LessEqualVar $healthCurrent
greaterVar $worstHealth
srcVar1 $healthCurrent
srcVar2 $worstHealth
resultVar $worstHealthToInject
}
LessOrEqual // Actually does the final storage only if $noInjectWorstHealth is equal to 0
{
LessEqualVar $worstHealthToInject
greaterVar $worstHealth
srcVar1 $noInjectWorstHealth
srcVar2 $zero
resultVar $worstHealth
}
// ========================================================================================================================
// This blocks gets the speed the entity (survivor) and the player currently have
// ========================================================================================================================
EntitySpeed // This gets the speed of the surviror and stores it into $ismoving
{
resultVar $ismoving // This is later used to determine if the survivor is down or not in BLOCK #
}
PlayerSpeed // This gets the speed of the player and stores it into $playerSpeed
{
resultVar $playerSpeed // This is later used to determine if the player is down or not in BLOCK #
}
// N.b. The speed itself doesn't matter in this code. The only thing that matters is the survivor is moving, so if its speed is above 0
// ========================================================================================================================
// This blocks gets the amount of burn damage the survivor has taken (between 0 and 1)
// ========================================================================================================================
BBQLevel // This gets a value that starts at 1 and gradually goes down to 0 the more time the survivor spend in fire
{
resultVar $burnRaw
}
Subtract // This inverts the value of $burnRaw to get $burnAmount. If we didn't do so, the effect would go in reverse ($burnAmount = 1 - $burnRaw)
{
srcVar1 $one
srcVar2 $burnRaw
resultVar $burnAmount // This is later used to set the burn amount in BLOCK #
}
Multiply
{
srcVar1 $burnAmount
srcVar2 $useDetailAsFireDamage
resultVar $burnAmount
}
// ========================================================================================================================
// This blocks gets the amount of vomit (boomer) on the survivor (between 0 and 1).
// ========================================================================================================================
IT // This gets a value between 0 and 1 that is the amount of vomit. It starts at 1 then decreases to 0 in engine when the effect wears off
{
resultVar $bileRaw
}
LessOrEqual // This stores $bileRaw into a new $bileAmount but forces it to be 1 if $forceMaxSoot is equal to 2 (over 1.98)
{ // $forceMaxSoot is equal to 2 when $burnAmount is equal to 1 AND when the user set $forceNoDecayIfMax to 1
LessEqualVar $bileRaw
greaterVar $one
srcVar1 $forceMaxSoot
srcVar2 $onn
resultVar $bileAmount
}
Clamp // As a safety measure, the $bileAmount is limited from 0 to 1. This prevents glitches when this value is later injected into $detailblendfactor
{
min "0"
max "1"
srcVar1 $bileAmount
resultVar $bileAmount
}
// ========================================================================================================================
// This blocks tries to guess if the player has taken damage already
// ========================================================================================================================
LessOrEqual // If the survivor health is bigger than 100, the $hasTakenDamage is reset to zero
{
LessEqualVar $hasTakenDamage
greaterVar $zero
srcVar1 $healthCurrent
srcVar2 $oh
resultVar $hasTakenDamage
}
// N.b. this should normally not occur, but as some L4D2 custom servers allow HP above 100.
LessOrEqual // If the worst health the survivor had is lower than 100, the survivor has taken damage (pretty straightforward)
{
LessEqualVar $hasTakenDamage
greaterVar $one
srcVar1 $oh
srcVar2 $worstHealth
resultVar $hasTakenDamage // This value is used later in BLOCK 5 to check if the survivor is down
}
// ========================================================================================================================
// This blocks returns a value ($decayRampTemp) that corresponds to the amount of burn factor ($detailblendfactor) to inject
// ========================================================================================================================
Divide // This converts the fire decay rate (user defined) into a float between 0 and 1 to be used as the rate for the linear ramp
{
srcVar1 $one
srcVar2 $fireEffectDecayTime
resultVar $fireDecayConverted
}
LinearRamp // This stores an ever increasing value in $decayRamp at a user defined (converted, see last proxy) rate
{
rate $fireDecayConverted
resultVar $decayRamp
}
Multiply // This gets the opposite of said ever increasing ramp
{
srcVar1 $mo
srcVar2 $decayRamp
resultVar $decayRampInv
}
// If the amount of burn is higher than the worst it ever was, it means the survivor is burning (see next section for $worstBurnAmount). In this
// case, we inject $decayRampInv into $decayRampOffset. The ramp offset will therefore be equal to its opposite, making it restart at 0
LessOrEqual
{
LessEqualVar $decayRampOffset
greaterVar $decayRampInv
srcVar1 $burnAmount
srcVar2 $worstBurnAmount
resultVar $decayRampOffset
}
// Double condition (if $forceNoDecayIfMax = 1 && $burnAmount = 1 ; $forceMaxSoot = 2).
Add // If both the $burnAmount is equal to 1 (its maximum) and user defined $forceNoDecayIfMax is set to 2, we need to force the max burn effect (soot) in any case
{
srcVar1 $forceNoDecayIfMax
srcVar2 $burnAmount
resultVar $forceMaxSoot
}
LessOrEqual // If we have to force the maximum burn effect because $forceMaxSoot = 2 (>1.98), then $decayRampOffset must always stay its $decayRampInv
{
LessEqualVar $decayRampOffset
greaterVar $decayRampInv
srcVar1 $forceMaxSoot
srcVar2 $onn
resultVar $decayRampOffset
}
Add // This offsets the ramp
{
srcVar1 $decayRamp
srcVar2 $decayRampOffset
resultVar $decayRampTemp // This final result will be subtracted to the $detailblendfactor in BLOCK 6 at the injection stage
}
// ========================================================================================================================