Silencer

Inside3D
 • Front Page
 • Articles
 • Downloads
 • Forums
 • Hosting
 • Help Wanted
 • Interviews
 • Reviews
 • Staff

 
Allied Sites
 - AI Cafe
 - Bot Epidemic
 - Dark Places
 - Flat Earth
 - FrikBot
 - Ghoulish Art
 - Kilbert3D
 - Quake Info Pool
 - QSG: Quake Standards
 - Rusted Fork
 - Stroggs Gone Mad
 - More...
 
Quake
 - Getting Started
 - QuakeC Specs v1.0
 - QuakeC Tutorials
 - Quake Mod Index
 
Quake II
 - Getting Started
 - dll Sourcecode
 - Coding Tutorials
 
.dll Central
 - Getting Started
 - Learning
 - dll Primer
 - dll in C
 - dll in Delphi
 - Compilers
 
Jedi Knight
 - Getting Started
 - COG Specs
 - Sound Specs
 - Tutorials
 
Level Editing
 - Tutorials/Tips
 
 
Telefragged!!!
Created By: Marius
eMail: lordshoel@yahoo.com
Difficulty Scale: Easy


In this tutorial I'll show you how to add a simple but cool Silencer for both of the Nailguns. It is very easy to add and quite fun to play with, also this would be great in a multiplayer patch... You will need silencer.zip which contains one wave file Silencer.wav which must be placed in the weapons folder within the Sound folder as follows:

	\Quake\Mymod\Sound\Weapons\silencer.wav
Note: Mymod is the directory of this modification.

Step 1.

Open up Defs.qc and scroll to the very bottom. Then add the following varibles:

//Silencer 
.float silencer_on;
The above does not need to be at the bottom but it is easy and will not interfere with anything that might cause errors.

Step 2.

Ok open up Weapons.qc and scroll to the ImpulseCommands function. Once there paste the following code above the QuadCheat impulse.

if (self.impulse == 15)		
{
		if (self.silencer_on == FALSE) 
		{ 
			self.silencer_on = TRUE; 
			centerprint (self, "Silencer Acivated\n");
		}
		else if (self.silencer_on == TRUE) 
		{ 
			self.silencer_on = FALSE; 
			centerprint (self, "Silencer Deacivated\n");
		}
}
When you've finished there scroll up to the function W_Precache. At the bottom of that function paste:

	precache_sound ("weapons/silencer.wav");
Once that is done save and go onto Step 3.

Step 3.

Still in Weapons.qc find the functions W_FireSpikes & W_FireSuperSpikes. Found them? If you have find the sound for each weapon.

For the Super Spikes replace:

	sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
With the following:

	if (self.silencer_on == TRUE) 
	sound (self, CHAN_WEAPON, "weapons/silencer.wav", 1, ATTN_NORM);
	else sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
For the normal spikes replace:

	sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);
With the following:

	if (self.silencer_on == TRUE) 
	sound (self, CHAN_WEAPON, "weapons/silencer.wav", 1, ATTN_NORM);
	else sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);

Step 4.

Once done there close Weapons.qc and open Client.qc. Scroll down to the PutClientInServer function. When you have found that function scroll about half way through it till you find W_SetCurrentAmmo(); Then above that paste:

	self.silencer_on = FALSE;
The above line turns the silencer off when entering the server, so when you die and respawn or start a new level the silencer is automatically off.

Step 5.

Open up Player.qc. Find the functions Player_Nail1 and Player_Nail2. Once you have found them delete the following line from each:

	SuperDamageSound();
That was the last part of code to be modified. All thats left is Step 6...

Step 6.

Save and Compile. Pretty simple wasn't it? Have fun playing with your 'new toy'...






The Inside3D content and design is copyrighted by the Inside3D team, and may not be re-produced or copied without proper consent. All rights reserved. Any work credited to any author not part of InsideQC is copyrighted by that author. If you have any feedback, suggestions or flames please send it in to the author. Inside3D is hosted by telefragged and the design was originated by project-9.