Quake3World.com
https://www.quake3world.com/forum/

Making a projectile pass through glass yet leaving a mark
https://www.quake3world.com/forum/viewtopic.php?f=16&t=50311
Page 1 of 1

Author:  Captaintoottoot [ 06-10-2014 08:52 AM ]
Post subject:  Making a projectile pass through glass yet leaving a mark

The goal is to get a projectile to pass through a nonsolid glass material on a plane or brush, yet leave a mark on it. A couple months ago I dabbled with getting a projectile to pass through a wall and leave a mark, and it was never totally successful. I figured I'd try this again but with only glass, that it should be easier somehow, yet it isn't. Right under where the game does the trace in g_runrocket or whatever, I added:

if ( tr.surfaceFlags & SURF_METAL ) {
G_AddEvent( ent, EV_MISSILE_MISS_GLASS, DirToByte( tr.plane.normal ) );
G_Printf( "work dammmit \n");
}

this is right above the part:
if ( tr.startsolid || tr.allsolid ) {

The idea is if the surface the trace touched is metal (yes surf_metal for now because of problems with adding new surfs), then add the event mostly for the CG effects to occur. In game this does nothing on either a brush or a plane with the glass texture. So back to the question: how would you get the game to detect the type of surface the projectile touched, and how would you tell it to place a mark on that surface while allowing the projectile to continue through it?

Author:  Eraser [ 06-10-2014 10:01 PM ]
Post subject:  Re: Making a projectile pass through glass yet leaving a mark

Isn't this just like a rocket leaving a mark on a wall when it explodes except for that it doesn't explode?

Author:  Captaintoottoot [ 06-11-2014 05:22 PM ]
Post subject:  Re: Making a projectile pass through glass yet leaving a mark

Yeah I guess that's another way of putting it. It just has to be surface flag specific and as it is it's like it completely disregards the surface type check. I wasn't sure about how to approach this one since my past attempts failed.

The other problem is that the surfaces I'm using are planes the game just ignores any type of collision with planes.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/