Easy weapon model changing

From Valve Developer Community
Revision as of 05:40, 16 August 2009 by JG215 (talk | contribs) (Created page with 'Welcome to this easy model changing tutorial for whatever mod you're mapping for, the first thing we will cover. Is that A) You have the model you want to replace with B) you k…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Welcome to this easy model changing tutorial for whatever mod you're mapping for, the first thing we will cover. Is that

A) You have the model you want to replace with

B) you know where to find the script

The first thing to do, is go to your scripts folder inside of your mod, and open up the name of the weapon you will be chaning.

C:\Program Files\Steam\steamapps\SourceMods\YOURMODNAME\scripts


For example, the file I will be using is the "Weapon_Pistol.txt" script. Inside the script you will find these lines...


// Pistol

WeaponData { // Weapon data is loaded by both the Game and Client DLLs. "printname" "#HL2_Pistol" "viewmodel" "models/weapons/v_pistol.mdl" "playermodel" "models/weapons/w_pistol.mdl" "anim_prefix" "pistol2" "bucket" "1" "bucket_position" "0"

"clip_size" "22" "primary_ammo" "Pistol" "secondary_ammo" "None"

"weight" "2" "item_flags" "0"


       "ironsightoffset"

{ "x" "-13" "y" "-5.5" "z" "4.2"

  	}

// Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds) SoundData {

"reload" "Weapon_Pistol.Reload" "reload_npc" "Weapon_Pistol.NPC_Reload" "empty" "Weapon_Pistol.Empty" "single_shot" "Weapon_Pistol.Single" "single_shot_npc" "Weapon_Pistol.NPC_Single" "special1" "Weapon_Pistol.Special1" "special2" "Weapon_Pistol.Special2" "burst" "Weapon_Pistol.Burst" }

// Weapon Sprite data is loaded by the Client DLL. TextureData { "weapon" { "font" "WeaponIcons" "character" "d" } "weapon_s" { "font" "WeaponIconsSelected" "character" "d" } "ammo" { "font" "WeaponIcons" "character" "p" } "crosshair" { "font" "Crosshairs" "character" "Q" } "autoaim" { "file" "sprites/crosshairs" "x" "0" "y" "48" "width" "24" "height" "24" } } }



the first thing to look at is the lines

"viewmodel" "models/weapons/v_pistol.mdl" "playermodel" "models/weapons/w_pistol.mdl"

These models will be changed. Extract the other weapon model you have into the correct folders, and make sure they're where they need to be. Next look at the ".mdl" file for the weapons you had. My directories for the models are,

SourceMods\YOURMODSNAME\models\weapons\ar33

In the pistol's script. change the models/weapons/v_pistol line to the file name, but before you do it. Take off the the extra lines

SourceMods\YOURMODSNAME\

or else the file won't work, now my script looks like this.

"viewmodel" "models/weapons/ar33/v_ar33.mdl" "playermodel" "models/weapons/ar33/w_ar33.mdl"

You can edit the

"clip_size" "22"

to whatever number you want the amount of ammo to be stored in the pistol. A glock holds 18 bullets in it's clip. So if you have a glock model, set it to this

"clip_size" "18"

I hope you found this tutorial easy, enjoy your model switching!


P.S, if the weapon works out, and it's purple checkerd. Make sure you installed the Materials to the right folder.


Any further edits will NOT be made by JG215

Created 8/16/09 eastern time 7:30 pm