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
+
<nowiki>Created By: Sestze  
<br>
+
Email: sestze@yahoo.com  
Email: sestze@yahoo.com
+
Difficulty Scale: Easy/Medium (up to the reader)  
<br>
+
Difficulty Scale: Easy/Medium (up to the reader)
+
 
<br>
 
<br>
 
 
Step 1.
 
Step 1.
<br>
+
 
 
  Add the following code to weapons.qc, near the top.  
 
  Add the following code to weapons.qc, near the top.  
<br>
+
 
 
/*
 
/*
<br>
 
 
=================
 
=================
<br>
 
 
Hunter Killer
 
Hunter Killer
<br>
 
 
By: Sestze (enjoy!)
 
By: Sestze (enjoy!)
<br>
 
 
=================
 
=================
<br>
 
 
*/
 
*/
<br>
+
 
<br>
 
 
//Function Prototypes
 
//Function Prototypes
<br>
 
 
void() W_HunterFire;
 
void() W_HunterFire;
<br>
 
 
void() T_HunterTouch;
 
void() T_HunterTouch;
<br>
 
 
void() S_HunterThink;
 
void() S_HunterThink;
<br>
 
 
entity(entity startz, float cr_range, float wall) Checkrad;
 
entity(entity startz, float cr_range, float wall) Checkrad;
<br>
+
 
<br>
 
 
//Fire Function
 
//Fire Function
<br>
 
<br>
 
 
void() W_HunterFire =
 
void() W_HunterFire =
<br>
 
 
{
 
{
<br>
 
 
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
<br>
+
<br>
 
 
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; //Subtract a rocket
 
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; //Subtract a rocket
<br>
+
<br>
 
 
local entity hunter; //Make an entity
 
local entity hunter; //Make an entity
<br>
+
<br>
+
hunter = spawn(); //Spawn it
hunter = spawn();  
 
<br> //Spawn it
 
 
hunter.classname = "Hunter killer"; //Give it a classname
 
hunter.classname = "Hunter killer"; //Give it a classname
<br>
 
 
hunter.owner = self; //You own this baby.
 
hunter.owner = self; //You own this baby.
<br>
 
 
hunter.oldenemy = self; //You will need this
 
hunter.oldenemy = self; //You will need this
<br>
 
 
hunter.movetype = MOVETYPE_FLY; //Flies around
 
hunter.movetype = MOVETYPE_FLY; //Flies around
<br>
+
hunter.solid = SOLID_BBOX; //Solid - Touch on edge, block (Pickable items and missiles)
hunter.solid = SOLID_BBOX; //Solid - Touch on edge, block  
+
<br>
+
makevectors(self.v_angle); //Make vectors from your current viewing angle
(Pickable items and missiles)
 
<br>
 
<br>
 
makevectors(self.v_angle); //Make vectors from your  
 
<br>
 
current viewing angle
 
<br>
 
 
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 203: Line 172:
 
The reason why I used an entity function to find opponents was for simplicity for any other homing weapons in future. It finds anything within a giant radius (or a small one, your call), and finds the closest one possible.  
 
The reason why I used an entity function to find opponents was for simplicity for any other homing weapons in future. It finds anything within a giant radius (or a small one, your call), and finds the closest one possible.  
  
Alright, I'm done here, Have fun with new rockets that fly after opponents.
+
Alright, I'm done here, Have fun with new rockets that fly after opponents.  
 +
</nowiki>

Please note that all contributions to Quake Wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see Quake Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)