Left 4 Dead 2

Left 4 Dead 2

221 个评价
Create Weapon Mods [With Prefabs]
由 мяFunreal 制作
This relatively long tutorial shows the entire process of rigging, animating and compiling a gun, along with creating a HUD image and sounds. Contains downloadable files for animating in blender (IK Rig prefab) and hud images (prefab textures and script parts)
2
   
奖励
收藏
已收藏
取消收藏
Foreword
THIS GUIDE IS OUTDATED
There's a newer, up to date text guide here.
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2712310851

If you ever wanted to create weapons for L4D2 you probably searched for a bunch of tutorials.
Maybe you found a few. One for soundmods, one for hud images, one that uses the $includemodel way for animating and others that mention an IK rig but you couldn't get a working IK rig in blender because you just weren't able to do it. Or too lazy.

My tutorial covers:
Creating view and worldmodels
Animating viewmodels
Creating a Hud image
Creating a soundmod

You also get a downloadable file which contains:
A photoshop save for hud images
Hud image prefabs in all possible sizes (large gun, large melee small items and chainsaw)
Hud script part prefab for all sizes and uses
A blender save file with viewmodel arms and set up IK rig
A list of all usable soundevents for animations
A prefab Addoninfo file
A textfile containing premade $animation lines for idle, lookposes and run



Video Guide
"Video Description"
Downloadable files:
Prefab: https://drive.google.com/open?id=1Mvxyu12ZP0dCL1B8ycvqo4J8onRbG5y8
Custom content folder guide: https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1507939076
Attachments guide: https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1464152705
Right-click to VPK guide: https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1544981726
Animation Framecount and FPS guide: https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1483047118
$Includemodel tutorial; for when you don't want to make your own animations.
The part between 24:22 and 39:20 can be substitued with this tutorial:
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1946053787

Tools:
Crowbar: https://psteamcommunity.yuanyoumao.com/groups/CrowbarTool
VTFEdit: http://nemesis.thewavelength.net/index.php?c=178
https://gamebanana.com/tools/6801
Original website down. This is an archive of all the developers relevant tools, Containing VTFedit.
Blender 2.77 (newer versions don't work nice with smd plugin): https://www.blender.org/download/releases/2-77/
Blender smd tools: http://steamreview.org/BlenderSourceTools/
Notepad++ https://notepad-plus-plus.org/download/v7.6.3.html
Notepad ++ VDF languages (shows syntax highlighting): https://developer.valvesoftware.com/wiki/Notepad%2B%2B_VDF_languages

For textures you can use photoshop, gimp or paint.net with the vtf plugins.
Alternatively, you can use VTFedit to manually convert textures into VTF Format one by one or in a batch.
Potoshop vtf Plugin (32bit version ONLY) http://nemesis.thewavelength.net/index.php?p=39
Gimp VTF Plugin: https://github.com/Artfunkel/gimp-vtf/releases
paint.net vtf plugin: http://nemesis.thewavelength.net/index.php?p=50

Timestamps (they actually work on youtube):
0:40 - Gathering original files
1:58 - Decompiling models
2:15 - Bender - importing files
---
Worldmodel
2:45 - Scaling
3:50 - Rigging
5:42 - Checking materials
6:09 - Fixing smoothing
6:55 - Collisionmesh
7:30 - Exporting model
8:45 - QC Editing
10:48 - Compiling for HLMV
11:53 - Converting textures to VTF
13:05 - Creating VMT files
14:05 - Pasting textures into game files' mod folder
14:30 - Attachments
16:16 - Compiling for L4D2
16:48 - Making test file
---
Viewmodel
17:43 - Preparing viewmodel
21:19 - Rigging
24:14 - Exporting model
24:22 - Preparing idle animation
24:42 - Animating tips
28:21 - Posing viewmodel idle animation
30:46 - Exporting test idle animation
31:01 - QC File preparing
32:33 - Attachments
33:08 - Idle animation
34:20 - Lookposes
35:24 - QC file animation line preparing
38:10 - Animating other animations
---
Hud image
39:20 - Creating camera for rendering
40:19 - Texture placement and Script editing
41:04 - Creating HUD image from render
---
42:34 - Soundmod
---
45:34 - final testing
End
Good luck creating your own mods.
Fixing broken playermodel arms.
Sometimes working on a viewmodel ends up with playermodel arms looking like a balled up mess.
This is caused by having a different $definebone line order. Either by writing new $definebone lines in a different order, or deleting existing $definebone lines.
It can be fixed by using the original $definebone lines and not modifying their order at all.
You are allowed to modify their location and rotation if required.

If you do need new bones, build new $definebone lines by Commenting all existing definebone lines, writing $bonemerge lines for the bones you want and compiling the QC with Crowbars "Definebone option". Then pick out only your custom $definebone lines and append them after all original $definebone lines.
Melee Textures
I forgot to mention, but if you are going to make a melee weapon, your VMT files require teh following lines to allow bloddy hands

$detail "models/infected/hunter/hunter_01_detail.vtf" $detailscale "1.75" $detailblendfactor .001 $detailblendmode 0 $detailAmount 0 Proxies { BloodyHands { resultVar $detailAmount } Equals { srcVar1 $detailAmount resultVar $detailblendfactor } }

hunter_01_detail.vtf is the default blood. but you can replace it with a vtf fit for your model if you want.
42 条留言
ึ Jade֎Phantom ึ ึ 5 月 14 日 下午 1:56 
nice
zeriahtherabbid 2021 年 12 月 28 日 下午 12:33 
well ok then im glad its possible
мяFunreal  [作者] 2021 年 12 月 28 日 上午 4:18 
yes
zeriahtherabbid 2021 年 12 月 27 日 下午 8:55 
hey is it possible to make a fist punch weapon on l4d2?
мяFunreal  [作者] 2021 年 12 月 26 日 下午 9:11 
heh, glad you solved the problem.
Death Angel 2021 年 12 月 26 日 下午 6:53 
Thanks! I was able to solve the problem. I set crowbar to compile to the game "models" folder instead of the work forlder option and filled out the filepath in the QC. Basically, I followed your guild more closely. :)
мяFunreal  [作者] 2021 年 12 月 25 日 上午 9:27 
this guide explains that https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1507939076

Also, you don't need to change the crowbar output folder. that's not how this works.
You only need to change the modelname line.
It would be better if you'd just join the D4m discord server where a bunch of modders, me included, can help faster https://discord.gg/4qtmzBP
Death Angel 2021 年 12 月 24 日 下午 8:38 
Hmm... Crowbar's compiler option "Game that has the model compiler" is set to L4D2. That is how which studiomdl.exe used is determined, correct?
My $modelname lines look as follows:
//$modelname "w_models\Weapons\w_rifle_ak47.mdl"
$modelname "w_rifle_ak47.mdl"
(Crowbar's output folder is determining the "common\Left 4 Dead 2\left4dead2\models\w_models\weapons\models" filepath that is different from the original) I have tried changing the .mdl name itself to something original, but it did not fix my problem.
How do I get HLMV to recognize my custom folder in the common\Left 4 Dead 2 directory?
мяFunreal  [作者] 2021 年 12 月 24 日 下午 7:44 
usually, that is caused by either using the wrong studiomdl.exe during compile.
it could also be because you haven't duped and changed the $modelname so you are still compiling to the default modelname, which hlmv dislikes to open.
Death Angel 2021 年 12 月 24 日 下午 7:03 
I am following your guide, but I am having trouble getting HLMV to open my world model: "Error Loading Model"
What is the most likely problem here? I can provide QC file and Crowbar compile logs if it would help. Any help appreciated.