Replacing the Crowbar with the Stunstick: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Using the stunstick in HL2SP mods)
 
m (→‎top: clean up, added deadend tag)
 
(11 intermediate revisions by 7 users not shown)
Line 1: Line 1:
This is a very simple tutorial explaining how to replace the crowbar with a stunstick in your single player Half Life 2 mod. The stunstick model exists in HL2 deathmatch, so we are just going to get the textures and model from there and place them in our mod.
{{Multiple issues|
{{Dead end|date=January 2024}}
{{orphan}}
}}


===Extracting the model files===
Switching the crowbar to use the stunbaton is as simple as opening your scripts/weapon_crowbar.txt. Inside, find these 2 lines:
* Create the following directories in your single player mod:
<pre>
''The stunstick's skin will go here:''
"viewmodel" "models/weapons/v_crowbar.mdl"
:<code>Steam\SteamApps\SourceMods\YOURMOD\materials\models\weapons\v_stunstick</code>  
"playermodel" "models/weapons/w_crowbar.mdl"
''The model will go here:''
</pre>
:<code>Steam\SteamApps\SourceMods\YOURMOD\models\Weapons</code>
And change to:
 
<pre>
* Using [[GCFScape]], open the <code>Steam\Steamapps\half-life 2 deathmatch.gcf</code>.
"viewmodel" "models/weapons/v_stunbaton.mdl"
* Navigate to <code>root\hl2mp\materials\models\weapons\v_stunstick</code> and copy all the files in this directory to the equivalent directory in your mod.
"playermodel" "models/weapons/w_stunbaton.mdl"
* Then navigate to <code>root\hl2mp\models\Weapons</code> and copy the following files to the <code>Weapons</code> directory in your mod:
</pre>
:<code>v_stunstick.dx80.vtx</code>
{{note|This will not get you the glow effect, but only the model. The one in Half-Life 2 is also not finished. Use the one from Half-Life 2: Deathmatch.}}
:<code>v_stunstick.dx90.vtx</code>
:<code>v_stunstick.mdl</code>
:<code>v_stunstick.sw.vtx</code>
:<code>v_stunstick.vvd</code>
 
===Replacing the Crowbar In-game===
* Finally, to actually use this model we need to tell our mod that the stun stick is actually a crowbar. Rename <code>Steam\SteamApps\SourceMods\YOURMOD\scripts\weapon_stunstick.txt</code> to <code>weapon_crowbar.txt</code> (you might want to back up the original first).
* Now, to make it occupy the same slot in the weapons list open the new <code>weapon_crowbar.txt</code> file and change the <code>"bucket_positon"</code> to 0 instead of 3.
 
===See it in action===
* Create a new map and drop a <code>weapon_crowbar</code> item in it along with a bunch of crates to smash...
* Run your new map and pick up the stunstick, use it just like you would a regular crowbar.
* Enjoy.


[[Category:Tutorials]]
[[Category:Tutorials]]

Latest revision as of 10:09, 21 January 2024

Wikipedia - Letter.png
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)
Dead End - Icon.png
This article has no Wikipedia icon links to other VDC articles. Please help improve this article by adding links Wikipedia icon that are relevant to the context within the existing text.
January 2024

Switching the crowbar to use the stunbaton is as simple as opening your scripts/weapon_crowbar.txt. Inside, find these 2 lines:

	"viewmodel"	"models/weapons/v_crowbar.mdl"
	"playermodel"	"models/weapons/w_crowbar.mdl"

And change to:

	"viewmodel"	"models/weapons/v_stunbaton.mdl"
	"playermodel"	"models/weapons/w_stunbaton.mdl"
Note.pngNote:This will not get you the glow effect, but only the model. The one in Half-Life 2 is also not finished. Use the one from Half-Life 2: Deathmatch.