Rage through 32 single player levels and 6 deathmatch levels of sheer terror and fully immersive sound and lighting. Arm yourself against the cannibalistic Ogre, fiendish Vore and indestructible Schambler using lethal nails, fierce Thunderbolts and abominable Rocket and Grenade Launchers.

Post tutorial Report RSS Drunk rockets

Twist the rocket's direction of flight around to an unpredictable angle every tiny fraction of a second, to create the ultimate surprise weapon.

Posted by on - Basic Server Side Coding

Introduction

Today, we're gonna screw up the everyday over-predictable rocket. This is VERY easy to do, it's so easy even a caveman can do it.

Step one!

Let's go over to WEAPONS.QC.

Head on down to W_FireRocket. Paste this above the W_FireRocket function:

void() RocketScrewUp =
{
self.velocity = ((self.velocity + ((v_right * 121.000) * crandom ())) + ((v_up * 121.000) * crandom ()));
self.nextthink = time + 0.08; // screw up fast
self.think = RocketScrewUp;
};

Obviously this puts this rocket randomly off course. Can work for other projectiles. Works great for insect guns like the HornetGun from Half-Life.

THE FINAL STEP ALREADY???
Go into the W_FireRocket function and find this:

// set missile duration
	missile.nextthink = time + 5;
	missile.think = SUB_Remove;

and change it to something like this

// set missile drunkation
        missile.nextthink = time + 0.1; // Assume it's safe to screw away....
        missile.think = RocketScrewUp;

And..........we are done. Compile and run. Fire the rocket. That wasn't so overwhelming was it? Now you can play fair with n00bs. Now autoaim won't serve a purpose.

Written in Feb 2002. Damn that's ancient!

Post comment Comments
Sajt
Sajt - - 1,641 comments

This tutorial was written before I had even heard of QuakeC :O And look at me now! :D! And yes, I3D tutorials got me started!

(I think)

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: