Inside3D!
     

Tutorial request: Guided Missiles (MGS style).

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
MDave



Joined: 17 Dec 2007
Posts: 75

PostPosted: Mon Jun 02, 2008 6:30 pm    Post subject: Tutorial request: Guided Missiles (MGS style). Reply with quote

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 Smile

I think it would be a pretty fun weapon Very Happy

- Thanks for reading.
Back to top
View user's profile Send private message
Orion



Joined: 12 Jan 2007
Posts: 414
Location: Brazil

PostPosted: Tue Jun 03, 2008 5:20 pm    Post subject: Reply with quote

ftp.gamers.org/pub/idgames2/quakec/weapons/guidemis.zip

It's a mod from another guy, qc files are included, you can give'em a read! Wink

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...
_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
xaGe



Joined: 01 Mar 2006
Posts: 329
Location: Upstate, New York

PostPosted: Tue Jun 03, 2008 6:52 pm    Post subject: Reply with quote

ftp://archives.gamers.org/pub/idgames2/quakec/weapons/guidemis.txt
ftp://archives.gamers.org/pub/idgames2/quakec/weapons/guidemis.zip
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
MDave



Joined: 17 Dec 2007
Posts: 75

PostPosted: Tue Jun 03, 2008 7:54 pm    Post subject: Reply with quote

Thanks a bunch! I promise I'll show the fruits of my labour after I've finished a demo up Smile
Back to top
View user's profile Send private message
Wazat



Joined: 15 Oct 2004
Posts: 732
Location: Middle 'o the desert, USA

PostPosted: Wed Jun 04, 2008 5:25 pm    Post subject: Reply with quote

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:

Code:

// 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.
Back to top
View user's profile Send private message MSN Messenger
MDave



Joined: 17 Dec 2007
Posts: 75

PostPosted: Fri Jun 06, 2008 12:27 pm    Post subject: Reply with quote

Most helpful, thanks Wazat Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group