Modding the Body Animations By Swapping with Another Survivor's Animations
Modding a Left 4 Dead 2 Survivor
Modding the Body Animations By Swapping with Another Survivor's Animations
Say you want an all-woman team of survivors. By following the other sections of this tutorial, you could replace Coach, Ellis, and Nick with a woman each, but each would be using the respective man's animations. Not that bad, but not ideal having a man's animations for a woman.
You could go a step further and rig each woman model to either Zoey's or Rochelle's animations. However, in online multiplayer campaigns, many of the animations will not show correctly. This is actually worse than seeing a man's animations for the woman. The problem is that each survivor's set of animations are listed in a different order in the mdl file, and the server says which animation to play based on this ordering.
I'll give an example to show the problem. Keep in mind this is simply the gist of, and not exactly, what occurs. The server says to each client player, "play Nick's reload shotgun animation", and each client knows this simply by receiving the number "3", meaning "play the third animation". If Nick is replaced by a custom woman using Zoey's animations, then the client will play Zoey's "third animation", which is not the "reload shotgun" animation.
The trick to make the animations show correctly online is to re-order the list of animations in the replacement model's mdl file. For the example, you need to re-order Zoey's animations to be in the same order as Nick's. You do this in the qc file via the $declaresequence command.
Notice that this means you only have to rig a custom model once and can then use a modified qc file to recompile for each of the other survivors.
Changing the Animations the Easy Way
Follow these steps unless an update to L4D2 causes this process not to work.
Download my specially-prepared Survivor Anim Swap source file pack (last updated: 03-Jul-2015) containing qci files ready for ease-of-use. NOTE: The files are very good and have been used for many released addons already, but they probably could still use some tweaking to make the conversion the best it can be using this method.
Choose the correct qci file from the pack. For example, if you have rigged a woman custom model using Zoey's skeleton (and thus her animations should be used) and you are using it to replace Louis, then choose this file: "Anims_RigToZoey_ReplaceLouis.qci"
Open the chosen qci file with Notepad++.
Follow the instructions at the top of the chosen qci file.
Changing the Animations the Hard Way
Follow these steps when an update to L4D2 causes the easy process not to work.
Open Crowbar.
Click the Decompile tab.
Select for "MDL input" the MDL file of the model for which you will rig the custom mesh (call this the "RigTo" model).
Click the "Use Defaults" button.
Tick the "$DeclareSequence QCI file" option.
Click Decompile button.
Open the QC file and look for $includemodel.
For each $includemodel line, decompile the given MDL file with the "$DeclareSequence QCI file" option as done in the steps above.
Combine the $DeclareSequence QCI files into one file, keeping the $declaresequence lines in the same order as the $sequence and $includemodel lines in the first QC file.
Do all of the above again for the MDL file of the model that will be replaced (call this the "Replace" model).
Rename the "Replace" model's combined $DeclareSequence QCI file to "Anims_RigTo<rig_to_name>_Replace<replace_name>.qci" where <rig_to_name> is the character name you are rigging to and <replace_name> is the character name you are replacing.
Open the "Anims_RigTo<rig_to_name>_Replace<replace_name>.qci" file in Notepad++.
Rename each sequence to the equivalent sequence name used in the "RigTo" model's combined $DeclareSequence QCI file.