Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[URGENT] Destroying Particle Systems
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#1
[URGENT] Destroying Particle Systems

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~

Ba-da bing, ba-da boom.
01-01-2012, 03:04 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: [URGENT] Destroying Particle Systems

DestroyParticleSystem doesn't work for you?

Tutorials: From Noob to Pro
01-01-2012, 03:07 AM
Website Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#3
RE: [URGENT] Destroying Particle Systems

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.

Ba-da bing, ba-da boom.
01-01-2012, 03:10 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: [URGENT] Destroying Particle Systems

You didn't give the particle systems a name. DestroyParticleSystem is not based on filename, it's based on the first argument of CreateParticleSystemAtEntity.

Tutorials: From Noob to Pro
01-01-2012, 03:12 AM
Website Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#5
RE: [URGENT] Destroying Particle Systems

Both particle systems I used to CreateParticleSystemOnEntity do not exist in the Level Editor, so I don't how I'd name them..

Ba-da bing, ba-da boom.
01-01-2012, 03:14 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: [URGENT] Destroying Particle Systems

http://wiki.frictionalgames.com/hpl2/amn...le_systems

Tutorials: From Noob to Pro
01-01-2012, 03:16 AM
Website Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#7
RE: [URGENT] Destroying Particle Systems

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.

Ba-da bing, ba-da boom.
01-01-2012, 03:21 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: [URGENT] Destroying Particle Systems

Let's look at your CreateParticleSystemAtEntity functions:

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.

Tutorials: From Noob to Pro
01-01-2012, 03:27 AM
Website Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#9
RE: [URGENT] Destroying Particle Systems

..OHHH. Psh, I totally knew that. (Not really)
It works now, thank you! : D

Ba-da bing, ba-da boom.
01-01-2012, 03:30 AM
Find




Users browsing this thread: 1 Guest(s)