Frictional Games Forum (read-only)

Full Version: [URGENT] Destroying Particle Systems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I used CreateParticleSystemAtEntity, and I want the particle system to be destroyed after its 'run its' course'. (Making a chemical-mixture puzzle, using ps_bubbles as a boiling effect) Hopefully I can fix this, I really like the bubble/boil effect! Thanks~
DestroyParticleSystem doesn't work for you?
Nope, the particle system just stays there. Here's the script:
Spoiler below!
void OnStart()
{
SetEntityPlayerInteractCallback("special_burner_1", "Fire", false);
AddUseItemCallback("", "mix_notdone_1", "special_burner_1", "Boil", true);
}
void Fire(string &in asEntity)
{
CreateParticleSystemAtEntity("", "ps_fire_lab_burner.ps", "funnel_1", false);
CreateParticleSystemAtEntity("", "ps_bubbles.ps", "funnel_2", false);
AddTimer("MakeMix", 5, "Finished");
}
void Boil(string &in asItem, string &in asEntity)
{
SetEntityActive("mix_notdone_static_1", true);
RemoveItem("mix_notdone_1");
}
void Finished(string &in asTimer)
{
SetEntityActive("mix_notdone_static_1", false);
SetEntityActive("mix_done_1", true);
DestroyParticleSystem("ps_bubbles");
}

void OnEnter()
{

}

void OnLeave()
{

}



ps_bubbles is what I'm trying to destroy.
You didn't give the particle systems a name. DestroyParticleSystem is not based on filename, it's based on the first argument of CreateParticleSystemAtEntity.
Both particle systems I used to CreateParticleSystemOnEntity do not exist in the Level Editor, so I don't how I'd name them..
I actually used my 'Bible' to do this, lol. I think my brain is dead or something, I'm not understanding what you're saying.
Like I said ps_bubbles is obviously the internal name, and I didn't place ANY particle systems in the Level Editor because you can't set them inactive, that's why I used CreateParticleSystemAtEntity, so it would appear instead of be there when I loaded the map.
Let's look at your CreateParticleSystemAtEntity functions:

Code:
CreateParticleSystemAtEntity("", "ps_fire_lab_burner.ps", "funnel_1", false);
CreateParticleSystemAtEntity("", "ps_bubbles.ps", "funnel_2", false);

Do you see the empty strings in the first parameters? That means you didn't provide an internal name to your particles for DestroyParticleSystem to reference against. That means DestroyParticleSystem won't be able to find your particles when passing "ps_bubbles" to it. That first parameter for CreateParticleSystemAtEntity is very important when it comes to using DestroyParticleSystem.
..OHHH. Psh, I totally knew that. (Not really)
It works now, thank you! : D