Left 4 Dead 2

Left 4 Dead 2

152 ratings
Realistic Damage (Modders Guide)
By Ellie
This Guide allows Modders to implement Realistic Damage (DMG) to their characters mods.
   
Award
Favorite
Favorited
Unfavorite
Tl;dr
If you do not want to spend more than 15 seconds reading this Guide and want an immediate result or to test the concept, just go directly to 🆄 ULTRA LIGHT and follow the 3 steps, that's all.
[General Information]
Difficulty :

Short description : Allows modders to implement realistic damage in their mods.

Time to implement : 10 seconds (it takes more time to customize to your exact likings)

Required before starting
  1. This ressource mod (unless you want to go with the ultra light default version)
    https://sp.zhabite.com/sharedfiles/filedetails/?id=2237889549
  2. An already set up survivor or special infected mod with all its VMT and VTF
  3. VTFEdit (preferably) or a similar text editing software
Minimal skills :
  • Knowing what a VMT and VTF file is
  • Knowing how to edit a VMT (copy & paste)
Recommended skills :
  • Basic math (geometrical) logic
Optimal skills :
  • Basic knowledge in a standard graphics software (Photoshop, Gimp, Substance painter)
  • Basic math knowledge of exponential functions
What is Realistic Damage ?
What is it ?
''Realistic Damage'' (or simply DMG) is a technique to modify the material textures files (VMT) of a mod to allow damage effets to appear based on different parameters, but mainly the survivor health.

This technique is mainly focused on the third person model and not on the first person model. The first person model can still change accordingly but only when the survivor goes into 3rd person mode, which happens mainly when he gets grabbed by a special infected or heals on its own.

This technique is also mainly focused on the blood effect. Its main purpose is to make such effects appear on the survivor if he has low health (or gradually). However, it also allows (in its heavy version) the total disappearance or apperance of the VMT ($alpha) under certain health thresholds. Also, provided that you have different custom blood textures for your survivor, it also allows to add fire (scroch) and boomer bile effects.

This technique is compatible with RNG and already includes all what is needed. You don't even need to read the RNG Guide.

However, unless you make custom blood diffuse textures ($basetexture) yourself, this technique actually replaces the boomer effect on a survivor when they have puke on it. It's still possible to use both if you set up your mod with _it.vmt files (that are (were) actually useless).

Bear in mind that this technique is still a bit experimental, and even with my countless hours of testing and trying to make it as good as possible and as simple to implement as possible, some oversights might have slipped through. Therefore, I invite you to report any bug or ask questions here if you have a problem.

Thanks to how the technique is set up, I'll be able to release hotfixes that will correct even the already released mods. So your mods made with this technique will (hopefully) always be up to date.

Questions and Answers (Q&A)
Q : Does it work on special infected ?
Yes.
Q : Does it work on common infected ?
I have not tested it but due to how it works, it might cause come glitches.
Q : Does it work in first person ?
Partially and as long as the VMT for the first person (arms) is the same as the one for the third person. It works partially because the FPS arms only get updated when the survivor is grabbed by an infected or heals with a Medkit. It looks realistic enough not to be disturbing though.
Q : Can I customize it ?
Yes, 95% of this Guide is about customizing the effect to your likings.
Q : Is this RNG compatible ?
Yes, but you need to delete any previously set RNG code or variables first
Q : Is there any glitches ?
Due to how complex it can become, probably, but I've spend hours to fix all the common glitches that were also common in other mods. There is no blinking effect, no random texture change upon death etc.
Q : Is there a way to change the texture of an object / gun depending on the survivor health ?
Sadly, this seems to be currently impossible.
Q : Could that work in GarrysMod ?
I haven't tested it myself. The code would need a bit of edit because there are no Medkits in GarryMod and some part of it should be scrapped. However, given if GarryMod has all the same Proxies, this could maybe work.

Screenshots
Default Ultra Light (Copy&Paste) version
It takes approximately 5 seconds per VMT to get this result



Light version (with a change from the default blood to one in the ressource file)
It takes 20 seconds per VMT to get this result after you chose which (provided) blood texture to use




Heavy version (with custom made blood textures for the character)
It takes time to do blood textures, but once you have them, it takes 60 seconds per VMT to customize



How much time does it take to add this to a mod ?
It can really vary from one mod to another and depending on what version you plan to use.
I did the test and tried to convert this mod for fun : https://sp.zhabite.com/sharedfiles/filedetails/?id=2232724518 I started the counter at the second I clicked "Subscribe" on this mod. It took 6 minutes to achieve this result, all this while having to change the code version mid convert because I realized that this mod had RNG and that I needed to implement that too in emergency (it would have actually taken even less time if I didn't have to delete it from the mod first).

For the second test, I changed the blood (that I had forgotten to change), reduced the size of the texture, and added $nocull. This was the result after 9 minutes.

The blood was now too small, so I made it bigger, but it still looked quite wrong on the face. This was the result after 12 minutes.
Finally, I changed the texture for the blood on the face so it looks better. This was the final (decent enough) result after 15 minutes, and I did count the time to take these quick screenshots.


Obviously, I knew what I was doing, but if you read this Guide, you'll know too. All in all, it will probably take you more time to publish your mod than to actually convert it.

The 4 versions
There are 4 main versions of the technique, and the first thing you need to do is to choose one depending on what you want to do. Among these versions, 2 are variants of one another : Ultra Light is a variant of Light and Medium is a variant of Heavy.

Light and Heavy work in a completely different fashion. In short :
Light uses only one blood texture and the more damage the survivor takes, the more opaque (visible) it makes the texture. The effect is similar to how the boomer effect works.
Heavy uses multiple different blood textures textures, and switches textures each time a health level (threshold) is met. It's more realistic but also more demanding and takes more time to customize.

What version do I need ?
To know what version you need to use (the one that best fits your needs), answer these questions as long as the answer asks you to do so (stop as soon as it tells you to do something):

Question 1 :
Are you already annoyed even though I haven't asked a question yet?
Yes ▶ You need Ultra Light.
No ▶ Go to the next question

Question 2 :
Would you like to make custom blood textures yourself that are painted over the $basetexture?
Yes ▶ You need Heavy.
No / I don't understand ▶ Go to the next question

Question 3 :
Do you plan on having whole VMTs that appear or disappears (like broken armor)? ($alpha)
Yes ▶ You need Medium.
No / I don't understand ▶ Go to the next question

Question 4 :
Would it disturb you if the blood effect gradually appeared the more the survivor takes damage?
Yes ▶ You need Medium.
No / I don't understand ▶ Go to the next question

Question 5 :
Do you have RNG clothes that need to show under the blood?
Yes ▶ You need Light.
No ▶ Go to the next question

Question 6 :
Is it your first time testing Realistic Damage and want some debug options?
Yes ▶ You need Light.
No ▶ Do Ultra Light.

Note that you don't need to use the same version for every VMT and you can combine different ones in a same mod. You can even set completely different parameters, blood, effects for each individual VMT and customise everything to your likings.

List of the current versions and features
MAIN VERSIONS

Ultra Light (current implementation code : rdmg/ultralight_v1.vmt)
  • Blood effect that goes from invisible to more opaque the more a survivor takes damage
  • Allows to choose your own blood texture instead of the default one
  • Allows to RNG the blood effect position so it's always different
  • Allows to set precisely instead where the blood effect should be on each texture
  • Allows to choose if the use of a Medkit heals the effect (can be different depending on the VMT)
Light (current implementation code : rdmg/light_v1.vmt)
  • Everything allowed by the Ultra Light version
  • Allows RNG support for the $basetexture (if there needs to be RNG on the clothes)
  • Allows to change the blood apperance function from linear to a custom exponential function
  • Has a debug tool to force the blood to show all the time to see how it looks
  • Has a debug tool to force the blood to circle through all the possible textures (requires this mod)

Medium (current implementation code : rdmg/medium_v1.vmt)
  • Multiple frames blood effect (at each defined health level, more stains will appear)
  • Allows up to 9 different health levels that can all be user defined
  • Allows the use of a special frame only for when the survivor is down
  • Allows to choose your own blood texture instead of the default one (only 1 variant is avaliable yet )
  • Allows to RNG the blood effect position so it's always different
  • Allows to set precisely instead where the blood effect should be on each texture
  • Allows to choose if the use of a Medkit heals the effect (can be different depending on the VMT)
  • Allows RNG support for the $basetexture (if there needs to be RNG on the clothes)
  • Allows to set a health level for the material to appear (wound / bandage) and/or disappear (armor)
  • Allows to RNG the disappearance of the material each time the health level is passed
  • Has a debug tool to force the blood to scroll through all the possible blood levels
Heavy (current implementation code : rdmg/heavy_v1.vmt) - [requires custom blood diffuse texture]
  • Everything allowed by the Medium version except RNG support for the $basetexture
  • Allows the blood to be contained in the texture instead of the detail overlay to trigger other effects
  • Allows the use of a special fire damage effect in addition to the blood effect
  • Allows the use of boomer bile vomit effect in addition to the blood (and fire) effect
  • Allows to customize if and at what rate the fire damage effect wears off
  • Allows to customize the texture of the fire and boomer vomit effect

    Note that if the technique (and this Guide) ever gets a major update that changes the version (_v) and makes it not compatible with the previous versions, the old versions will of course stay in the ressource mod as legacy versions. Small hotfixes will be injected in the same version though. Please report any issue.
🆄 ULTRA LIGHT
Make sure to remove any RNG code and all the variables ($) that came with it before doing any of these steps (reverse the mod to how it was before adding RNG)

STEP 1
Download this mod (you will need to tell your subscribers to download it too) :
https://sp.zhabite.com/sharedfiles/filedetails/?id=2237889549
STEP 2
Open one of your VMT that needs the blood effect and add one...
}
...at the very end.

STEP 3
See this thing at the beginning of the VMT ? (it can have quotes or not)
"VertexLitGeneric" {
Replace it with this :
patch { include "rdmg/ultralight_v1.vmt" insert { //////////////////////////////////////////////////////////////////////////// // Realistic Damage (DMG) - Ultra Light V1 /////////////////////////////////////////////////////////////////////////// $detail "models\infected\hunter\hunter_01_detail" $canOnlyGetWorse "0" $randomBloodPosition "0" $randomBloodAngle "0" $ScaleDET "0.5" $CenterDET "0.5" $RotateDET "0.0" $TranslationDET "0.0" $shinyblood "0" $detailblendmode "0" $detailblendfactor "0.0" $detailtexturetransform "center .5 .5 scale 1 1 rotate 0 translate 0 0" //////////////////////////////////////////////////////////////////////////////////
Nb. if you didn't see VertexLitGeneric but there's already patch, you need to replace insert { and everything that is above by the code instead.



ALTERNATIVE METHOD (COPY&PASTE)
This method is quick but not recommended because if you do it like this, your mod will not automatically benefit from updates (or bug fixes) of the code. This is the only reason why. If you don't care, go ahead.
Instead of doing steps 1 to 3, you can simply copy and paste this big block of code anywhere in your VMT (above the last }) and it will work straight away even without the mod.
//////////////////////////////////////////////////////////////////////////// // Realistic Damage (DMG) - Ultra Light V1 /////////////////////////////////////////////////////////////////////////// $detail "models\infected\hunter\hunter_01_detail" $canOnlyGetWorse "0" $randomBloodPosition "1" $randomBloodAngle "1" $ScaleDET "0.5" $CenterDET "0.5" $RotateDET "0.0" $TranslationDET "0.0" $shinyblood "1" $detailblendmode "0" $detailblendfactor "0.0" $detailtexturetransform "center .5 .5 scale 1 1 rotate 0 translate 0 0" //--------------------------------------------------------------------------------- // NEVER TOUCH ANYTHING IN THE CODE BELOW THIS //--------------------------------------------------------------------------------- $moo .01 $mo "-1" $zero "0" $one "1" $oh "100" $rand "0.0" $randFixed "0.0" $scale "100" $healthCurrent "100" $worstHealth "100" $healthPercent "100" $noInjectWorstHealth "0" $worstHealthToInject "0" $mustHeal "0" $hasTakenDamage "0" $ismoving "0" $playerSpeed "0" $dbftoInvert "0" $dbftodisplay "0" $dbfIsEntity "0" $isdown "0" $dbftoinject "0" Proxies { EntityRandom { scale 359 resultVar "$rand" } LessOrEqual { LessEqualVar "$rand" greaterVar "$randFixed" srcVar1 "$randFixed" srcVar2 "$zero" resultVar "$randFixed" } LessOrEqual { LessEqualVar "$TranslationDET" greaterVar "$randFixed" srcVar1 "$randomBloodPosition" srcVar2 "$zero" resultVar "$TranslationDET" } LessOrEqual { LessEqualVar "$TranslationDET" greaterVar "$randFixed" srcVar1 "$randomBloodAngle" srcVar2 "$zero" resultVar "$RotateDET" } TextureTransform { centerVar "$CenterDET" scaleVar "$ScaleDET" rotateVar "$RotateDET" translateVar "$TranslationDET" resultVar "$detailtexturetransform" } Health { scale "$scale" resultVar "$healthCurrent" } LessOrEqual { LessEqualVar "$one" greaterVar "$zero" srcVar1 "$healthCurrent" srcVar2 "$zero" resultVar "$noInjectWorstHealth" } LessOrEqual { LessEqualVar "$healthCurrent" greaterVar "$worstHealth" srcVar1 "$healthCurrent" srcVar2 "$worstHealth" resultVar "$worstHealthToInject" } LessOrEqual { LessEqualVar "$worstHealthToInject" greaterVar "$worstHealth" srcVar1 "$noInjectWorstHealth" srcVar2 "$zero" resultVar "$worstHealth" } EntitySpeed { resultVar "$ismoving" } PlayerSpeed { resultVar "$playerSpeed" } LessOrEqual { LessEqualVar "$hasTakenDamage" greaterVar "$zero" srcVar1 "$healthCurrent" srcVar2 "$oh" resultVar "$hasTakenDamage" } LessOrEqual { LessEqualVar "$hasTakenDamage" greaterVar "$one" srcVar1 "$oh" srcVar2 "$worstHealth" resultVar "$hasTakenDamage" } LessOrEqual { LessEqualVar "$healthCurrent" greaterVar "$worstHealth" srcVar1 "$canOnlyGetWorse" srcVar2 "$zero" resultVar "$healthPercent" } Multiply { srcVar1 "$healthPercent" srcVar2 "$moo" resultVar "$dbftoInvert" } Subtract { srcVar1 "$one" srcVar2 "$dbftoInvert" resultVar "$dbftodisplay" } LessOrEqual { LessEqualVar "$isdown" greaterVar "$zero" srcVar1 "$playerSpeed" srcVar2 "$zero" resultVar "$isdown" } LessOrEqual { LessEqualVar "$hasTakenDamage" greaterVar "$isdown" srcVar1 "$oh" srcVar2 "$healthCurrent" resultVar "$isdown" } LessOrEqual { LessEqualVar "$mustHeal" greaterVar "$one" srcVar1 "$isdown" srcVar2 "$zero" resultVar "$mustHeal" } LessOrEqual { LessEqualVar "$mustHeal" greaterVar "$zero" srcVar1 "$ismoving" srcVar2 "$zero" resultVar "$mustHeal" } LessOrEqual { LessEqualVar "$isdown" greaterVar "$one" srcVar1 "$mustHeal" srcVar2 "$zero" resultVar "$isdown" } LessOrEqual { LessEqualVar "$isdown" greaterVar "$zero" srcVar1 "$ismoving" srcVar2 "$zero" resultVar "$isdown" } LessOrEqual { LessEqualVar "$dbftodisplay" greaterVar "$detailblendfactor" srcVar1 "$isdown" srcVar2 "$zero" resultVar "$dbftoinject" } LessOrEqual { LessEqualVar "$detailblendfactor" greaterVar "$dbftoinject" srcVar1 "$rand" srcVar2 "$zero" resultVar "$detailblendfactor" } }


🅻 LIGHT
Make sure to remove any RNG code and all the variables ($) that came with it before doing any of these steps (reverse the mod to how it was before adding RNG)

STEP 1
Download this mod (you will need to tell your subscribers to download it too) :
https://sp.zhabite.com/sharedfiles/filedetails/?id=2237889549
STEP 2
Open one of your VMT that needs the blood effect and add one...
}
...at the very end.

STEP 3
See this thing at the beginning of the VMT ? (it can have quotes or not)
"VertexLitGeneric" {
Replace it with this :
patch { include "rdmg/light_v1.vmt" insert { //////////////////////////////////////////////////////////////////////////// // Realistic Damage (DMG) - Light V1 /////////////////////////////////////////////////////////////////////////// $detail "models\infected\hunter\hunter_01_detail" $canOnlyGetWorse "0" $randomBloodPosition "0" $randomBloodAngle "0" $ScaleDET "0.5" $CenterDET "0.5" $RotateDET "0.0" $TranslationDET "0.0" $useexponentialRate "0" $x "0.3" $y "2" $w "0.5" $z "0.2" $differentSkins "0" $shinyblood "0" $ForceBlood "0" $galleryShow "0" $detailblendmode "0" ///////////////////////////////////////////////////////////////////////////
Nb. if you didn't see VertexLitGeneric but there's already patch, you need to replace insert { and everything that is above by the code instead.
🅼 MEDIUM
Make sure to remove any RNG code and all the variables ($) that came with it before doing any of these steps (reverse the mod to how it was before adding RNG)

STEP 1
Download this mod (you will need to tell your subscribers to download it too) :
https://sp.zhabite.com/sharedfiles/filedetails/?id=2237889549
STEP 2
Open one of your VMT that needs the blood effect and add one...
}
...at the very end.

STEP 3
See this thing at the beginning of the VMT ? (it can have quotes or not)
"VertexLitGeneric" {
Replace it with this :
patch { include "rdmg/medium_v1.vmt" insert { //////////////////////////////////////////////////////////////////////////////////////////////// // Realistic Damage (DMG) - Medium V1 //////////////////////////////////////////////////////////////////////////////////////////////// $alpha "1" $detail "bloodmaps/ProgressiveNoHands_darker" $frame0ifbelow "100" // Display frame 0 if the survivor is below that health $frame1ifbelow "90" // Display frame 1 if the survivor is below that health $frame2ifbelow "70" // Display frame 2 if the survivor is below that health $frame3ifbelow "40" // Display frame 3 if the survivor is below that health $frame4ifbelow "20" // Display frame 4 if the survivor is below that health $frame5ifbelow "10" // Display frame 5 if the survivor is below that health $frame6ifbelow "-1" // Display frame 6 if the survivor is below that health $frame7ifbelow "-1" // Display frame 7 if the survivor is below that health $frame8ifbelow "-1" // Display frame 8 if the survivor is below that health $frameIfDown "6" // Frame if the survivor is down (can be from above) $canOnlyGetWorse "0" // Can the blood effect heal when Medkit is used $randomBloodPosition "0" // Randomize blood position (1 = yes) $randomBloodAngle "0" // Randomize blood angle (1 = yes) $ScaleDET "0.125" // Scale of blood (small number = bigger) $CenterDET "0.5" $RotateDET "0.0" // Rotation of the blood (RNG overrides it) $TranslationDET "0.0" // Translation of the blood (RNG overrides it) //////////////////////////////////////////////////////////////////////////////////////////////// // Next block is only useful if you want base texture (clothes) RNG //////////////////////////////////////////////////////////////////////////////////////////////// $differentSkins "0" // Amount of skins to RNG //////////////////////////////////////////////////////////////////////////////////////////////// // Next block is only useful if you want to show 3D wounds / hide 3D destroyed armor //////////////////////////////////////////////////////////////////////////////////////////////// $showIfBelowThisHP "400" // VMT invisible if health above that $butNotIfBelowThisHP "-1" // VMT invisible if health below that $alphaIfDown "1" // What $alpha to display when survivor is down $alphaIfDownMaxPriority "0" // Always orce that $alpha if down $cannotRevertDefaultAlpha "0" // Can the $alpha change again if survivor heals $chanceOfChanging "100" // % of chance that the visibility change will occur //////////////////////////////////////////////////////////////////////////////////////////////// //Bext is only useful for debug and testing purposes //////////////////////////////////////////////////////////////////////////////////////////////// $scrollShowcase "0" // Input blood levels to start showcase ////////////////////////////////////////////////////////////////////////////////// // The next value should normally not be changed, unless you did a mistake ////////////////////////////////////////////////////////////////////////////////// $detailblendmode "0" $shinyblood "0" //////////////////////////////////////////////////////////////////////////////////
Nb. if you didn't see VertexLitGeneric but there's already patch, you need to replace insert { and everything that is above by the code instead.
🅷 HEAVY
Make sure to remove any RNG code and all the variables ($) that came with it before doing any of these steps (reverse the mod to how it was before adding RNG)

STEP 1
Download this mod (you will need to tell your subscribers to download it too) :
https://sp.zhabite.com/sharedfiles/filedetails/?id=2237889549
STEP 2
Open one of your VMT that needs the blood effect and add one...
}
...at the very end.

STEP 3
See this thing at the beginning of the VMT ? (it can have quotes or not)
"VertexLitGeneric" {
Replace it with this :
patch { include "rdmg/heavy_v1.vmt" insert { //////////////////////////////////////////////////////////////////////////////////////////////// // Realistic Damage (DMG) - Heavy V1 //////////////////////////////////////////////////////////////////////////////////////////////// $alpha "1" $detail "bloodmaps/ProgressiveNoHands_darker" $frame0ifbelow "100" // Display frame 0 if the survivor is below that health $frame1ifbelow "90" // Display frame 1 if the survivor is below that health $frame2ifbelow "70" // Display frame 2 if the survivor is below that health $frame3ifbelow "40" // Display frame 3 if the survivor is below that health $frame4ifbelow "20" // Display frame 4 if the survivor is below that health $frame5ifbelow "10" // Display frame 5 if the survivor is below that health $frame6ifbelow "-1" // Display frame 6 if the survivor is below that health $frame7ifbelow "-1" // Display frame 7 if the survivor is below that health $frame8ifbelow "-1" // Display frame 8 if the survivor is below that health $frameIfDown "6" // Frame if the survivor is down (can be from above) $canOnlyGetWorse "0" // Can the blood effect heal when Medkit is used $randomBloodPosition "0" // Randomize blood position (1 = yes) $randomBloodAngle "0" // Randomize blood angle (1 = yes) $ScaleDET "0.125" // Scale of blood (small number = bigger) $CenterDET "0.5" $RotateDET "0.0" // Rotation of the blood (RNG overrides it) $TranslationDET "0.0" // Translation of the blood (RNG overrides it) //////////////////////////////////////////////////////////////////////////////////////////////// // Next block is only useful if you want base texture (clothes) RNG //////////////////////////////////////////////////////////////////////////////////////////////// $differentSkins "0" // Amount of skins to RNG //////////////////////////////////////////////////////////////////////////////////////////////// // Next block is only useful if you want to show 3D wounds / hide 3D destroyed armor //////////////////////////////////////////////////////////////////////////////////////////////// $showIfBelowThisHP "400" // VMT invisible if health above that $butNotIfBelowThisHP "-1" // VMT invisible if health below that $alphaIfDown "1" // What $alpha to display when survivor is down $alphaIfDownMaxPriority "0" // Always force that $alpha if down $cannotRevertDefaultAlpha "0" // Can the $alpha change again if survivor heals $chanceOfChanging "100" // % of chance that the visibility change will occur //////////////////////////////////////////////////////////////////////////////////////////////// // Next block is only useful if you have custom blood textures for the diffuse ($basetexture) //////////////////////////////////////////////////////////////////////////////////////////////// $useBaseTextureInstead "0" // Must the code use $bastexture for the blood ? $useDetailAsFireDamage "0" // Must the code use $detail as fire damage? $useDetailAsBoomerVomit "0" // Must the code use $detail as boomer vomit? $fireEffectDecayTime "240" // Time (sec) for the fire effect to decay $forceNoDecayIfMax "1" // Should the decay stop if max burn is reached $bileFrame "1" // Frame of the $detail with the bile effect $bothFrame "2" // Frame of the $detail with both bile+fire effect //////////////////////////////////////////////////////////////////////////////////////////////// //Bext is only useful for debug and testing purposes //////////////////////////////////////////////////////////////////////////////////////////////// $scrollShowcase "0" // Input blood levels to start showcase ////////////////////////////////////////////////////////////////////////////////// // The next value should normally not be changed, unless you did a mistake ////////////////////////////////////////////////////////////////////////////////// $detailblendmode "0" $shinyblood "0" //////////////////////////////////////////////////////////////////////////////////
Nb. if you didn't see VertexLitGeneric but there's already patch, you need to replace insert { and everything that is above by the code instead.
Customizing the settings
At this point, you did the only 3 steps needed to make the technique work. You can already test it and it will work fine, but maybe, you won't like the default settings. You might not like the default blood image and size. You might not like that the clothes "heal" etc.

If you do like the settings, you're fine and you can release your mod. You just need to tell the future subscribers of your mod to actually download the ressource mod. If you don't know how to set a mod as a requirement for another mod, go see the correspondix Appendix at the end of this Guide.

Some settings can be customized in every versions, others only are included in specific versions like Medium of Heavy. The sole setting that the code doesn't support (yet) is RNG clothes for the heavy version. This is technically possible though, I just didn't code it yet.
🅄 🄻 🄼 🄷 No heal on clothes
Avaliable for : 🆄 🅻 🅼 🅷
Difficulty :
Skills required : Ø
Description : This very simple code edit will make it so the clothes of your survivor cannot heal if they use a Medkit (only the skin of the survivor will). This gives a cool realistic effect but you might prefer the (default) cartoonish way that makes the whole survivor resplendish.

ONLY STEP
Do you see this thing in the code ?
$canOnlyGetWorse "0"
Change the value to this in each VMT that is for clothes.
$canOnlyGetWorse "1"
🅄 🄻 🄼 🄷 Randomize the blood
Avaliable for : 🆄 🅻 🅼 🅷
Difficulty :
Skills required : Ø
Description : This very simple code edit will make it so the blood stains on your survivor will always look different. It uses texture rotation and texture translation to change how the blood is positioned over your texture. The blood patterns are therefore always new each map.

ONLY STEP
Do you see these two variables in the code ?
$randomBloodPosition "0" $randomBloodAngle "0"
Change the value to 1 for one or both of them and you're done. The blood is now random.
$randomBloodPosition "1" $randomBloodAngle "1"

🅄 🄻 Choose the blood
Avaliable for : 🆄 🅻
Difficulty :
Skills required : Ø
Description : One of the biggest features of the Realistic Damage technique is that it lets you customize the blood to your likings. You could create your custom blood texture and apply it to your model to replace the default one (which is the same that is applied to the melee weapons). However, I created myself a lot of custom blood textures for you to use.
The hardest part will be to choose !
Tip : a debug feature for 🅻 is avaliable for this section, to allow you to apply all the textures to your model and cycle through it so you can choose the best looking (look at the debug section in this guide)
Tip : this Guide has an Appendix that shows how all the different blood textures look like on a model

STEP 1
Do you see this variable in the code ? :
$detail "models\infected\hunter\hunter_01_detail"
To change the blood, you need to replace the models\infected\hunter\hunter_01_detail by the path to another blood texture. It can be one you made yourself, or it can be one I made among these ones :
bloodmaps/Blooddrops bloodmaps/Blooddrops_darker bloodmaps/Blooddrops_darkest bloodmaps/Hands bloodmaps/Hands_darker bloodmaps/Hands_darkest bloodmaps/Cartoon bloodmaps/Cartoon_darker bloodmaps/Cartoon_darkest bloodmaps/Real bloodmaps/Real_darker bloodmaps/Real_darkest bloodmaps/HandsBlooddrops bloodmaps/HandsBlooddrops_darker bloodmaps/HandsBlooddrops_darkest bloodmaps/CartoonBlooddrops bloodmaps/CartoonBlooddrops_darker bloodmaps/CartoonBlooddrops_darkest bloodmaps/CartoonHands bloodmaps/CartoonHands_darker bloodmaps/CartoonHands_darkest bloodmaps/RealBlooddrops bloodmaps/RealBlooddrops_darker bloodmaps/RealBlooddrops_darkest bloodmaps/CartoonFull bloodmaps/CartoonFull_darker bloodmaps/CartoonFull_darkest bloodmaps/RealFull bloodmaps/RealFull_darker bloodmaps/RealFull_darkest
STEP 2
This is the hardest step. You need to select the blood style you want. There are always 3 variants for the blood hue (normal / darker / darkest), and many different shapes. You just need to look at them below, then find the corresponding code in the list above, and replace the code like it is told at STEP 1.
Please note that at this point, the result might look bad and not like in the pictures.
For it to look the best, you will (maybe) need to change the blood size (see next section).
Tip : you don't need the same blood texture for all the VMTs. You can for example choose bloodmaps/Blooddrops_darker for the face VMT and bloodmaps/CartoonFull for the clothes






Even more blood options ?
There's a nice little trick you can do to get even more options.
The Medium and Heavy variants feature progressive blood, as this is explained in "🄼 🄷 Choose the blood sequence". There's a way to get 3 more unique blood variants.

Look up the pictures in STEP 1 of "🄼 🄷 Choose the blood sequence", choose one you like and remember the number below it (write it down if you happen to have Alzeimers')

SMALL STEP 1
Add this somewhere in the code in the VMT that should use that new blood texture
$detailframe "###"
SMALL STEP 2
Change the ### to the number you remembered.
For example
$detailframe "1"
SMALL STEP 3
Change the $detail value we talked about at the beginning of this whole section (at (big) STEP 1) by the corresponding one regarding what you ended up choosing in "🄼 🄷 Choose the blood sequence"
bloodmaps/Progressive bloodmaps/Progressive_darker bloodmaps/Progressive_darkest bloodmaps/ProgressiveNoHands bloodmaps/ProgressiveNoHands_darker bloodmaps/ProgressiveNoHands_darkest
Note that only frames n° 1, 3 and 8 of Progressive and 1, 3 and 6 of ProgressiveNoHands are unique
🅄 🄻 🄼 🄷 Resize the blood
Avaliable for : 🆄 🅻 🅼 🅷
Difficulty :
Skills required : Basic math skills
Description : To get just the right look for each part of your model, the blood probably needs to be resized. This is probably the part that requires the most time if you want to get that perfect look.

ONLY STEP
Do you see this in the code ?
$ScaleDET "0.5"
MULTIPLY this by 2 if you want to make the blood look SMALLER
DIVIDE this by 2 if you want to make the blood look BIGGER
For example, if the default value is 0.5, and you want to make the blood 4 times bigger, you need
$ScaleDET "0.125"
It is important that you keep the quotation marks (the "), or you will get errors.
A value of 0.5 does not get the same result on every texture nor on every part of the model. Some parts of your model might need a lower or higher value than others, and even if you found a good setting for a mod, it might look different for another mod that does not have the same texture size. The default blood size is 256x256 and the ones I made are 1024x1024. If your texture is 1024x1024, and you want it to match size with the blood texture, you need to imput 0.125 which is sort of the default value.
Here are examples to showcase how the $ScaleDET size modifier can affect the blood.



🅄 🄻 🄼 🄷 Move the blood
Avaliable for : 🆄 🅻 🅼 🅷
Difficulty :
Skills required : Basic math skills
Description : If you did not choose to have RNG Blood position, you can tweak the position of the blood by changing some values in the code. This might be useful if there's a stain of blood at a place where it looks just wrong.

STEP 1
Do you see this in the code ?
$RotateDET "0.0"
You can change the default value of 0 to any value from 0 to 359 to change the blood rotation in degrees. Note that it will not rotate the individual blood stains but the whole texture.

STEP 2
Do you see this in the code ?
$TranslationDET "0.0"
You can change the default value of 0 to any value between 0.0 and 1.0.
A value of 0.0 is the same as a value of 1.0, and is a translation of 100%.
The translation is both horizontal and vertical at the same time.
A value of 0.1 is a translation of 10%, 0.2 is 20% and so on. It loops at 100%
🅄 🄻 🄼 🄷 Shiny blood effect
Avaliable for : 🆄 🅻 🅼 🅷
Difficulty :
Skills required : Ø
Description : There is a way to make the blood shiny and glossy, but it will also be applied to the skin of the characters. By default, it's (now) turned off. You can turn it on if you want and see if the results are better with it.

ONLY STEP
Do you see this thing in the code ?
$shinyblood "0"
Change the value to this in each VMT that needs the shiny blood effect.
$shinyblood "1"
🄻 Change the blood curve
Avaliable for : 🅻
Difficulty :
Skills required : Basic math skills. Basic knowledge of exponential functions is a plus.
Description : By default for the Light version, the lower the health of the survivor, the more opaque (visible) the blood effect is (linear curve). However, at values between 50% and 70% of opacity, it might look a bit funky, as if the survivor had stains of mud on it.
The Light version therefore comes with a way to change the blood display function from linear to exponential so the blood appears later and/or faster.

QUICK WAY
Do you see this variable in the code ?
$useExpodentialRate "0"
Change that value to 1 and you're done
$useExpodentialRate "1"
This uses (my) default exponential settings. With them, the max blood effect will be reached when the survivor has 10 HP or lower, and will come faster from 30-40 HP and so on.



CUSTOM WAY
If you're not satisfied with these default exponential settings, the Light version comes with the ability to plot your very own exponential function for the blood opacity to follow.

Do you see this thing in the code (at the beginning) ?
$x "0.3" $y "2" $w "0.5" $z "0.2"
These values (x / y / w / z) can be changed to create you own exponential function for the blood display. Here's the function itself with the values.



The colored values (x / y / w / z) are the values that you will be able to change in a moment.

The β value can range from 0 to 1 and is how much health the survivor has lost so far.
For example :
  • The value will be 0 if the survivor has 100 health
  • The value will be 1 if the survivor has 0 health
  • The value will be 0.4 if the survivor has 60 health
And the result of this function will be a new transformed value for β for the blood opacity to use.

So, now, I know you probably are not a math girl or boi. That's ain't no problem.
Go to this webside[www.desmos.com] and plot these two functions :
For the first function, simply plot (write)
x
For the second function, copy and paste this...
0.1\cdot e^{\left(\left(3\cdot x\right)-0.2\right)}-0.6
...or write this with your little bare hands
0.3 * e ^ ((2 * x) - 0.5) - 0.2
You will only need the portion of the graph that goes from 0 to 1 on both axis. Zoom in so that you only see the numbers from 0 to 1 on both horizontal and vertical axis.
If you did that right, you should see the same curves as in the graph above.

Now you can try to randomly edit the values of the function to find a curve that will suit you.
The only thing you need to make sure is that both curves cross before 1 (on both axis).

Remember :
  • The horizontal axis is how much health the survivor has lost (between 0 and 1)
  • The vertical axis is how much opaque (clear) the blood effect should be
Once you have found the values that you like for x / y / w / z, write them down and you only need to replace them here in the code.

For example, if you ended up choosing thoses values ...

...you will need to change the code this way
$x "0.1" $y "3" $w "0.2" $z "0.6"
🄻 🄼 Randomize the clothes (RNG)
Avaliable for : 🅻 🅼
Difficulty :
Needed before starting : A VTF file with all the different textures as different frames
Description : The Light and Medium versions of the code come with embed RNG for the clothes underneath so you don't even need to refer to the RNG Made simple guide.

Maybe your mod had RNG (Randomized) Clothes before you removed it to make room for the Realistic Damage (if you forgot to remove it, that's probably why nothing works). Here's the very simple way to (re)activate RNG for the clothes.

STEP 1
Make sure that the VTF file set for the $basetexture has all the different designs (clothes) you want to randomize in its frames. Then open the VMT file that corresponds to this VTF.

Note : If you have all your different textures you want to randomize but don't know how to put them all in a single VTF file because it's your first time with RNG, just go check this Guide and do Step 1 to 5 of the Animated Textures Section.
https://sp.zhabite.com/sharedfiles/filedetails/?id=469609809
STEP 2
Do you see this variable ?
$differentSkins "0"
Change that value to the number of different skins you have (and not to the highest $frame).

For example, if you have 5 different T-Shirts for one of your VMT, simply write
$differentSkins "5"
And that's it, the code does all the rest. You don't need to worry about anything else. Who thought that RNG could be that simple ? :)
🄼 🄷 Choose the blood sequence
Avaliable for : 🅼 🅷
Difficulty :
Skills required : Ø
Description : The Medium and Heavy versions display the blood as a sequence, starting with only blood drops but ending up with full frontal blood all over the model. The code allows you to fully customize the blood sequence and tell to the code exactly when to display what frame.

STEP 1
There is currently only two options for the Blood for the Medium and Heavy default versions, that still come in three hues. Here they are :

The Progressive family has 9 levels of blood, from frame n°0 to frame n°8 (numbers in white below)
bloodmaps/Progressive bloodmaps/Progressive_darker bloodmaps/Progressive_darkest


The NoHands family has 7 levels of blood, from frame n°0 to frame n°6 (numbers in white below)
bloodmaps/ProgressiveNoHands bloodmaps/ProgressiveNoHands_darker bloodmaps/ProgressiveNoHands_darkest


By default, the Medium and Heavy versions are set with ProgressiveNoHands_darker, but this can be modified. You can choose between Hands and NoHands and modify its hue (normal / darker / darkest).

Do you see this in the code ?
$detail "bloodmaps/ProgressiveNoHands_darker"
If you want, you can change it to any of the 5 others avaliable progressive blood textures. When your choice is done, you can go to the next step.

STEP 2
You will now need to choose when to display what level of blood.
Do you see all these variables in the code ? You can set them to your likings. As soon as the health of the survivor will reach the number you will put in there, the corresponding frame n° will be displayed.
You just need to keep in mind the following :
  • $frame0ifbelow should normally always be 100
  • If a frame is not in use or non existant for the blood texture you selected, set the value to -1
  • You can jump frames by adding a -1 in between
  • The numbers you input must go in decreasing order unless you jump a frame
  • You don't need to use all the frames avaliable in the blood texture you selected
  • If you did put a value for a frame that does not exist instead of -1, it will show as all black
$frame0ifbelow "100" // Display frame 0 if the survivor is below that health $frame1ifbelow "90" // Display frame 1 if the survivor is below that health $frame2ifbelow "70" // Display frame 2 if the survivor is below that health $frame3ifbelow "40" // Display frame 3 if the survivor is below that health $frame4ifbelow "20" // Display frame 4 if the survivor is below that health $frame5ifbelow "10" // Display frame 5 if the survivor is below that health $frame6ifbelow "-1" // Display frame 6 if the survivor is below that health $frame7ifbelow "-1" // Display frame 7 if the survivor is below that health $frame8ifbelow "-1" // Display frame 8 if the survivor is below that health
In this example, it will show frame n°0 at start, then frame n°1 at 90 HP, frame n°2 at 70 HP and so on, but will not show frame n°6 even though it exists. However, frame n°7 and 8 do not exist for ProgressiveNoHands so they must be set to -1.

STEP 3
There is one last thing you should do, which is to specify the frame to display when the survivor is down. Do you see this in the code ?
$frameIfDown "6" // Frame if the survivor is down (can be from above)
You must set the value to a specific frame. It can be (and usually should) be one that you just set.

However, this allows a nice little tweak since this specific frame ignores the rules for healing (even if $canOnlyGetWorse is set to 1).

Once the survivor is picked up by another survivor, this frame will disappear no matter the settings and it will revert to the one it should display according to the big block of frames above. If it is the same, there will be no visible difference, but if the frame to display according to the big block is another one, it will give a nice little small heal effect after the survivor is saved, even on clothes that should normally not heal.

By default, this little healing effect is present since $frame6ifbelow is not in use but frame n°6 is the one that is displayed when the survivor is down. If you do not like this effect, just set the $frameIfDown to be one that is also set in the big block of variables.
🄼 🄷 Make things appear/disappear
Avaliable for : 🅼 🅷
Difficulty :
Skills required : Ø
Description : The Medium and Heavy versions allows for things to appear and disappear based on the survivor health. In other words, it allows to change the visibilty ($alpha) of the whole VMT between or under a certain health threshold. This can be used to make broken armor disappear or wounds or bandages appear.

STEP 1
Do you see these two variables in the code ?
$showIfBelowThisHP "400" // VMT invisibile if health above that $butNotIfBelowThisHP "-1" // VMT invisible if health below that
You can modify them to make the VMT show IN BETWEEN (if it show at 100 HP, please input 400)

For example, for these settings, the material will show between 70 and 20 HP
$showIfBelowThisHP "70" // VMT invisibile if health above that $butNotIfBelowThisHP "20" // VMT invisible if health below that
For example, for these settings, the material will not show above 70 HP
$showIfBelowThisHP "70" // VMT invisibile if health above that $butNotIfBelowThisHP "-1" // VMT invisible if health below that
For example, for these settings, the material will disappear under 40 HP
$showIfBelowThisHP "400" // VMT invisibile if health above that $butNotIfBelowThisHP "40" // VMT invisible if health below that

STEP 2
Do you see this variable in the code ?
$alpha "1"
If your VMT must BE HIDDEN when the survivor has FULL health, change that value to 0.

STEP 3
Do you see this variable in the code ?
$alphaIfDown "1"
If your VMT must BE HIDDEN when the survivor has ZERO health, change that value to 0.

STEP 4
Do you see this variable in the code ?
$cannotRevertDefaultAlpha "0"
If you want your VMT to KEEP THE SAME VISIBILITY once it has changed, change the value to 1.
If the value is set to 0, and that you made an armor disappear (for example), this means that when the survivor will use a Medkit, the armor will reappear. If you don't want this to happen, set the value to 1.

STEP 5
Do you see this variable in the code ?
$chanceOfChanging "100"
This is a value that allows to Randomize the appearance or the disappearance of the VMT.

As it says, change this to the % of chance for the VMT to actually appear or disappear (change status) each time it goes through the threshold at which it should normally change status.

For example, if you set this value to 33% for the armor of your survivor to disappear and that $butNotIfBelowThisHP is equal to 30, each time the survivor passes from 31 to 29 HP, the armor has a 33% chance to disappear.
If two different VMT have the same values for $chanceOfChanging and are set to change at the same time, they will always appear together or disappear together. It is therefore safe to use RNG even on an amor that is made up of different VMTs that need to change together.

STEP 6
Do you see this variable in the code ?
$alphaIfDownMaxPriority "0"
If you used the RNG (Ramdomizer) at previous step, the RNG will ignore $alphaIfDown.
But if you set the $alphaIfDownMaxPriority value to 1, the code will put the maximal priority on $alphaIfDown, even if the RNG is active.
This can be used to force the VMT to show or not show no matter what if the survivor is down.
🄷 Make blood textures
Avaliable for : 🅷
Difficulty :
Skills required : Basic skills in a graphic design software and basic skills with VTFEdit
Description : The Heavy version core feature is the ability to add Boomer bile and Burn damage atop of all the other effects combines. However, this can only be achieved if the blood texture sequence is actually put on the base diffuse texture ($basetexture), which is, of course, different for every character model. This section will try to teach you how to make you own blood textures, and will provide the required ressources so you can try to use the Heavy version if you like.

STEP 1
Download VTFEdit[gamebanana.com] on GameBanana webside and install it if you haven't installed it yet.

STEP 2
Open VTFEdit and press CTRL+O and select the VTF texture in your mod that you want to Import.

STEP 3
Still in VTFEdit, press CTRL+E, select the TGA extension, name the file 0.tga, and export the texture somewhere (at this point, you converted the texture from VTF to the usable TGA format).

STEP 4
Open the TGA file you just created in your preferred graphic design software.

STEP 5 - [Variant A]
If you want to make your own textures and go pro, go grab some blood brushes[www.brusheezy.com].
For an optimal effect, you need to set the blending mode of the paint brush to multiply (this way, when you'll paint over a blood drop you already painted, it will get a darker realistic look).
Note that you can paint directly on the diffuse layer (not recommanded) or create a new layer and set the blending mode of that layer to multiply too.

You need to create the textures in order, from no blood to the max blood effect. Start with small blood drops. At regular intervals, save the current progress, each time in a new .tga file that you will name in sequence (1.tga, 2.tga, 3.tga etc.). Remember that you have maximum 8 levels of blood to work with. If you've done it right, scrolling through the .tga files from 0.tga to the last one your created should make it like more and more blood is appearing.
The optimal way to create the blood textures is to use Substance Painter (payware) or an equivalent tool, to take care of any seam problem. I however do not master these tools, but if you do, you must be intelligent enough to just be able to follow the general instruction of creating a sequence of .tga files from no blood to worst blood for each of your diffuse that need the blood effect.
Here's a example of different frames I made. The first one must be the 0.tga file you saved at STEP 3.


STEP 5 - [Variant B1]
If you don't feel painting with blood brushes, I decided to provide the seamless alpha masked blood textures I made myself. I also provide an Adobe Photoshop® (PSD) template for easy usage and combinations (see Variant B2 for Adobe Photoshop®).

You can download all of that here on Google Drive[drive.google.com].

If you do not want to download a .ZIP file a Guide on the Internet told you do, you can check all the PNG files here in Imgur[imgur.com].

If you're too afraid to click on a link for easier access to all the blood textures, you can check the Appendix : PNG blood textures section at the end of this Guide. They are all there.

Now that your diffuse texture TGA ($basetexture) is opened in your preferred graphic design software, you can add blood layers using my blood textures and customize it to your likings, Your goal is to create a sequence of files, ranging from 1.tga to 8.tga (or lower if you went less levels), where the blood gets worse and worse in each new .tga file. At regular intervals, save the current progress, each time in a new .tga file that you will name in sequence (1.tga, 2.tga, 3.tga etc.).

For optimal effect, you must set the blending mode of the PNG blood layers you copied to multiply.


This sequence of textures was created in under 1 minute with the Adobe Photoshop® (PSD) template.

STEP 5 - [Variant B2]
This variant requires Adobe Photoshop® and the provided PSD file that you can find in this already linked .ZIP on Google Drive[drive.google.com]. It's a quick and easy way to make blood textures.

Open the BloodmapRessource.psd in Adobe Photoshop®. There should already be a Zoey head texture for reference (5). Replace that texture with the one you want to use the blood effects on.

You can then choose to activate one or more layers of blood in the layers menu. Just click on the place where an eye icon can pop up (1).

You can also move the texture to change where the blood it. To do so, first click on the little arrow (2) to open up the folder, then click on the blood texture to select it (3), then click on the little Padlock icon at the very top (4). You should now be able to move the layer of blood to change its position to your exact likings. Lock the layer again when you're done.

You can also activate the darker and darkest effects but these will not look like in the preview pictures because the method is different. What you see here in terms of hue is exactly what you'll get in game.

Now use these layers to create multiple different .tga files like in the two others variants.

Your goal is to create a sequence of files, ranging from 1.tga to 8.tga (or lower if you went less levels), where the blood gets worse and worse in each new .tga file. At regular intervals, save the current progress, each time in a new .tga file that you will name in sequence (1.tga, 2.tga, 3.tga etc.).


You created all the .tga files and now you're ready to convert them back into a VTF again

STEP 6
Open VTFEdit again and press CTRL+I.
Then select all the files at once (from 0.tga to 6.tga or whatever your max file is) and click on "Open".

If you did that right, you should now be able to see that you can change the frames by clicking on the little blue arrow buttons under the Frame section in the Image tab that is on the left.

Using these little blue arrow buttons, check that the frame sequence is correct. Frame 0 should have no blood at all, then from frame 1 to the max frame, it should go worse and worse.

Once you checked that everything is correct, press on CTRL+E and save the VTF texture with the same name as the original one, and put it back in your mod. Your $basetexture should now be this sequence of blood.

Note that since you haven't changed anything in the code yet, it should look exactly the same because you still need to change $useBaseTextureInstead to 1 like this in the VMT :
$useBaseTextureInstead "1"

STEP 7
Do steps 5-6 again for each other VTF (VMT) texture you want to blood effect on.
You usually do not need to do it for hair and/or small accessories or very small parts of the model, since they will hardly be visible anyway.

🄷 Activate $basetexture mode
Avaliable for : 🅷
Difficulty :
Skills required : Ø
Description : If you made custom blood textures for the diffuse ($basetexture) following the previous section of this Guide, you need to change the mode from $detail mode to $basetexture mod because by default, even the Heavy version still works like the Medium version.

ONLY STEP
Do you see this variable ?
$useBaseTextureInstead "0"
Change it so it equals 1 instead or 0.
$useBaseTextureInstead "1"
At this point, the code now uses the frames of your $basetexture instead.

You now need to 🄼 🄷 Choose the blood sequence to tell the code when to show which frame.
The only difference is that this time, instead of looking at the pictures I provide, you need to look at your own blood frames and their IDs n° (the first one with no blood is n°0 and so on).
Note that at this point, you do not need to change $detail, and you should not change $basetexture either unless you actually used a new VTF name
🄷 Fire damage & Boomer vomit
Avaliable for : 🅷
Difficulty :
Skills required : Ø
Description : If you did a custom blood texture sequence yourself for the diffuse texture ($basetexture) following the 🄷 Make blood textures section and that you also did (which you must) the 🄷 Activate $basetexture mode section, now the $detail is free and ready to use for boomer and fire damage, which this section is all about.
IMPORTANT : You can sometimes get unwanted lack of consistency in the Realistic Damage effects if you did a specitic step to add boomer texture on your model that some guides talk about. These steps are the step 7.07 in MrFunreal's Guide, this step in ZeqMacaw's Guide[sites.google.com], or the step about line 26 in the Preparing to Compile the MDL file section of Splinks Guide.
These specific steps are USELESS for all characters, period and are not needed to add Boomer vomit, which all the Guides are wrong about. Never do them again for any mod. They are based on a wrong understanding of how the Boomer bile effect works (which is actually quite understandable because the game models are set up that way). You actually need to do these steps only if you want different $phong parameters for the boomer vomit.


STEP 1
The first step will be to choose the burn effect you want for your VMT.
There are 2 different burn effects, each one with 3 hue variants like always.
  • The Soot effect is intented to be used on skin to give it a chimney sweep look
  • The Burn effect is intented to be used on clothes to give them a burned look
bloodmaps/Burn bloodmaps/Burn_darker bloodmaps/Burn_darkest bloodmaps/Soot bloodmaps/Soot_darker bloodmaps/Soot_darkest
Do you see this thing in the code ?
$detail "bloodmaps/ProgressiveNoHands_darker"
Change bloodmaps/ProgressiveNoHands_darker to the burn texture variant you want among the list above. Do not worry about Boomer textures, there's only one avaliable at the moment and it's an upscaled one from the original. You can see how the 3 hues variant look in the corresponding Appendix.

STEP 2
See these 2 variables in the code ?
$useDetailAsFireDamage "0" $useDetailAsBoomerVomit "0"
Change $useDetailAsFireDamage to 1 to activate the Fire damage effect
Change $useDetailAsBoomerVomit to 1 to activate the Vomit effect
$useDetailAsFireDamage "1" $useDetailAsBoomerVomit "1"
This way, both effects are now active.

STEP 3 (Fire damage only)
See this variable in the code ?
$fireEffectDecayTime "240"
You can change the 240 default value to another amount if you want the decay rate of the effect to be faster. The 240 is the time in seconds it takes for the fire effect to wear off, if the maximal fire level has not been reached yet.
(Tool) 🄻 Force max blood
Avaliable for : 🅻
Difficulty :
Skills required : Ø
Description : The Light version of the technique comes with a tool to always force the blood max effect so you can test the different settings without the need to shoot your survivors multiple times.

ONLY STEP
Do you see this thing in the code ?
$ForceBlood "0"
Replace it with this in each one of your VMTs you want the blood to be maxed out.
$ForceBlood "1"
(Tool) 🄻 Blood Gallery
Avaliable for : 🆄🅻
Difficulty :
Skills required : Ø
Description : The Light version of the technique comes with a tool that allows you to check all the different blood textures and all their different hues. It's simple to set up and it will allow to see quickly who every blood textures looks on your model.

STEP 1
Download this mod (this extra mod is just needed for the present Blood Gallery) :
https://sp.zhabite.com/sharedfiles/filedetails/?id=2231697265
STEP 2
Do you see this variable ? (it might have changed if you changed the blood already)
$detail "models\infected\hunter\hunter_01_detail"
Replace it with this in each one of your VMTs you want to test the effect on :
$detail "bloodmaps/BloodGallery"
STEP 3
Do you see this thing in the code ?
$galleryShow "0"
Replace it with this in each one of your VMTs you want to test the effect on :
$galleryShow "30"
(Tool) 🄼 🄷 Scrolling blood levels
Avaliable for : 🅼 🅷
Difficulty :
Skills required : Ø
Description : The Medium and Heavy version allow the use of a debug tool that scrolls through all the different blood levels to see how they look without having to kill the survivors over and over.

ONLY STEP
Do you see this thing in the code ?
$scrollShowcase "0"
Replace it with this the number of blood levels (frames) for the blood texture you choose.
The number is 7 if you use one of the the ProgressiveNoHands variants
The number is 9 if you use one of the the Progressive variants
[Appendix] Set a Mod as required
If you make a mod with Realistic Damage, you need to tell the future subscribers of your mod to actually download the Ressource mod with all the blood textures in it. If they don't do that, the blood will look like pink and black squares and they probably won't be very happy.

You're probably intelligent enough to know that you can ask them to do so in the description of your mod, but you can do better and force a message to appear when they subscribe to your mod, telling them to also download my mod. To do so, follow these steps.

STEP 1
Go to the Mod you just published on the Workshop and look for the Owner Controls pannel on the right of your mod page.

Look for the Add/Remove required items and click on it. It should take you to another page where you will be able to

STEP 2
On that new page, go the the "Subscribed items" tab and click on it. A list of all the mods you are subscribed to should appear.



STEP 3
Look for the Ressource mod you downloaded to make the Realistic Damage effect work and click on the big ╋ that appears on the left in the list. Wait a few seconds and the Mod should now appear at the bottom left of the page.

Then click on Save & Continue in the bottom right corner, and refresh your mod page by clicking on the F5 key on your keyboard. If you did it right, a Required item table should have appeared
[Appendix] Release as a Skin Pack
Avaliable for : 🆄 🅻 🅼 🅷
Difficulty :
Required : Being the creator of the character mod the blood goes with
Description : It's possible to set up your character mod in a way so that the blood effects can be released as a separate, optional addon for your subscribers (like a texture pack for your mod).
Setting up the mod that way has the advantage that if you ever need to update the model (MDL), you only need to update it in the base mod, since the optional blood addon will only contain the textures. Also, it will prevent any conflict between the base mod and the optional blood addon.

I have made a specific guide on the matter that you can find below, but if you're in a hurry, you can look for the tl;dr of that Guide just here down below instead. These tl;dr steps assume that you're the one releasing both the optional blood addon and the base mod.
https://sp.zhabite.com/sharedfiles/filedetails/?id=2232174067
STEP 1
Open the .qc file of the survivor model you just created and find the $cdmaterials line(s). For example:
$cdmaterials "models\survivors\ClemS4CassiePort\" $cdmaterials "models\survivors\" $cdmaterials ""
Now add an new line AT THE TOP of these lines, and remember the name you gave it.
For example here I chose a folder ClemS4CassiePort_reskins (it does not exist yet).
$cdmaterials "models\survivors\ClemS4CassiePort_reskins\" $cdmaterials "models\survivors\ClemS4CassiePort\" $cdmaterials "models\survivors\" $cdmaterials ""
STEP 2
Compile your model file (SMD) and (re)release your base mod as you usually would, without the Realistic Damage effects. What you just did now allow skinpacks to be released for it.
This means that if you want to release an optional blood addon for a mod you already released, you will need to update your base mod first with these new $cdmaterials lines.
STEP 3
In your optional blood addon, change the name of the folder containing all the VMTs (that include Realistic Damage) to the one you chose as STEP 1, so that all VMTs are now contained in that new folder.

In my example, I changed the folder name from ClemS4CassiePort to ClemS4CassiePort_reskins.


STEP 4
Delete the /models/ folder (the one that has the SMD (MDL) in it) in your optional blood addon (you don't need the model, it's already in the base mod).

STEP 5
Delete every VTF in your optional blood addon so the only thing that stays in it are VMT files (you don't need the textures, they are already in the base mod or in my ressource mod or in the game files).

Now, of course, if you used the Heavy version and made custom blood textures, you should not delete the VTF for this new custom blood texture. What you need to do however in this case is to change the path of the VTF in the VMT because now, your texture is in a new folder.

For example, since I changed the folder from ClemS4CassiePort to ClemS4CassiePort_reskins, I need to change the $baseTexture path from this
$baseTexture "models\survivors\ClemS4CassiePort\my_custom_blood_texture"
to this
$baseTexture "models\survivors\ClemS4CassiePort_reskins\my_custom_blood_texture"
Note that you only need to do this for VTFs that are not in the base mod. If you put a path to the base mod, it will work.

STEP 6
You can now release the optional blood addon as a separate mod and set your base mod as a requirement for it (see previous Appendix).
You of course also need to set the Ressource Mod (with all the blood textures) as a requirement. Therefore, your optional blood addon will require 2 mods to work.
[Appendix] Burn textures on Ellie
bloodmaps/Burn bloodmaps/Burn_darker bloodmaps/Burn_darkest

bloodmaps/Soot bloodmaps/Soot_darker bloodmaps/Soot_darkest
[Appendix] Blood textures on Ellie
bloodmaps/Blooddrops bloodmaps/Blooddrops_darker bloodmaps/Blooddrops_darkest

bloodmaps/Hands bloodmaps/Hands_darker bloodmaps/Hands_darkest

bloodmaps/Cartoon bloodmaps/Cartoon_darker bloodmaps/Cartoon_darkest

bloodmaps/Real bloodmaps/Real_darker bloodmaps/Real_darkest

bloodmaps/HandsBlooddrops bloodmaps/HandsBlooddrops_darker bloodmaps/HandsBlooddrops_darkest

bloodmaps/CartoonBlooddrops bloodmaps/CartoonBlooddrops_darker bloodmaps/CartoonBlooddrops_darkest

bloodmaps/CartoonHands bloodmaps/CartoonHands_darker bloodmaps/CartoonHands_darkest

bloodmaps/RealBlooddrops bloodmaps/RealBlooddrops_darker bloodmaps/RealBlooddrops_darkest

bloodmaps/CartoonFull bloodmaps/CartoonFull_darker bloodmaps/CartoonFull_darkest

bloodmaps/RealFull bloodmaps/RealFull_darker bloodmaps/RealFull_darkest
[Troubleshooting]
Due to how complex the Realistic Damage technique can get, a lot of different problems can arise. This section aims to try and help you solve any issue. If you still can't find an answer after going through it, feel free to ask you question directly on this Guide so I can answer it and make this section better.

The hair of my character disappears when I point a flashlight at them!
Probable causes
▶ Unknown cause, probably game engine related.

HOW TO FIX : Modify the VMT of the hair (put it in your mod even if you do not want blood effects on it), delete any variable that would look like this : translucent "1" and add these two new variables into the code (where there is also stuff starting with $) : $alphatest "1" and $allowalphatocoverage "1"

It does not change anything / it does not work !
Probable causes
▶ Copying the code in a VMT that already has Proxies {
▶ Copying the code under VertexLitGeneric instead of replacing it
▶ Copying the code under an already existing patch { instead of replacing it
▶ Not selecting the whole block of code to copy in the VMT
▶ Plotting a wrong exponential function that doesn't cross the linear function before 1:1

HOW TO FIX : You probably did a mistake at STEP 3 of the Implementation, most likely a bad Copy&Paste, or you did not understand that you need to replace everything above the variables (the things that start with $) by the code.


The examples in red are wrong. Also you should not see a Proxies { block.

My survivor is transparent with only white edges !
Probable causes
▶ Forgetting to download the Base Ressource mod (or not having it activated or loaded)
▶ Copying the code under an already existing patch { instead of replacing it

HOW TO FIX : Make sure the Ressource mod is downloaded and activated. If you manually changed the include (i.e. "rdmg/light_v1.vmt") between versions, check that you did not do a spelling error. Then check that you did the copy&paste correctly (see the above image with the wrong examples in red).

When my survivor is down, some part of his body disappear !
Probable causes
▶ Code oversight or problem witg $alpha change.

HOW TO FIX : Try to set $alphaIfDown "1" instead of $alphaIfDown "0".

The blood is purple and black squares !
Probable causes
▶ Making a typo while changing the $detail
▶ Forgetting to change the folder or inputing a wrong folder name at STEP 3 of Release as a Skin Pack
▶ Forgetting to change the $basetexture path at STEP 3 of Release as a Skin Pack if you used the Heavy version

HOW TO FIX : Make sure the specified $detail in the VMT is correct, and that its folder is also correct. The folder is bloodmaps/ for the textures that I provide myself.

The texture is all black !
Probable causes
▶ Setting a too high value for the clothes RNG
▶ Putting a value for RNG when there's no clothes to RNG
▶ Forgetting to make a multiple frame VTF for the RNG
▶ While choosing the blood sequence (Medium & Heavy), inputing a positive value for a $frame#ifbelow that does not exist
▶ Setting a too high value for $galleryShow
▶ Forgetting to download the special mod for the Gallery Show testing tool
▶ Trying to merge the mod with a RNG mod

HOW TO FIX : If you use RNG, make sure the number you set for the skins is the correct amount of skins you have (it should be the amount of skins, not the n° of the last frame). If you did not use RNG but used Medium or Heavy, check all the $frame#ifbelow and set the value for the ones that do not exist to -1.

The game crashes !
Probable causes
▶ Using the code for something else than a living creature.
▶ Having one of your VMT also be used for a static object in a map.

HOW TO FIX :
▶ Check that all your VMTs are not shared with any original VMT for L4D2 or L4D1.

Error in console : KeyValues Error: RecursiveLoadFromBuffer: got EOF instead of keyname in file
Probable causes
▶ There is one } missing at the end of your VMT (you forgot STEP 2 of Implementation)

HOW TO FIX :
▶ Add a } at the very end of your VMT

The blood stains look too small...
Probable causes
▶ Improper value of $ScaleDET

HOW TO FIX :
▶ Try to divide the value of $ScaleDET by 2

The blood stains look too big...
Probable causes
▶ Improper value of $ScaleDET

HOW TO FIX :
▶ Try to multiply the value of $ScaleDET by 2

My blood looks way too symmetrical!
Probable causes
▶ How your character texture is made underneath the blood.

HOW TO FIX :
▶ You actually sadly cannot fix that... This is due to how you model is made... Maybe try some blood options that do not show much symmetry, like the Blooddrops one.

The default blood (hunter_01_detail) looks nothing like in your pictures !
Probable causes
▶ Browse your mods to see if any mod already include a new, modified version of hunter_01_detail. In particular, try to unsubscribe from this mod, that includes a new HD hunter_01_detail, if you have it in your subscribed items : https://sp.zhabite.com/sharedfiles/filedetails/?id=502646580&searchtext=hd+bloodmaps
I have crashes on The Passing last map when I use the elevator at the beginning!
Probable causes
▶ Usage of the code on Bill's Corpse.

HOW TO FIX : If the Bill's dead corpse in The Passing last map uses the same texture (VMT) as the alive one, a crash will occur. You can either delete Bill's corpse files, or change the Bill's Corpse model so the VMT of the corpse is different than the alive one. You can also subscribe to this mod to try and solve the issue.

If you have any other problem, please ask your question here. I'll be happy to answer!
38 Comments
Ed 7 Mar @ 6:22pm 
Would it work with SFM?
blue master 26 Sep, 2024 @ 3:52pm 
can this work on hands?
ozni 7 Jun, 2024 @ 11:45am 
Hi, does this work on HUDs? like, i want to change a texture based on how much health the player has (between 0%, 25%, 50%, etc.), but considering it works on infected I assume the "Health" proxie just takes the health from the entity to which the texture is aplied to, and UI elements are not tied to an entity... so it shouldnt work, right?
Veikko 2 Mar, 2023 @ 9:19am 
I'm having an issue, so with the Random blood splatters can I get the default bile overlay work with it? Because I noticed for me it works with the default survivors DMG mod, but not for custom survivors. Is there anyway for it to work?
lord etching von masturbagoon IV 23 Jan, 2023 @ 7:53pm 
are there any console commands I can use to help me test if it works? rather than having to play through the game and take hours to see?
Ichiban Kasuga 1 Nov, 2022 @ 12:03pm 
my texture is all black, the troubleshooting doesn't have my problem..
and i dont use RNG
LittleBigSmoak 24 Oct, 2022 @ 12:42am 
Trying to use the heavy version, and the blood type I'm using is bloodmaps/ProgressiveNoHands_darker, but it doesn't do anything.
฿ØⱠ₮Ø₭¹⁷³ึ 1 Jul, 2022 @ 3:28am 
material "X" does not support vertex format used by the mesh, first time i get this error and the model becomes completely invisible, any ideas?
xXMr.PelucheXx 14 Mar, 2022 @ 6:50pm 
OK
cathyy7 30 Nov, 2021 @ 12:08am 
it's not that i don't want to, it's that i can't. i use geforce now