Clearing Particle Candy Particles

Blitz3D Forums/Blitz3D Programming/Clearing Particle Candy Particles

Gabriel(Posted 2004) [#1]
I occasionally need to destroy every active Particle Candy Particle. When I do, I call a function which does this :


Function Clear_All_Particles()

   DebugLog "CLEARING PARTICLES"
   ClearParticles()
   UpdateParticles()

End Function



Now weird thing.. sometimes it works, sometimes it doesn't. Sometimes everything clears and is perfect. Sometimes I get a bunch of static particles ( because I stop updating them.. they're not supposed to be there. )

Any ideas?


Beaker(Posted 2004) [#2]
That should do it. Bug with Particle Candy maybe?


Rob(Posted 2004) [#3]
Try emailing the author if something's up because I'm a registered user too but I haven't got around to using it yet in my project.


Gabriel(Posted 2004) [#4]
Thanks guys, thought I was doing it right. I've emailed the author to see what he thinks.


Gabriel(Posted 2004) [#5]
Anyone else have this issue or see any potential solutions? I've emailed the author, but no reply in a week.


Rob(Posted 2004) [#6]
Did you manage to resolve your problem?


Gabriel(Posted 2004) [#7]
Possibly. I left it after emailing the author, because I figured he'd be able to find the problem a lot quicker than I would.

I've gone back to it today, and made a couple of changes. It's working at the moment, but since the bug was random, I can't be 100% sure it's solved.

Function Clear_All_Particles()

	DebugLog "CLEARING PARTICLES"
	Emitters_Stop()
	ClearParticles()
	UpdateParticles()
		
	; NEW ADDITION
		
	ClearSurface PTSurf(0)
	ClearSurface PTSurf(1)

	; / NEW ADDITION
		
End Function