diff --git a/assets/particles/cs2fixes/simple_overlay.vpcf_c b/assets/particles/cs2fixes/simple_overlay.vpcf_c index 61df58320..d22017015 100644 Binary files a/assets/particles/cs2fixes/simple_overlay.vpcf_c and b/assets/particles/cs2fixes/simple_overlay.vpcf_c differ diff --git a/assets_source/particles/cs2fixes/simple_overlay.vpcf b/assets_source/particles/cs2fixes/simple_overlay.vpcf index 09c7ee619..1e8273f81 100644 --- a/assets_source/particles/cs2fixes/simple_overlay.vpcf +++ b/assets_source/particles/cs2fixes/simple_overlay.vpcf @@ -4,8 +4,8 @@ m_nBehaviorVersion = 12 m_nMaxParticles = 1 m_bInfiniteBounds = true - m_bScreenSpaceEffect = true m_flConstantRadius = 100.0 + m_bScreenSpaceEffect = true m_controlPointConfigurations = [ { @@ -195,6 +195,71 @@ } } }, + { + _class = "C_INIT_InitFloat" + m_InputValue = + { + m_nType = "PF_TYPE_CONTROL_POINT_COMPONENT" + m_nMapType = "PF_MAP_TYPE_DIRECT" + m_flLiteralValue = 0.0 + m_NamedValue = "" + m_nControlPoint = 17 + m_nScalarAttribute = 3 + m_nVectorAttribute = 6 + m_nVectorComponent = 2 + m_flRandomMin = 0.0 + m_flRandomMax = 1.0 + m_bHasRandomSignFlip = false + m_nRandomSeed = -1 + m_nRandomMode = "PF_RANDOM_MODE_CONSTANT" + m_flLOD0 = 0.0 + m_flLOD1 = 0.0 + m_flLOD2 = 0.0 + m_flLOD3 = 0.0 + m_nNoiseInputVectorAttribute = 0 + m_flNoiseOutputMin = 0.0 + m_flNoiseOutputMax = 1.0 + m_flNoiseScale = 0.1 + m_vecNoiseOffsetRate = [ 0.0, 0.0, 0.0 ] + m_flNoiseOffset = 0.0 + m_nNoiseOctaves = 1 + m_nNoiseTurbulence = "PF_NOISE_TURB_NONE" + m_nNoiseType = "PF_NOISE_TYPE_PERLIN" + m_nNoiseModifier = "PF_NOISE_MODIFIER_NONE" + m_flNoiseTurbulenceScale = 1.0 + m_flNoiseTurbulenceMix = 0.5 + m_flNoiseImgPreviewScale = 1.0 + m_bNoiseImgPreviewLive = true + m_flNoCameraFallback = 0.0 + m_bUseBoundsCenter = false + m_nInputMode = "PF_INPUT_MODE_CLAMPED" + m_flMultFactor = 1.0 + m_flInput0 = 0.0 + m_flInput1 = 1.0 + m_flOutput0 = 0.0 + m_flOutput1 = 1.0 + m_flNotchedRangeMin = 0.0 + m_flNotchedRangeMax = 1.0 + m_flNotchedOutputOutside = 0.0 + m_flNotchedOutputInside = 1.0 + m_nBiasType = "PF_BIAS_TYPE_STANDARD" + m_flBiasParameter = 0.0 + m_Curve = + { + m_spline = [ ] + m_tangents = [ ] + m_vDomainMins = [ 0.0, 0.0 ] + m_vDomainMaxs = [ 0.0, 0.0 ] + } + } + m_nOutputField = 1 + }, + ] + m_Operators = + [ + { + _class = "C_OP_Decay" + }, ] m_Renderers = [ @@ -212,14 +277,14 @@ ] m_flSelfIllumAmount = { - m_nType = "PF_TYPE_CONTROL_POINT_COMPONENT" + m_nType = "PF_TYPE_LITERAL" m_nMapType = "PF_MAP_TYPE_DIRECT" m_flLiteralValue = 1.0 m_NamedValue = "" - m_nControlPoint = 17 + m_nControlPoint = 0 m_nScalarAttribute = 3 m_nVectorAttribute = 6 - m_nVectorComponent = 2 + m_nVectorComponent = 0 m_flRandomMin = 0.0 m_flRandomMax = 1.0 m_bHasRandomSignFlip = false diff --git a/src/zombiereborn.cpp b/src/zombiereborn.cpp index 07facb533..5a8129b6b 100644 --- a/src/zombiereborn.cpp +++ b/src/zombiereborn.cpp @@ -121,39 +121,25 @@ void ZR_Precache(IEntityResourceManifest* pResourceManifest) pResourceManifest->AddResource("soundevents/soundevents_zr.vsndevts"); } -CEnvParticleGlow* ZR_CreateOverlay(const char* pszOverlayParticlePath, float flAlpha, float flRadius, float flSelfIllum, float flLifeTime, Color clrTint, const char* pszMaterialOverride) +void ZR_CreateOverlay(const char* pszOverlayParticlePath, float flAlpha, float flRadius, float flLifeTime, Color clrTint, const char* pszMaterialOverride) { CEnvParticleGlow* particle = (CEnvParticleGlow*)CreateEntityByName("env_particle_glow"); CEntityKeyValues* pKeyValues = new CEntityKeyValues(); pKeyValues->SetString("effect_name", pszOverlayParticlePath); - pKeyValues->SetFloat("alphascale", flAlpha); - pKeyValues->SetFloat("scale", flRadius); - pKeyValues->SetFloat("selfillumscale", flSelfIllum); - pKeyValues->SetColor("colortint", clrTint); + // these properties are mapped to control point position by the entity + pKeyValues->SetFloat("alphascale", flAlpha); //17.x + pKeyValues->SetFloat("scale", flRadius); //17.y + pKeyValues->SetFloat("selfillumscale", flLifeTime); //17.z + pKeyValues->SetColor("colortint", clrTint); //16.xyz + pKeyValues->SetString("effect_textureOverride", pszMaterialOverride); particle->DispatchSpawn(pKeyValues); particle->AcceptInput("Start"); - CHandle hParticle = particle->GetHandle(); - - // destroy particle first, then kill the entity - new CTimer(flLifeTime, false, [hParticle]() - { - CEnvParticleGlow* particle = hParticle.Get(); - - //Note: for simple_overlay, if the entity is somehow killed before the particle is destroyed, it will stay on forever until the round reset, which doesn't matter in this specific use case - if (particle) - { - particle->AcceptInput("DestroyImmediately"); - UTIL_AddEntityIOEvent(particle, "Kill", nullptr, nullptr, "", 0.02f); - } - return -1.0f; - }); - - return particle; + UTIL_AddEntityIOEvent(particle, "Kill", nullptr, nullptr, "", flLifeTime + 1.0); } bool ZRClass::IsApplicableTo(CCSPlayerController *pController) @@ -1299,7 +1285,7 @@ void ZR_EndRoundAndAddTeamScore(int iTeamNum) } g_hTeamCT->m_iScore = g_hTeamCT->m_iScore() + 1; if (!g_szHumanWinOverlayParticle.empty()) - ZR_CreateOverlay(g_szHumanWinOverlayParticle.c_str(), 1.0f, g_flHumanWinOverlaySize, 1.0f, flRestartDelay, Color(255, 255, 255), g_szHumanWinOverlayMaterial.c_str()); + ZR_CreateOverlay(g_szHumanWinOverlayParticle.c_str(), 1.0f, g_flHumanWinOverlaySize, flRestartDelay, Color(255, 255, 255), g_szHumanWinOverlayMaterial.c_str()); } else if (iTeamNum == CS_TEAM_T) { @@ -1310,7 +1296,7 @@ void ZR_EndRoundAndAddTeamScore(int iTeamNum) } g_hTeamT->m_iScore = g_hTeamT->m_iScore() + 1; if (!g_szZombieWinOverlayParticle.empty()) - ZR_CreateOverlay(g_szZombieWinOverlayParticle.c_str(), 1.0f, g_flZombieWinOverlaySize, 1.0f, flRestartDelay, Color(255, 255, 255), g_szZombieWinOverlayMaterial.c_str()); + ZR_CreateOverlay(g_szZombieWinOverlayParticle.c_str(), 1.0f, g_flZombieWinOverlaySize, flRestartDelay, Color(255, 255, 255), g_szZombieWinOverlayMaterial.c_str()); } }