InsideQC
 - Front Page

Tutorials are copyrighted by their author and the Inside3D staff. And may be used in any Quake modification provided that the author and the InsideQC staff are credited. Please direct any comments to the author.


Created By: Mr. Pink
eMail: mrpink@hempseed.com
Difficulty Scale: Easy


In this Tutorial im gonna show you how to change the grenade launcher in a... well... a pretty knewl
Weapon. So... if you want to know what it is DO IT. Remember add the code in blue.



Step 1
Open Weapons.qc and at the beggining in the void() Pre_Cache section add this:
        precache_sound ("weapons/bounce.wav");		// grenade bounce
        precache_sound ("weapons/shotgn2.wav"); 	// super shotgun
        precache_model ("progs/lavaball.mdl");
Step 2
Scroll down to W_FireGrenade and change the code where it says:

void() W_FireGrenade =
{
	local	entity missile, mpuff;
	
        self.currentammo = self.ammo_rockets = self.ammo_rockets - 25; // change them to be more expensive.. you can put any number 
	
	sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);

	self.punchangle_x = -2;

	missile = spawn ();
	missile.owner = self;
        missile.movetype = MOVETYPE_FLYMISSILE; // change from movetype_bounce... to make it be like a rocket
        missile.solid = SOLID_BBOX;
        missile.classname = "missile"; // change it from "grenade"
        missile.effects = self.effects | EF_DIMLIGHT; // Make it glow
		
// set missile speed	

	makevectors (self.v_angle);

//        if (self.v_angle_x)
                missile.velocity = v_forward * 0 + v_up * 0 + crandom()*v_right * 0 + crandom()*v_up*0; // Change all values to 0.. to make it static 
//        else
//        {
		missile.velocity = aim(self, 10000);
                missile.velocity = missile.velocity * 0; // Same here
                missile.velocity_z = 0;
//        }

	missile.avelocity = '300 300 300';

	missile.angles = vectoangles(missile.velocity);
	
	missile.touch = GrenadeTouch;
	
// set missile duration
        missile.nextthink = time + 20; // change the time to the next think to 20 secs.
	missile.think = GrenadeExplode;

        setmodel (missile, "progs/lavaball.mdl"); //Change the model og the grenades to the lavaball
	setsize (missile, '0 0 0', '0 0 0');		
	setorigin (missile, self.origin);
};


Step 3
Compile it.. use it... and please mail me if you have a name for it :)