Tutorial request: Guided Missiles (MGS style).
Moderator: InsideQC Admins
6 posts
• Page 1 of 1
Tutorial request: Guided Missiles (MGS style).
I'm reaching the limits of my quake c abilities so I've decided to ask for help on how to make guided missiles like the ones seen in metal gear solid (the nikita missiles specifically).
Basically, a controllable first person view of a rocket that is constantly moving forwards, slows down to a crawl when turning and slowly speeds up again when not turning the view.
The code I have is a mess/hacky and dosn't work, so I'd rather start off on a good foot
I think it would be a pretty fun weapon
- Thanks for reading.
Basically, a controllable first person view of a rocket that is constantly moving forwards, slows down to a crawl when turning and slowly speeds up again when not turning the view.
The code I have is a mess/hacky and dosn't work, so I'd rather start off on a good foot
I think it would be a pretty fun weapon
- Thanks for reading.
-

MDave - Posts: 76
- Joined: Mon Dec 17, 2007 7:08 pm
[url]ftp.gamers.org/pub/idgames2/quakec/weapons/guidemis.zip[/url]
It's a mod from another guy, qc files are included, you can give'em a read!
If you see the files you'll notice that it should do some hacks, I don't understand that changing point of view thing very well... But notice that it copies every player's stats...
It's a mod from another guy, qc files are included, you can give'em a read!
If you see the files you'll notice that it should do some hacks, I don't understand that changing point of view thing very well... But notice that it copies every player's stats...
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
For those of you who have played Super Smash Bros Brawl, Snake's missile launcher is similar to what he wants (but he wants a first person view). The missile travels rather fast unless it's turning, in which case it travels quite slowly.
MDave: To do the "slowing down during a turn" thing, simply keep track of your last orientation and watch for differences:
*If you track angles, you can do an angle comparison to see if you've turned more than a certain threshold and slow yourself down.
*If you track a direction instead of angles you can do a dot product (which is easier than angle compare imo) by multiplying the current direction and the old direction (make sure both are normalized). The result is a number from -1 to 1, where -1 means they're opposite, 0 means they're perpendicular, and 1 means they're exactly the same. A threshold of 0.95 or so ought to do.
Example:
Hope that helps.
MDave: To do the "slowing down during a turn" thing, simply keep track of your last orientation and watch for differences:
*If you track angles, you can do an angle comparison to see if you've turned more than a certain threshold and slow yourself down.
*If you track a direction instead of angles you can do a dot product (which is easier than angle compare imo) by multiplying the current direction and the old direction (make sure both are normalized). The result is a number from -1 to 1, where -1 means they're opposite, 0 means they're perpendicular, and 1 means they're exactly the same. A threshold of 0.95 or so ought to do.
Example:
- Code: Select all
// check if I'm turning
dot = self.mangle * self.v_angle;
if(dot < 0.95) // if I've turned too much
{
// slow me down
}
// track last angle
self.mangle = self.v_angle;
Hope that helps.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
- Wazat
- Posts: 771
- Joined: Fri Oct 15, 2004 9:50 pm
- Location: Middle 'o the desert, USA
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: Bing [Bot] and 1 guest
