Legacy GM Issue with particles (part_type_death)

C

comatsu

Guest
I'm having a problem with some particles - perhaps someone has a solution.

I've created a particle system and some particles for it. In one instance I have a particle which through part_time_death spawns another particle as it disappears.

Code:
part_type_death(particles_1,1,particles_2);
I am not using an emitter since I require the particles to spawn randomly around the screen, but just use part_particles_create() whenever necessary. This works perfectly well, with the particles_1 spawning and then particles_2 spawning as particles_1 disappear.

However I want particles_2 to spawn only occasionally, and not for every particle_1. I've changed the code to

Code:
part_type_death(particles_1,-4,particles_2);
And now particles_2 do not spawn anymore. No matter how many particles_1 spawn, they never create other particles on dying.

I suspect the issue might be that I am using part_particles_create() instead of using an emitter, and therefore the particles are all being spawn in a single step. Is death spawn chance not applied randomly, but calculated to spawn after a certain number of steps?, And is there no way to apply a chance to these particles to spawn the second particles?

Since I need particles to spawn at random locations, and sometimes in more than one place at the same time, I think using an emitter would create further problems instead of solving them.
 

obscene

Member
This IMO is a bug... I think I've ran into this before and just worked around it wthout dealing with it. (Shame on me). But to work around you could run something like this every time you create a particle.

if !irandom(4) (part_type_death(particles_1,1,particles_2);
else part_type_death(particles_1,0,particles_2);
part_particles_create(etc...);

Not tested so really don't know if that would work or not as it may affect all particles instead of the one you are creating.
 
Last edited:
C

comatsu

Guest
Guess that is a way to deal with it :)
Anyone in the know whether this is normal behaviour or if I should submit a bug report?
 

Yal

šŸ§ *penguin noises*
GMC Elder
The manual states negative numbers mean a 1-divided-by-that-number-chance, so it is a bug and should be reported.
 
Top