View Single Post
Nomexous
Member
Join Date: Oct 2007
Old 09-15-2008 , 23:48   Re: Nade Modes (Nomexous) v6.0b
Reply With Quote #103

Wow. My baby has really grow up. I glanced at the code, and I have to say, ot_207, good job being able to read my code. I'm especially impressed that you figured out how to do the menus. I'm officially passing the torch on to you, and you deserve it.

Now, let me make one more contribution. I have two new, unreleased grenade modes. One is a homing mode, and the other is a rocket mode. I've attached the source code (still labeled version 3.1) so you can see how to implement them.

In homing mode, I detect when a player throws a grenade. Using TraceToss, I calculate where the grenade will land. Then, I use FindEntityInSphere to select the closest target. Each "think," the grenade will check if the target is in line of sight. If it is, it will seek the target. So, if you know there might be someone around the corner, don't bother bouncing the grenade. Just lob it, and it will curve around to the target once it reaches the corner.

ot_207, you might want to change the seek strength. It's a bit strong right now.

Rocket mode is supposed to be used in open areas. Again, I detect when a player throws the rocket grenade. Using TraceToss, I calculate where it will land, and store the location. Each "think" I check to see whether or not the grenade is falling or not by checking the sinage of the velocity in the Z-axis. If it's negative, meaning its passed the apogee of its flight, it'll shoot in a straight path at very high speed towards the location previously stored. This means the grenade should hit the same spot that it would if it were just a regular grenade.

As soon as the grenade is propelled, it is changed to an impact grenade. Unfortunately, because the velocity is a magnitude of 3000, it'll actually bounce off the target and get a good distance away before it explodes. This has to do with the time between thinks. It's pretty scary, though. ot_207, you might want to dress the rocket grenades up a little, too. Change the angles so the grenade's pointing towards the target, and draw a sprite and play a sound to make it look and sound like a rocket igniting.

Well, there you go! I'll return once in a while to check out the improvements you make to this. I'm busy with college, but who knows, I might return to the world of AMXX. Have fun!

PS. Will you take over Weapon Physics and Lie Flat too? Weapon Physics really needs some love and attention.
Attached Files
File Type: sma Get Plugin or Get Source (grenademodes.sma - 1319 views - 30.5 KB)

Last edited by Nomexous; 09-15-2008 at 23:55.
Nomexous is offline