Replacing the Crowbar with the Stunstick

From Valve Developer Community
Revision as of 21:11, 18 March 2006 by Rodeoclown (talk | contribs) (Using the stunstick in HL2SP mods)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.

Extracting the model files

  • Create the following directories in your single player mod:

The stunstick's skin will go here:

Steam\SteamApps\SourceMods\YOURMOD\materials\models\weapons\v_stunstick

The model will go here:

Steam\SteamApps\SourceMods\YOURMOD\models\Weapons
  • Using GCFScape, open the Steam\Steamapps\half-life 2 deathmatch.gcf.
  • Navigate to root\hl2mp\materials\models\weapons\v_stunstick and copy all the files in this directory to the equivalent directory in your mod.
  • Then navigate to root\hl2mp\models\Weapons and copy the following files to the Weapons directory in your mod:
v_stunstick.dx80.vtx
v_stunstick.dx90.vtx
v_stunstick.mdl
v_stunstick.sw.vtx
v_stunstick.vvd

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 Steam\SteamApps\SourceMods\YOURMOD\scripts\weapon_stunstick.txt to weapon_crowbar.txt (you might want to back up the original first).
  • Now, to make it occupy the same slot in the weapons list open the new weapon_crowbar.txt file and change the "bucket_positon" to 0 instead of 3.

See it in action

  • Create a new map and drop a weapon_crowbar 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.