• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

[SOLVED] Particles, can't have more than one?

V

Vredniuka

Guest
Hi guys. I'm having a strange issue, probably result of me not having much experience with particle systems. According to the help, I should be able to have as many particle emitters or systems as I'd like. But I can't seem to get more than one working. For a quick test file, I created 3, and only the first that was created ever showing up in the game. If I turn off the first one in the layers, then the 2nd one shows up when I run the game. And if I turn off the 2nd one as well, the 3rd one shows up.

Here are some images and code illustrating my problem.

Here, all 3 partcile systems and emitters are on, but only the 1st one shows up.


Here I turned off the 1st one, and only 2nd shows up.




And the code I put in the object's Create event

Code:
/// @description create PartSys01 particles

//get direction



//Create particle system (this is 1st system)

PartSys01 = part_system_create();
part_system_depth(PartSys01,-100);

//Create a PartSys01 particle
bloodsplat = part_type_create()
part_type_shape (bloodsplat,pt_shape_smoke);
part_type_size(bloodsplat, 0.07, 0.15, 0, 0);
part_type_speed(bloodsplat, 4 , 7 , 0, 0);
//part_type_direction(bloodsplat, dir1, dir2, 0, 0);
part_type_gravity(bloodsplat, 0.3 , 270);
part_type_life(bloodsplat, room_speed * 0.3, room_speed * 0.5);
part_type_colour1(bloodsplat, c_red);



//create blood emitter
blood_emitter = part_emitter_create(PartSys01);
part_emitter_region(blood_emitter, PartSys01, x-5, x+5, y-5, y+5, ps_shape_ellipse, ps_distr_linear);
//part_emitter_burst(blood_emitter, PartSys01, bloodsplat, 30);
part_emitter_stream(blood_emitter, PartSys01, bloodsplat, 5);
for 2nd particle system. Pretty much the same thing, just some different variable names and no gravity.

Code:
//Create particle system 2
steam = part_system_create();
part_system_depth(steam,0);

//Create a steam particle
pipesteam = part_type_create()
part_type_shape (pipesteam,pt_shape_smoke);
part_type_size(pipesteam, 0.1, 0.5, 0.01, 0);
part_type_alpha2(pipesteam, 1, 0);
part_type_speed(pipesteam, 4, 7, 0, 0);
part_type_direction(pipesteam, 90, 90, 0, 0);
//part_type_gravity(pipesteam, 0.3, 270);
part_type_life(pipesteam, room_speed * 0.3, room_speed * 0.5);
part_type_colour1(pipesteam, c_blue);

//create steam emitter
steam_emitter = part_emitter_create(steam);
part_emitter_region(steam_emitter, steam, x-5, x+5, y-5, y+5, ps_shape_ellipse, ps_distr_linear);
//part_emitter_burst(steam_emitter, steam, pipesteam, 30);
part_emitter_stream(steam_emitter, steam, pipesteam, 3);
3rd particles system is just a duplicate of 1st one with changed variable names.
 
V

Vredniuka

Guest
Also, I tried using the same Particle System, but several Particle Types and Emitters. And still no go :( Only the first one shows up.


Code:
/// @description create PartSys01 particles

//Create particle system (this is 1st system)
PartSys01 = part_system_create();
part_system_depth(PartSys01,-100);

//Create a PartSys01 particle
bloodsplat = part_type_create()
part_type_shape (bloodsplat,pt_shape_smoke);
part_type_size(bloodsplat, 0.07, 0.15, 0, 0);
part_type_speed(bloodsplat, 4 , 7 , 0, 0);
//part_type_direction(bloodsplat, dir1, dir2, 0, 0);
part_type_gravity(bloodsplat, 0.3 , 270);
part_type_life(bloodsplat, room_speed * 0.3, room_speed * 0.5);
part_type_colour1(bloodsplat, c_red);

//Create a steam particles
pipesteam = part_type_create()
part_type_shape (pipesteam,pt_shape_smoke);
part_type_size(pipesteam, 0.1, 0.5, 0.01, 0);
part_type_alpha2(pipesteam, 1, 0);
part_type_speed(pipesteam, 4, 7, 0, 0);
part_type_direction(pipesteam, 90, 90, 0, 0);
//part_type_gravity(pipesteam, 0.3, 270);
part_type_life(pipesteam, room_speed * 0.3, room_speed * 0.5);
part_type_colour1(pipesteam, c_blue);

//create blood emitter
blood_emitter = part_emitter_create(PartSys01);
part_emitter_region(blood_emitter, PartSys01, x-5, x+5, y-5, y+5, ps_shape_ellipse, ps_distr_linear);
//part_emitter_burst(blood_emitter, PartSys01, bloodsplat, 30);
part_emitter_stream(blood_emitter, PartSys01, bloodsplat, 5);

//create steam emitter
steam_emitter = part_emitter_create(PartSys01);
part_emitter_region(steam_emitter, PartSys01, x+25, x+35, y+25, y+35, ps_shape_ellipse, ps_distr_linear);
//part_emitter_burst(steam_emitter, steam, pipesteam, 30);
part_emitter_stream(steam_emitter, PartSys01, pipesteam, 3);
In this case I can get the steam_emitter to show up if I take out the blood_emitter from the code


Code:
/// @description create PartSys01 particles

//Create particle system (this is 1st system)
PartSys01 = part_system_create();
part_system_depth(PartSys01,-100);

//Create a PartSys01 particle
bloodsplat = part_type_create()
part_type_shape (bloodsplat,pt_shape_smoke);
part_type_size(bloodsplat, 0.07, 0.15, 0, 0);
part_type_speed(bloodsplat, 4 , 7 , 0, 0);
//part_type_direction(bloodsplat, dir1, dir2, 0, 0);
part_type_gravity(bloodsplat, 0.3 , 270);
part_type_life(bloodsplat, room_speed * 0.3, room_speed * 0.5);
part_type_colour1(bloodsplat, c_red);

//Create a steam particles
pipesteam = part_type_create()
part_type_shape (pipesteam,pt_shape_smoke);
part_type_size(pipesteam, 0.1, 0.5, 0.01, 0);
part_type_alpha2(pipesteam, 1, 0);
part_type_speed(pipesteam, 4, 7, 0, 0);
part_type_direction(pipesteam, 90, 90, 0, 0);
//part_type_gravity(pipesteam, 0.3, 270);
part_type_life(pipesteam, room_speed * 0.3, room_speed * 0.5);
part_type_colour1(pipesteam, c_blue);

//create blood emitter
//blood_emitter = part_emitter_create(PartSys01);
//part_emitter_region(blood_emitter, PartSys01, x-5, x+5, y-5, y+5, ps_shape_ellipse, ps_distr_linear);
//part_emitter_burst(blood_emitter, PartSys01, bloodsplat, 30);
//part_emitter_stream(blood_emitter, PartSys01, bloodsplat, 5);

//create steam emitter
steam_emitter = part_emitter_create(PartSys01);
part_emitter_region(steam_emitter, PartSys01, x+25, x+35, y+25, y+35, ps_shape_ellipse, ps_distr_linear);
//part_emitter_burst(steam_emitter, steam, pipesteam, 30);
part_emitter_stream(steam_emitter, PartSys01, pipesteam, 3);
 

Slyddar

Member
I believe you are creating the emitter's incorrectly. You have the ps and the ind around the wrong way. It should be like this.

Code:
//create blood emitter
blood_emitter = part_emitter_create(PartSys01);
part_emitter_region(PartSys01, blood_emitter, x-5, x+5, y-5, y+5, ps_shape_ellipse, ps_distr_linear);
//part_emitter_burst(blood_emitter, PartSys01, bloodsplat, 30);
part_emitter_stream(PartSys01, blood_emitter, bloodsplat, 5);

//create steam emitter
steam_emitter = part_emitter_create(steam);
part_emitter_region(steam, steam_emitter, x-5, x+5, y-5, y+5, ps_shape_ellipse, ps_distr_linear);
//part_emitter_burst(steam_emitter, steam, pipesteam, 30);
part_emitter_stream(steam, steam_emitter, pipesteam, 3);
 
V

Vredniuka

Guest
OMG wow, how did I not notice that :D Thank you so much. That works.
 
Top