Hey,
I am trying to create a rain splash effect that would splat sprites with a raindrop impact texture at random positions… the way I’m trying to make it is to create a new surface type, so I can place brushes around the map on surfaces that would be affected, and then a line is traced from the ceiling to the ground. XY coordinates of the vector points would be player position + a random value. If the line hits a surface with the new flag (I have named it SURF_SPLASH on my experiments) then a polygon is drawn on the point where that event happens. The question is, how is this accomplished? First, how do I tell the game where did the line collide with the surface? And secondly… How can I make that new surface flag? I’ve tried defining a new flag SURF_SPLASH on surfaceflags.h and then using surfaceparms splash on a new shader script, but it ain’t working. What am I doing wrong? help would be appreciated
Just in case, here’s the code that is supposed to trace the lines and all:
void CG_DrawRainMarks (void)
{
vec3_t start, end;
trace_t tr;
start[0] = cg.refdef.vieworg[0] + random() * 1000;
start[1] = cg.refdef.vieworg[1] + random() * 1000;
start[2] = cg.refdef.vieworg[2] + 18000;
end[0] = start[0];
end[1] = start[1];
end[2] = start[2] - 32000;
CG_Trace( &tr, start, NULL, NULL, end, ENTITYNUM_NONE, MASK_SOLID|MASK_WATER ); // Trace a line trying to impact a surface with the splash flag
if( tr.surfaceFlags & SURF_SPLASH )
{
CG_Printf ("DEBUG: Draw rain splash code should now be executed."); // I still have to learn how to draw a polygon starting from this point, I would also appreaciate some help on this :smile:
}
}