Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Editing Hunter Killer Missiles by Sestze
From Quake Wiki
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | Created By: Sestze | + | Created By: Sestze |
− | + | Email: sestze@yahoo.com | |
− | Email: sestze@yahoo.com | ||
− | |||
Difficulty Scale: Easy/Medium (up to the reader) | Difficulty Scale: Easy/Medium (up to the reader) | ||
− | + | ||
− | |||
Step 1. | Step 1. | ||
− | + | ||
Add the following code to weapons.qc, near the top. | Add the following code to weapons.qc, near the top. | ||
− | + | ||
/* | /* | ||
− | |||
================= | ================= | ||
− | |||
Hunter Killer | Hunter Killer | ||
− | |||
By: Sestze (enjoy!) | By: Sestze (enjoy!) | ||
− | |||
================= | ================= | ||
− | |||
*/ | */ | ||
− | + | ||
− | |||
//Function Prototypes | //Function Prototypes | ||
− | |||
void() W_HunterFire; | void() W_HunterFire; | ||
− | |||
void() T_HunterTouch; | void() T_HunterTouch; | ||
− | |||
void() S_HunterThink; | void() S_HunterThink; | ||
− | |||
entity(entity startz, float cr_range, float wall) Checkrad; | entity(entity startz, float cr_range, float wall) Checkrad; | ||
− | + | ||
− | |||
//Fire Function | //Fire Function | ||
− | |||
− | |||
void() W_HunterFire = | void() W_HunterFire = | ||
− | |||
{ | { | ||
− | |||
sound(self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); //Classic rocket fire | sound(self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM); //Classic rocket fire | ||
− | + | ||
− | |||
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; //Subtract a rocket | self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; //Subtract a rocket | ||
− | + | ||
− | |||
local entity hunter; //Make an entity | local entity hunter; //Make an entity | ||
− | + | ||
− | + | hunter = spawn(); //Spawn it | |
− | hunter = spawn(); | ||
− | |||
hunter.classname = "Hunter killer"; //Give it a classname | hunter.classname = "Hunter killer"; //Give it a classname | ||
− | |||
hunter.owner = self; //You own this baby. | hunter.owner = self; //You own this baby. | ||
− | |||
hunter.oldenemy = self; //You will need this | hunter.oldenemy = self; //You will need this | ||
− | |||
hunter.movetype = MOVETYPE_FLY; //Flies around | hunter.movetype = MOVETYPE_FLY; //Flies around | ||
− | + | hunter.solid = SOLID_BBOX; //Solid - Touch on edge, block (Pickable items and missiles) | |
− | hunter.solid = SOLID_BBOX; //Solid - Touch on edge, block | + | |
− | + | makevectors(self.v_angle); //Make vectors from your current viewing angle | |
− | (Pickable items and missiles) | ||
− | |||
− | |||
− | makevectors(self.v_angle); //Make vectors from your | ||
− | |||
− | current viewing angle | ||
− | |||
hunter.velocity = v_forward * 240; //Fly forward at 240 units (trust me, you will want this) | hunter.velocity = v_forward * 240; //Fly forward at 240 units (trust me, you will want this) | ||
hunter.angles = vectoangles(hunter.velocity); //Set the angles for the object | hunter.angles = vectoangles(hunter.velocity); //Set the angles for the object | ||
Line 196: | Line 164: | ||
Step 2. | Step 2. | ||
− | + | Scroll down to this line: 977 of weapons.qc. Where it should read: W_FireRocket(); Replace W_FireRocket with W_HunterFire(); | |
A quick rundown of what happens (in english): | A quick rundown of what happens (in english): | ||