View previous topic :: View next topic |
Author |
Message |
Wazat
Joined: 15 Oct 2004 Posts: 732 Location: Middle 'o the desert, USA
|
Posted: Sat Sep 13, 2008 7:05 am Post subject: Wazat makes cluster grenades |
|
|
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.
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 |
|
 |
leileilol

Joined: 15 Oct 2004 Posts: 1321
|
Posted: Sat Sep 13, 2008 2:15 pm Post subject: |
|
|
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 |
|
 |
Lardarse

Joined: 05 Nov 2005 Posts: 243 Location: Bristol, UK
|
Posted: Mon Sep 15, 2008 1:49 am Post subject: |
|
|
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 |
|
 |
Wazat
Joined: 15 Oct 2004 Posts: 732 Location: Middle 'o the desert, USA
|
Posted: Mon Sep 15, 2008 7:52 pm Post subject: |
|
|
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.
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.
The other major problem with ricochet nails etc is that they love to stick to the floor, but that's another issue entirely.  _________________ 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 |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Mon Sep 15, 2008 8:54 pm Post subject: |
|
|
Easily fixed by just tracelining the movement of the nail yourself  _________________ Look out for Twigboy |
|
Back to top |
|
 |
Dr. Shadowborg Inside3D Staff

Joined: 16 Oct 2004 Posts: 726
|
Posted: Mon Sep 15, 2008 10:23 pm Post subject: |
|
|
Urre wrote: | Easily fixed by just tracelining the movement of the nail yourself  |
Or you can just use this thing that I've had lying around :
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 |
|
 |
frag.machine

Joined: 25 Nov 2006 Posts: 728
|
Posted: Mon Sep 15, 2008 10:32 pm Post subject: |
|
|
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  _________________ frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/ |
|
Back to top |
|
 |
Wazat
Joined: 15 Oct 2004 Posts: 732 Location: Middle 'o the desert, USA
|
Posted: Mon Sep 15, 2008 11:51 pm Post subject: |
|
|
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 |
|
 |
|