Left 4 Dead 2

Left 4 Dead 2

103 个评价
Modify xdR and other animation addons
由 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.
   
奖励
收藏
已收藏
取消收藏
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 条留言
Schizophrenia(2) 2023 年 11 月 27 日 下午 7:07 
Nevermind figured how to
Schizophrenia(2) 2023 年 11 月 27 日 上午 7:14 
Hi. Do you know how to use xdReanims animations on prop_dynamic entity?
Tac_L1bra 2023 年 11 月 14 日 上午 2:27 
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?
¯\_(ツ)_/¯ 2023 年 10 月 16 日 上午 5:07 
Disable specific sequence working 100% thanks 👌
CalamityChimera 2023 年 8 月 29 日 下午 7:54 
Nevermind, finally got it. Anyone feel free to dm me if you still need help and I will try my best
CalamityChimera 2023 年 8 月 29 日 下午 5:52 
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 2023 年 7 月 20 日 上午 2:39 
What about to make a skin for Francis or Louis compatible with your healing animations?
HAKeller 2023 年 5 月 18 日 上午 6:02 
ok nerd
Captain Jameson 2023 年 4 月 10 日 下午 8:40 
@xdshot oh thats weird. Anyway, thanks for adding it back!
xdshot  [作者] 2023 年 4 月 10 日 上午 10:26 
Yep, some pictures mysteriously disappeared