Rain splashes
Source Code
By default the rain splashes done in c_effects.cpp in the Simulate Rain function take place 20% of the time, and more importantly, only on water. This snippet will allow the rain to work on almost all surfaces, including static props, and also allows for a custom rain splash particle effect.
First, replace line 36 in c_effects.cpp with the following code.
ConVar r_RainSplashPercentage( "r_RainSplashPercentage", "99", FCVAR_CHEAT ); // N% chance of a rain particle making a splash.
NOTE: PLEASE REPLACE XXX'S WITH YOUR PARTICLE SYSTEM
Now, simply replace the "if" function at line 331 in c_effects.cpp, in the Temporary Entites section of the client code, with the following code.
if ( m_Splashes.Count() < 99 ) { if ( RandomInt( 0, 100 ) < r_RainSplashPercentage.GetInt() ) { trace_t trace; UTIL_TraceLine(vOldPos, pParticle->m_Pos, MASK_ALL, NULL, COLLISION_GROUP_NPC, &trace); if( trace.fraction < 1 ) { DispatchParticleEffect( "XXXX", trace.endpos, trace.m_pEnt->GetAbsAngles() , NULL ); } } }
Particle Setup
The only specifications needed for your splash particle are that it be precached (See Particles_manifest.txt), and that it has "Constrain distance between control points" in the Constraints section of your particle.
Issues
Currently this does not work on glass or displacement surfaces; looking for a way to fix this. Splashes will no longer appear on water.