Mini Gunner
Author: ShockManSource: https://www.insideqc.com/qctut/qctut-5.shtml
Intruduction
How to make a mini-gun in 10 + 1 easy step...
This is a really simple patch that changes the super nailgun to a MINIGUN with some other cool effects!!
Step 1
First open up weapons.qc and search for void() W_FireSuperSpikes.
Step 2
Change the W_FireSuperSpikes function so it looks like this:
void() W_FireSuperSpikes =
{
local vector dir;
sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
self.attack_finished = time + 0.2;
self.currentammo = self.ammo_nails = self.ammo_nails - 2;
self.punchangle_x = -2;
dir = aim (self, 100000);
FireBullets (1, dir, '0 0 0');
};
Step 3
What does this do, you wonder...
First sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
this playes the supernailgun sound, maybe it would be better to change it to the shotgun sound.
Next thing, self.attack_finished = time + 0.2; tells quake that one shot will take 0.2 seconds.
After that is self.currentammo = self.ammo_nails = self.ammo_nails - 2; this removes 2 nails
from your ammo per shot.
self.punchangle_x = -2; this makes you shake abit when you shot, you can try to set this to a
lower number, just fool around abit with it.
last is: dir = aim (self, 100000);
FireBullets (1, dir, '0 0 0');
this fires the bullets.
Step 4
Compile the patch now. use impulse 9 to get all weapons and select the super nailgun, and fire!! cool, huh?
Step 5
Yea.. its cool, but it could be better...
Lets make the shots go abit wider... change FireBullets (1, dir, '0 0 0'); to FireBullets (6, dir, '0.04 0.04 0');
Maybe you wanna try some different numbers, so i will explain what the numbers do.
The first number (6) is how many bullets that shall be fired...
The second parameter (dir) is just what direction to fire in (dont mess around with it, or maybe do it!! i could be cool) :)
Next it is 3 numbers... the first one is how wide the shots shall go, the second is how much up/down they shall go, the third one is the deept of the shoot... dont know why you would wanna use this... (its mostly set to 0 anyway)
Step 6
Compile and test.
Step 7
Before i said that it might be better with the shot gun sound, so lets change it. just change
weapons/spike2.wav to weapons/guncock.wav
Step 8
Test again...
Step 9
Now its really cool, but there is something thats missing...
hmm... why not make you fly back a little bit when you fire!!
ok.. after FireBullets (6, dir, '0.04 0.04 0'); add self.velocity = dir * -300;
Step 11
Compile and test again (try to look down and fire, wow MUCH better that rocket jump!) :)
Step 11 (extra step)
Hmm... if you want to remove that "fly" effect just add self.velocity_z = 0; after
self.velocity = dir * -300;
There ya go... now enjoy this cool patch :)
Tags: tutorial, quakec, qc, insideqc, weapon