Left 4 Dead 2

Left 4 Dead 2

103 ratings
Modify xdR and other animation addons
By xdshot
Instead of begging authors to make separate edits, you can modify xdR animation addons for your personal needs. This guide lists what is possible to do with regular Hex Editors and Files Browsers.
   
Award
Favorite
Favorited
Unfavorite
What tools needed
You need hex edtor of your choice and .vpk archive tool to extract and pack it back: vpk.exe, Crowbar or GCFScape (only extraction)
Addon extract
First, find and extract addon .vpk archive. All workshop addons are stored in Left 4 Dead 2/left4dead2/addons/workshop/ and non-workshop addons are stored in Left 4 Dead 2/left4dead2/addons/. Preview images are stored along with vpks, use them to identify needed addon. You can also find addon id in workshop page in address bar, after ?id= comes addon number.

xdR anims are stored in /models/xdreanims/.
Disable character specific anims set
Simply remove character's anims .mdl and .ani files.
Move to different slot
You might have two anim mods that replace same sequences. One with currently lowest slot will play anims that both addons replace. You can move another addon to any lower slot to play it's anims instead (or higher slot to allow other addon play it's anims).

  1. Rename .mdl and .ani (if exists) files so they have different slot indicated in their name. For ex. if we want to move Coach animations occupying slot 47 to slot 11. rename files to coach_slot_011.mdl and coach_slot_011.ani
  2. Open renamed .mdl file in hex editor
  3. Edit it so it references to new .mdl path at beginning
  4. Near end of file, point to new .ani path
  5. Save file
Disable specific sequence
Say you don't want specific sequence to be played in game. For ex., to disable Idle_Standing_Pistol sequence, do this:

Open .mdl file in hex editor. Search for Idle_Standing_Pistol text.
It may find text prefixed with a_ like a_Idle_Standing_Pistol. Don't touch it, it's $animation. Keep it, search next.


Needed sequence looks like this. If it has Activity id assigned to it, it usually comes after and has ACT_ prefix.

To disable it, change it's name and act like this:


I advise changing only one letter in name and act. Name and act length must be same.

Technically, this sequence is still inside model, but it should no longer be triggered in game.
Move animation set to different character
It's technically possible but not advised as different character have different proportions or different skeletal structure. For ex. if we move anim from Coach to Zoey, it will be stretched in game. Moving from survivor to special infected won't work.

Rename .mdl to needed character and slot.

Original .ani must be renamed so it has same length. Simply replace some letters.

Open .mdl file in hex editor.


Edit so it has new path reference. Path field is 64 bytes long like selection above shows, after .mdl there is padding filled with hex zeroes 00. You must not exceed it.


Near end of file, point to new .ani path

Convert non-xdR anim mod to xdR
There are anim mods that do not utilize xdReanimsBase. It is possible to port them to xdR so it can be combined with other xdR anims. Since these replace all sequences, it's best idea to assign them to highest possible slot. For ex., animation mod for Charger is converted like this:

Move .mdl file to xdreanims folder and rename to assigned character and slot:
models/infected/anim_charger.mdl ---> models/xdreanims/charger_slot_047.mdl

.ani file must be located at same folder and must have same name length. Rename it by changing only some letters.

Edit .mdl file in hex editor so it has new path reference. Path field is 64 bytes long like selection below shows, after .mdl there is padding filled with hex zeroes 00. You must not exceed it.


Near end of file, point to new .ani path


Save file.
Advanced editing
If you familiar to modding, you may try to decompile anim using Crowbar, do changes, compile back.

I won't cover the process, that's beyond of scope of this guide. I can say though that decompiler can't produce source files perfectly suitable for editing unless it only has some simple animations. Delta sequences will be complete garbage. Best thing you can do is to create another extension that contains your edited sequences.
After edits
Open addoninfo.txt in text editor and change addon name for your convenience.

Pack edited addon into .vpk by using vpk.exe or Crowbar.
Conclusion
Your addon is ready. Place it in Left 4 Dead 2/left4dead2/addons/. I strongly advise against uploading it without original author's acknowledgement.
17 Comments
Schizophrenia(2) 27 Nov, 2023 @ 7:07pm 
Nevermind figured how to
Schizophrenia(2) 27 Nov, 2023 @ 7:14am 
Hi. Do you know how to use xdReanims animations on prop_dynamic entity?
Tac_L1bra 14 Nov, 2023 @ 2:27am 
Hi, I was trying to replace the CSS calm worldview anims with CSGO calm anims for all survivors for personal use. It turns out that I messed it up a bit when the characters looked stretched a bit, looking funny tho. Anyone got a good grasp of it by changing those anims in particular?
¯\_(ツ)_/¯ 16 Oct, 2023 @ 5:07am 
Disable specific sequence working 100% thanks 👌
CalamityChimera 29 Aug, 2023 @ 7:54pm 
Nevermind, finally got it. Anyone feel free to dm me if you still need help and I will try my best
CalamityChimera 29 Aug, 2023 @ 5:52pm 
Hi, trying to replace https://gtm.you1.cn/sharedfiles/filedetails/?id=2674612384&searchtext=tank+victory with https://gtm.you1.cn/sharedfiles/filedetails/?id=1919726251&searchtext=tank+victory but every time I think I understand it, the tank just stands still with his hands in the air instead. Any ideas?
Not Selling FP 20 Jul, 2023 @ 2:39am 
What about to make a skin for Francis or Louis compatible with your healing animations?
HAKeller 18 May, 2023 @ 6:02am 
ok nerd
Captain Jameson 10 Apr, 2023 @ 8:40pm 
@xdshot oh thats weird. Anyway, thanks for adding it back!
xdshot  [author] 10 Apr, 2023 @ 10:26am 
Yep, some pictures mysteriously disappeared