Quake DeveLS - Homing Missile 3

Author: Chris Hilton
Difficulty: Medium

Let's Do It...

I think the 'Homing Missile 2' is a great addition, but the way it is, it'll only beep at the first player locked on to. Since the homing missile can pick up new targets in flight, this mod implements beeping at each target for each think (would have to be a short beep, though). If a beep every frame is too much, you could change it by simply keeping track of who was targeted before and playing the beep each time the target changes.

Something like :

g_local.h at the end of the edict_s structure:

         // common data blocks
         moveinfo_t              moveinfo;
         monsterinfo_t   monsterinfo;
 
 +      // CCH & GREGG
 +      edict_t       *homing_target;
    };
g_weapon.c in homing_think function
     if (target != NULL)
        {
        // target acquired, nudge our direction toward it
        VectorNormalize(targetdir);
        VectorScale(targetdir, 0.2, targetdir);
        VectorAdd(targetdir, ent->movedir, targetdir);
        VectorNormalize(targetdir);
        VectorCopy(targetdir, ent->movedir);
        vectoangles(targetdir, ent->s.angles);
        speed = VectorLength(ent->velocity);
        VectorScale(targetdir, speed, ent->velocity);
 
 +      // CCH & GREGG
 +      //is this the same target as before? sound warning for new targets
 +      if (target != ent->homing_target)
 +         {
 +         gi.sound (target, CHAN_AUTO, gi.soundindex ("misc/homelock.wav"), 1, ATTN_NORM, 0);
 +         ent->homing_target = target;
 +         }
        }
g_weapon.c in fire_rocket function :
         rocket->touch = rocket_touch;
 //      rocket->nextthink = level.time + 8000/speed;
 //      rocket->think = G_FreeEdict;
 
 +      // CCH & GREGG: target last homed in on
 +      rocket->homing_target = NULL;
 
        // CCH: see if this is a player and if they have homing on
        if (self->client && self->client->pers.homing_state)
             {
Ok that's it... Now, if you hear beeps, still feel free to start running, but if the beeps stop, feel free to relax.

Chris Hilton .

This site, and all content and graphics displayed on it,
are ©opyrighted to the Quake DeveLS team. All rights received.
Got a suggestion? Comment? Question? Hate mail? Send it to us!
Oh yeah, this site is best viewed in 16 Bit or higher, with the resolution on 800*600.
Thanks to Planet Quake for their great help and support with hosting.
Best viewed with Netscape 4