Rain splashes
Jump to navigation
Jump to search
Source Code
By default the rain splashes done in c_effects.cpp in the Simulate Rain function take place randomly, and more importantly only on water. This snippet will allow the rain to work on all surfaces, and also allows for a custom Rain Splash Particle Effect.
NOTE: PLEASE REPLACE XXX'S WITH YOUR PARTICLE SYSTEM
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() < 20 ) { 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 ); } } }