Problems with ParticleCandy 1.5.2

Blitz3D Forums/Blitz3D Programming/Problems with ParticleCandy 1.5.2

GfK(Posted 2005) [#1]
Anyone else use this? I'm getting occasional "entity does not exist" errors in the FreeParticleSystem() function - seems to be on the line 'FreeEntity PTDummy'.

The readme for this version says this problem is fixed so presumably it existed in a previous version as well.

Anybody else?

Do x-pressive have a forum somewhere I can go to? All I found on their site was 4 german chatrooms, all empty.

My game is due to be finished in 11 days time. Bloody middleware. I'm well chuffed. :/


fall_x(Posted 2005) [#2]
I found another bug a while back - if you free an emitter that still has some particles flying around (even if you stop it, it can have left-over particles), it crashes.
I tried solvig that myself by first deleting the particles in the function that frees the emitter, but occasionally I got an error, also with PTDummy I believe.
I mailed the author, and he said he would look into it. Maybe you should mail him about this too.


GfK(Posted 2005) [#3]
Maybe you should mail him about this too.
Already did, but like I said.... 11 days to go... :/


fall_x(Posted 2005) [#4]
Do you need to use freeparticlesystem? maybe you should try stopping all emitters, then use clearparticles(), and then free all emitters?


danjo(Posted 2005) [#5]
i use it, and havent struck those problems. at the moment im working on modelling, but when i get back to the engine code, im hoping all goes smoothly.


MadJack(Posted 2005) [#6]
GFK

I had the same prob (free_emitter crashing if the emitter still had active particles).

However, I tracked it down to only those emitters that had a circular rotation parameter.

I did email Ben with some sample code demonstrating this, but he couldn't get the same error to occur on his system.


fall_x(Posted 2005) [#7]
You're right, I modified the fountain demo with this in the main loop :

if keyhit(14) then
	freeemitter(em)
	flushkeys()
end if
but it didn't crash when I pressed backspace, then I modified all particle types to have circular motion, and it did crash. I sent this file to the author, hopefully he'll be able to trace the problem now.


GfK(Posted 2005) [#8]
[edit] see below.


MadJack(Posted 2005) [#9]
GFK/fall_x

What OS are you running?

I'm on W2000.


fall_x(Posted 2005) [#10]
XP here.

GFK : did you try my suggestion above, or is it not an option? (clearing all particles and then deleting the emitters manually).


MadJack(Posted 2005) [#11]
fall_x

But you may not want to clear all emitters.

An explosion for example - expanding sphere to give the impression of a shockwave + PCandy emitter. When the sphere is a certain size, the attached emitter is deleted, and then the sphere entity is freed - explosion over.


fall_x(Posted 2005) [#12]
Yes, but in his case, he has the error when doing FreeParticleSystem(), so I assume he does want to clear all emiters.


Ross C(Posted 2005) [#13]
Rolling back your version seems to work... to 1.4.x


GfK(Posted 2005) [#14]
Hmmm... seems you were right after all about the circular motion thing.

I used CandyFactory to import emitter/particle date from an Include. It seems that I *was* using a circularmotion setting of "1" after all. Changed that to 0, problem solved.

This still needs fixing though. Thx for the help.


fall_x(Posted 2005) [#15]
This is the fix I made for it :

; replace freeemitter by this :
Function FreeEmitter (Piv%)
    Emitter_Stop Piv
 
    For Particle.TParticle = Each TParticle
        If Particle\Piv = Piv Then
            If GetParent(PTDummyPiv) = Particle\Piv Then
                EntityParent PTDummyPiv,0,0
            End If
            Delete Particle
        End If
    Next
 
    Emitter.TEmitter = Object.TEmitter(EntityName(Piv))
    FreeEntity Emitter\Piv
    If Emitter\Snd > 0 FreeSound Emitter\Snd
    Delete Emitter
End Function



I'm not sure it works 100% though, but according to the author, it should. It fixes stopping emitters with circular motion - which is also called by freeparticlesystem, so it might solve the problem there as well.


fall_x(Posted 2005) [#16]
The code I posted above only fixed problems with FreeEmitter, but it didn't solve the FreeParticleSystem problems (I just implemented switching levels in my game today, and it crashed sometimes even with that code).
The good news is, I just received a private update from Mike for testing, and it seems to be fixed in this. So an update will probably be coming very soon!


GfK(Posted 2005) [#17]
The good news is, I just received a private update from Mike for testing, and it seems to be fixed in this. So an update will probably be coming very soon!
Yup, I got that too. Seems fine now.