Easy weapon model changing: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(Some cleanup and a category)
Line 12: Line 12:
C:\Program Files\Steam\steamapps\SourceMods\YOURMODNAME\scripts
C:\Program Files\Steam\steamapps\SourceMods\YOURMODNAME\scripts


 
For example, the file used in this tutorial is the "Weapon_Pistol.txt" script. Inside the script you will find the following lines:
For example, the file I will be using is the "Weapon_Pistol.txt" script. Inside the script you will find these lines...
 


[[File:The.txtfile.jpg]]
[[File:The.txtfile.jpg]]


The first thing to look at is the lines in the script for the weapon model:


"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. For example, the directory for the models used in this tutorial is:


SourceMods\YOURMODSNAME\models\weapons\ar33


In the pistol's script. change the <code>models/weapons/v_pistol</code> line to the file name, but before you do it. Do not include the <code>SourceMods\YOURMODSNAME\</code> portion of the directory path, or the file won't work. Now the script should look like this.


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


the first thing to look at is the lines in the .txt script for the weapon
You can edit the <code>"clip_size"</code> value to whatever amount of ammo you want to be stored in the pistol. For example, a Glock 17 holds 17 rounds in its magazine. So if you have a Glock 17 model, set it to this:
 
 
 
"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. Or if the weapons model doesen't show up, and it's an error. Check if you mispelled anything in the scripts viewmodel and playermodel
"clip_size" "17"




Any further edits will NOT be made by JG215
==Troubleshooting==
If the model is changed, but it's purple checkered in game, make sure the materials for the model were installed to the right folder. If the weapons model doesn't show up, check if you misspelled anything in the script's viewmodel and playermodel.


Created 8/16/09 eastern time 7:30 pm
[[Category:Tutorials]]

Revision as of 13:40, 18 December 2014

Broom icon.png
This article or section needs to be cleaned up to conform to a higher standard of quality.
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.
Broom icon.png
This article or section should be converted to third person to conform to wiki standards.

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 used in this tutorial is the "Weapon_Pistol.txt" script. Inside the script you will find the following lines:

The.txtfile.jpg

The first thing to look at is the lines in the script for the weapon model:

	"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. For example, the directory for the models used in this tutorial is:

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. Do not include the SourceMods\YOURMODSNAME\ portion of the directory path, or the file won't work. Now the script should look like this.

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

You can edit the "clip_size" value to whatever amount of ammo you want to be stored in the pistol. For example, a Glock 17 holds 17 rounds in its magazine. So if you have a Glock 17 model, set it to this:

"clip_size"			"17"


Troubleshooting

If the model is changed, but it's purple checkered in game, make sure the materials for the model were installed to the right folder. If the weapons model doesn't show up, check if you misspelled anything in the script's viewmodel and playermodel.