• Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!

GMS 2 Particles issue [SOLVED]

junk-boy

Member
So, I am pretty new with Game Maker, and I have been struggling with particle system recently. I did some bunch of code, and it seems to be working, but, for some reason, there are some issues with particles - first, they are not drawn on any light colors and second, they are being overlapped by the objects. As English is not my native language, and so mistakes can be here and there, you can just look at the gif I attached below to (hopefully) understand what I am talking about.
EDIT: Here's the code, I totally forgot about that
EDIT2: Attached some more gifs to show what I got
Code:
RainParticle = part_system_create();

rain_particle = part_type_create();
part_type_shape(rain_particle,pt_shape_line);
part_type_size(rain_particle,0.10,0.10,0,0);
part_type_scale(rain_particle,1,1);
part_type_color1(rain_particle,c_red);
part_type_alpha1(rain_particle,1);
part_type_speed(rain_particle,6,6.5,0,0);
part_type_direction(rain_particle,290,293,0,0);
part_type_gravity(rain_particle,0,270);
part_type_orientation(rain_particle,0,0,0,0,1);
part_type_blend(rain_particle,1);
part_type_life(rain_particle,60,62);
//part_type_color_mix(rain_particle,c_gray, c_dkgray);

rain_emitter = part_emitter_create(RainParticle);
part_emitter_region(RainParticle,rain_emitter,-640,room_width,-120,y,ps_shape_line,ps_distr_linear);
part_emitter_stream(RainParticle,rain_emitter,rain_particle,3);

repeat (room_speed * 3)
   {
    part_system_update(RainParticle);
   }
 

Attachments

Last edited:

TheSly

Member
When you create the particle system, you need to create it on a layer that is above those objects.
 

TheSly

Member
Are you creating a particle system using part_system_create_layer() ?

You are giving us no code, so I have to guess what you're doing.

Particles can be created by objects that are on any layer, but the particle will spawn on the layer set by part_system_create_layer().
 

junk-boy

Member
Oops, my mistake. Here's the code I have.
Code:
RainParticle = part_system_create();

rain_particle = part_type_create();
part_type_shape(rain_particle,pt_shape_line);
part_type_size(rain_particle,0.10,0.10,0,0);
part_type_scale(rain_particle,1,1);
part_type_color1(rain_particle,c_red);
part_type_alpha1(rain_particle,1);
part_type_speed(rain_particle,6,6.5,0,0);
part_type_direction(rain_particle,290,293,0,0);
part_type_gravity(rain_particle,0,270);
part_type_orientation(rain_particle,0,0,0,0,1);
part_type_blend(rain_particle,1);
part_type_life(rain_particle,60,62);
//part_type_color_mix(rain_particle,c_gray, c_dkgray);

rain_emitter = part_emitter_create(RainParticle);
part_emitter_region(RainParticle,rain_emitter,-640,room_width,-120,y,ps_shape_line,ps_distr_linear);
part_emitter_stream(RainParticle,rain_emitter,rain_particle,3);

repeat (room_speed * 3)
   {
    part_system_update(RainParticle);
   }
EDIT: I tried changing part_system_create() to part_system_create_layer(), and nothing changed
 

TheSly

Member
So you tried using part_system_create_layer() to create the system on a layer above all the object layers? Note, the layer needs to be passed as a string.
 

OnLashoc

Member
Try adding:

Code:
part_system_depth ();
Somewhere in there, I put near the top. It requires two arguments if I remember correctly, the second value being the depth i.e.- part_type_depth(*particle name*, -10000); (remove the asterisks).

Onnie
 

junk-boy

Member
Try adding:

Code:
part_system_depth ();
Somewhere in there, I put near the top. It requires two arguments if I remember correctly, the second value being the depth i.e.- part_type_depth(*particle name*, -10000); (remove the asterisks).

Onnie
Adding that doesn't work, too

I attached some more gifs to show what I mentioned about that light color thing. Looking at the result, it seems that particles change their transparency depending on the brightness or something of the color, as they are being drawn on black color with transparency of 1, while being drawn on white with transparency of 0. I really have no idea what's going on, I have nothing else about the particle system exept that piece of code in a create event
 

Attachments

TheSly

Member
You are setting the blending here:
Code:
part_type_blend(rain_particle,1);
So you will need to set it to 0 if you don't want it to blend.
 

junk-boy

Member
You are setting the blending here:
Code:
part_type_blend(rain_particle,1);
So you will need to set it to 0 if you don't want it to blend.
YES, that's exactly what I needed! And jeez, I feel really stupid now, I didn't even notice that:oops:
Anyways, thanks for all the help!
 

OnLashoc

Member
My answer was in regards to depth. I have that this line of code in my particle system coding on the step event, I might have said create event.

Code:
part_system_depth(particle1,400 );
And now it is correctly drawing under the object I needed it to.

Onnie
 
Top