i3670
Posting Freak
Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation:
36
ParticleSystem not disappearing
I have this little problem in my "Insanity Event"-thingy. When you enter an area alot of particle system become active and a chase moment occurs. It's just that if the person dies the particlesystems are still active ruining the entire thing.
SCRIPT:
Spoiler below!
void OnStart()
{
AddEntityCollideCallback("Player", "Trigger_Area_1", "Event_trigger1", false, 0);
SetEntityPlayerInteractCallback("diary_paper01_1", "Interact1", true);
}
void Interact1(string &in asEntity)
{
SetEntityActive("Trigger_Area_1", true);
CheckPoint ("One", "PlayerStartArea_2", "Reset_1", "", "");
}
void Event_trigger1(string &in asParent , string &in asChild , int alState)
{
AddTimer("Explo1", 3.0f, "Guardian_Spawn");
AddTimer("Explo2", 5.0f, "Guardian_Spawn");
AddTimer("Explo3", 10.0f, "Guardian_Spawn");
AddTimer("Explo4", 14.0f, "Guardian_Spawn");
AddTimer("Explo5", 18.0f, "Guardian_Spawn");
AddTimer("Explo6", 22.0f, "Guardian_Spawn");
}
void Guardian_Spawn(string &in asTimer)
{
if(asTimer == "Explo1"){
CreateParticleSystemAtEntity("", "ps_acid_web_dissolve.ps", "Particle_area_1", false);
PlaySoundAtEntity("", "guardian_distant.snt", "Death_Area_3", 1, false);
FadeSepiaColorTo(2.0f, 6.0f);
SetMessage("Descriptions", "Hint_4", 3.0f);
}
if(asTimer == "Explo2"){
PlayMusic("14_elevator_falls.ogg", true, 4.0f, 0, 0, true);
PlaySoundAtEntity("", ".snt", "", 1, false);
SetEntityActive("Death_Area_1", true);
SetEntityActive("Trigger_Area_1", false);
CreateParticleSystemAtEntity("ps1", "ps_guardian_appear_explosion.ps", "Explosion_Area_1", false);
CreateParticleSystemAtEntity("ps2", "ps_guardian_appear_explosion.ps", "Explosion_Area_2", false);
CreateParticleSystemAtEntity("ps3", "ps_guardian_appear_explosion.ps", "Explosion_Area_4", false);
}
if(asTimer == "Explo3"){
PlaySoundAtEntity("", ".snt", "", 1, false);
SetEntityActive("Death_Area_2", true);
CreateParticleSystemAtEntity("ps4", "ps_guardian_danger_fog_loop.ps", "Particle_area_1", false);
CreateParticleSystemAtEntity("ps5", "ps_guardian_danger_fog_loop.ps", "Particle_area_2", false);
CreateParticleSystemAtEntity("ps6", "ps_guardian_danger_fog_loop.ps", "Particle_area_3", false);
CreateParticleSystemAtEntity("ps7", "ps_guardian_appear_explosion.ps", "Explosion_Area_3", false);
CreateParticleSystemAtEntity("ps8", "ps_guardian_appear_explosion.ps", "Explosion_Area_5", false);
CreateParticleSystemAtEntity("ps9", "ps_guardian_appear_explosion.ps", "Explosion_Area_9", false);
}
if(asTimer == "Explo4"){
PlaySoundAtEntity("", ".snt", "", 1, false);
SetEntityActive("Death_Area_3", true);
CreateParticleSystemAtEntity("ps10", "ps_guardian_danger_fog_loop.ps", "Particle_area_4", false);
CreateParticleSystemAtEntity("ps11", "ps_guardian_danger_fog_loop.ps", "Particle_area_5", false);
CreateParticleSystemAtEntity("ps12", "ps_guardian_appear_explosion.ps", "Explosion_Area_6", false);
CreateParticleSystemAtEntity("ps13", "ps_guardian_appear_explosion.ps", "Explosion_Area_7", false);
CreateParticleSystemAtEntity("ps14", "ps_guardian_appear_explosion.ps", "Explosion_Area_8", false);
}
if(asTimer == "Explo5"){
PlaySoundAtEntity("", ".snt", "", 1, false);
SetEntityActive("Death_Area_4", true);
CreateParticleSystemAtEntity("ps15", "ps_guardian_danger_fog_loop.ps", "Particle_area_6", false);
CreateParticleSystemAtEntity("ps16", "ps_guardian_danger_fog_loop.ps", "Particle_area_7", false);
CreateParticleSystemAtEntity("ps17", "ps_guardian_appear_explosion.ps", "Explosion_Area_11", false);
CreateParticleSystemAtEntity("ps18", "ps_guardian_appear_explosion.ps", "Explosion_Area_12", false);
}
if(asTimer == "Explo6"){
PlaySoundAtEntity("", ".snt", "", 1, false);
SetEntityActive("Death_Area_5", true);
CreateParticleSystemAtEntity("ps19", "ps_guardian_appear_explosion.ps", "Explosion_Area_10", false);
CreateParticleSystemAtEntity("ps20", "ps_guardian_danger_fog_loop.ps", "Particle_area_8", false);
}
}
void Reset_1(string &in asName, int alCount)
{
ResetProp("Trigger_Area_1");
ResetProp("Death_Area_1");
ResetProp("Death_Area_2");
ResetProp("Death_Area_3");
ResetProp("Death_Area_4");
ResetProp("Death_Area_5");
SetEntityActive("Trigger_Area_1", true);
DestroyParticleSystem("ps1");
DestroyParticleSystem("ps2");
DestroyParticleSystem("ps3");
DestroyParticleSystem("ps4");
DestroyParticleSystem("ps5");
DestroyParticleSystem("ps6");
DestroyParticleSystem("ps7");
DestroyParticleSystem("ps8");
DestroyParticleSystem("ps9");
DestroyParticleSystem("ps10");
DestroyParticleSystem("ps11");
DestroyParticleSystem("ps12");
DestroyParticleSystem("ps13");
DestroyParticleSystem("ps14");
DestroyParticleSystem("ps15");
DestroyParticleSystem("ps16");
DestroyParticleSystem("ps17");
DestroyParticleSystem("ps18");
DestroyParticleSystem("ps19");
DestroyParticleSystem("ps20");
}
(This post was last modified: 05-10-2012, 04:08 PM by i3670 .)
05-10-2012, 12:41 PM
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
RE: ParticleSystem not disappearing
You should have received a syntax error with that code.
It's not going to have a chance of working until you give that last code block a function header (i'm guessing it's supposed to have the same syntax as a checkpoint callback).
05-10-2012, 01:18 PM
i3670
Posting Freak
Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation:
36
RE: ParticleSystem not disappearing
Ye forgot to put the syntax. Edited the post.
05-10-2012, 04:08 PM
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
RE: ParticleSystem not disappearing
I'm going to say the culprit is the 0 and possibly even the false for the AddEntityCollideCallback in OnStart.
05-10-2012, 04:36 PM
i3670
Posting Freak
Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation:
36
RE: ParticleSystem not disappearing
So it should be:
AddEntityCollideCallback("Player", "Trigger_Area_1", "Event_trigger1", true, 1);
?
Tested it out but didn't seem to work. Also when I die I spawn in a really weird position and I can't move.
(This post was last modified: 05-10-2012, 05:23 PM by i3670 .)
05-10-2012, 04:40 PM
i3670
Posting Freak
Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation:
36
RE: ParticleSystem not disappearing
Anyone know how to solve it? Cuz I don't.
05-13-2012, 12:17 AM
Homicide13
Senior Member
Posts: 323
Threads: 41
Joined: Nov 2010
Reputation:
14
RE: ParticleSystem not disappearing
EDIT: Hurp, I'm good at reading.
I dunno, it should work.
The problem you're having is that the DestroyParticleSystem(string& asParticleSystem) isn't working?
Have you considered putting a debug message in your Reset_1 function to make 100% sure it works?
(This post was last modified: 05-13-2012, 02:32 AM by Homicide13 .)
05-13-2012, 02:25 AM
i3670
Posting Freak
Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation:
36
RE: ParticleSystem not disappearing
Yes, when I die and get teleported to the checkpoint, the particlesystems are still active. So that's the problem and for some reason when I die I get revived in a really weird position and can't move.
As for the AddDebugMessage, I don't know how it works.
05-13-2012, 11:13 AM