Inside3D!
     

Wazat makes cluster grenades

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Wazat



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

PostPosted: Sat Sep 13, 2008 7:05 am    Post subject: Wazat makes cluster grenades Reply with quote

Seeing as how I was thoroughly disappointed with the cluster grenades in Dissolution of Eternity (mission pack 2), I decided to create some from scratch so we'd have cluster grenades that work. This normal-quake mod (you don't need the expansion pack) shows how I would have done it. The only thing I stole from DoE is the grenade model.

download here.

Basically, I fixed the problem with hitting an enemy directly with the main grenade. You couldn't ever really make good use of cluster grenades because monsters (and players) are too hard to lead into the trap, and if you accidentally hit them with it directly it explodes for much less damage.

My solution:

If the grenade doesn't hit anything but walls, it splits on a timer as normal.

If you hit a target, the cluster grenade still splits, but the mini-nades don't immediately explode on the target. They fall to the ground and then explode. The resulting effect is perfect, in that it carpets the area with explosions and slaughters everything in the area.

Now THAT'S a cluster grenade. Very Happy

Funny that this is what finally got me to make another mod. lol!
_________________
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
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Sat Sep 13, 2008 2:15 pm    Post subject: Reply with quote

I just get away with bouncing off the enemy and just setting off on the floor anyway
Cluster grenades were one of my favorite grenade type guns to code lol
Back to top
View user's profile Send private message
Lardarse



Joined: 05 Nov 2005
Posts: 243
Location: Bristol, UK

PostPosted: Mon Sep 15, 2008 1:49 am    Post subject: Reply with quote

I'm not sure if grenades call their touch function when they hit world (I presume they do), but I think that the minis should explode as soon as they touch anything. I'm not sure what exactly your code is doing, but it looks like it could be simplified...

I have a related wuestion: When something with MOVETYPE_BOUNCE is in its touch function, has its velocity already been changed?
Back to top
View user's profile Send private message
Wazat



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

PostPosted: Mon Sep 15, 2008 7:52 pm    Post subject: Reply with quote

Lardarse wrote:
I'm not sure if grenades call their touch function when they hit world (I presume they do), but I think that the minis should explode as soon as they touch anything. I'm not sure what exactly your code is doing, but it looks like it could be simplified...


That could be, but I really like how I got it working and it's basically exactly how I had it planned. It might be overly complex, but I think with the goal I had in mind it gets the job done perfectly. Very Happy

Lardarse wrote:
I have a related wuestion: When something with MOVETYPE_BOUNCE is in its touch function, has its velocity already been changed?

Good wuestion. Smile Unfortunately no, the object's velocity has not changed yet for bouncing off of the impacted surface. To make ricochet nails that split into multiple nails with each hit, for example, you have to set the original nail's think to the next frame after the touch so that you can spawn the new nails traveling in the reflected direction away from the wall.

At least, that's how it works if I'm remembering it right. That might have even changed with engine versions. Very Happy

The other major problem with ricochet nails etc is that they love to stick to the floor, but that's another issue entirely. Very Happy
_________________
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
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Mon Sep 15, 2008 8:54 pm    Post subject: Reply with quote

Easily fixed by just tracelining the movement of the nail yourself Razz
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
Dr. Shadowborg
Inside3D Staff


Joined: 16 Oct 2004
Posts: 726

PostPosted: Mon Sep 15, 2008 10:23 pm    Post subject: Reply with quote

Urre wrote:
Easily fixed by just tracelining the movement of the nail yourself Razz


Or you can just use this thing that I've had lying around Razz :

Code:

// Returns a rebound vector off of a wall.  Quite useful for richoceting stuff.
vector(vector org, vector dir, float justnorm) ReboVec =
{
 local vector spot1, spot2;
 local vector olddir;
 local vector result;

if(justnorm)
 {
  traceline(org, org + dir*10, FALSE, self);
  result = trace_plane_normal;
  return result;
 }

 olddir = normalize(dir);

 spot1 = org - (16*dir);
 spot2 = org + (16*dir);
 traceline(spot1, spot2, FALSE, self);
 result = olddir-(trace_plane_normal*(trace_plane_normal*olddir)*2);
 result = normalize(result);
 self.origin = trace_endpos;
 return result;
};

_________________
"Roboto suggests Plasma Bazooka."
Back to top
View user's profile Send private message
frag.machine



Joined: 25 Nov 2006
Posts: 728

PostPosted: Mon Sep 15, 2008 10:32 pm    Post subject: Reply with quote

Or you can just use this thing that I've had lying around Razz :

Code:
// Returns a rebound vector off of a wall.  Quite useful for richoceting stuff.
vector(vector org, vector dir, float justnorm) ReboVec



/me steals your code and gives an evil laugh Smile
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
Wazat



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

PostPosted: Mon Sep 15, 2008 11:51 pm    Post subject: Reply with quote

Cool, that'd be really nice for reflecting lightning
_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Discussion 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