Forum

Wazat makes cluster grenades

Discuss anything not covered by any of the other categories.

Moderator: InsideQC Admins

Wazat makes cluster grenades

Postby Wazat » Sat Sep 13, 2008 7:05 am

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. :D

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.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Postby leileilol » Sat Sep 13, 2008 2:15 pm

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
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Lardarse » Mon Sep 15, 2008 1:49 am

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?
User avatar
Lardarse
 
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Postby Wazat » Mon Sep 15, 2008 7:52 pm

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. :D

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. :) 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. :D

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

Postby Urre » Mon Sep 15, 2008 8:54 pm

Easily fixed by just tracelining the movement of the nail yourself :P
I was once a Quake modder
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Postby Dr. Shadowborg » Mon Sep 15, 2008 10:23 pm

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


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

Code: Select all
// 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;
};
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby frag.machine » Mon Sep 15, 2008 10:32 pm

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

Code: Select all
// 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 :)
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby Wazat » Mon Sep 15, 2008 11:51 pm

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.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest