How avoid to excced max num of particles?

Blitz3D Forums/Blitz3D Programming/How avoid to excced max num of particles?

Pinete(Posted 2005) [#1]
Hi all,
I'm a registered user of Particle Candy,
trying to email to the author without success,
I need help with the next issue.

I have a world in which there are a lot of explosions
(imagine a bomb explosion).

In order to make the trials I have defined a key
to launch an explosion.

The method is simple: I create a new emitter each time
I press the 'explosion key'

The problem comes when, some time ago, after launched
some explosions (twenty, maybe, but not all simultaneosly),
the lib error comes "Max number of particles exceded, please, increase the ptnumparticles" (or something similar).

The problem is that even changing this number, the problem
will come, sooner or later, because if the number
pt_numparticles is just growing each time I create a new
emitter, changing that number the most I do is postpose
the error...

Sumarizing:

How could I put a lot of different explosions without
experiment this error?

Thanks in advance!


Shambler(Posted 2005) [#2]
Are you sure it is 'Max number of particles'?

I can't find this error in the particle candy file but there is a 'Max number of particle types' error, you are probably getting this.

What you are probably doing is creating new particle types for every bomb you make e.g. flame type, smoke type etc.

You only need to create the particle types once, not for every bomb.


Pinete(Posted 2005) [#3]
Thanks,
Yes, you are right, the error is referred to the
number of 'types' of particle.

I don't know how to avoid that.

If I don't create an emmiter for each bomb, how
should I do that?

The target is to have various explosions in secreen simultaneously.

I have tried somethings using "CopyParticleType"
(I don't know exactly if this has so much to do with the solution), without any success...

Could you please help pointing me in the right direction???

Thanks in advance.


Shambler(Posted 2005) [#4]
OK, here is a simple demo.



The key is to create an emitter for every bomb but do not create individual particles types for each bomb.

You only create the particle types once and then each emitter uses the same ones.


Pinete(Posted 2005) [#5]
Thank you very much Shambler!

Sincerely, a lot of thanks for your help and your concern!
you rocks!
I've run your code and works perfectly! that's the stuff
I want to do!
Again, thank you very much for all.

Best regards,