• 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]Can't make Multiple Particles

W

Wild_West

Guest
Everytime I have more than one object in a room that uses particle systems one seems to stop the other from making any at all and I don't know why. It's like only 1 of the systems can exist at a time or something.
 

Tony Brice

Member
Without seeing code we can't really help. At a guess I'd suggest you're creating an object for a particle then just recreating it rather than creating a new instance of it.
 
W

Wild_West

Guest
Without seeing code we can't really help. At a guess I'd suggest you're creating an object for a particle then just recreating it rather than creating a new instance of it.
well the particle scripts all work fine, like I said it's just when there's more than 1 object making particles in the room, 1 seems to cancel the other. Since I can only see 1 and all any of these objects do is MAKE the particles.
 
W

Wild_West

Guest
It's your code.

You're probably doing something wrong in it.
Fine here's the code for both objects making particles, you look it over and tell me why it's only showing 1 system's particles at a time when both are in one room if you're so clever.

Code:
Information about object: lan_blast_sphere
Sprite: wall_spr
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: 
Children: 
Mask: 
No Physics Object
Create Event:
execute code:

lan_system = part_system_create();
part_system_depth(lan_system, -1009);

sphere_type = part_type_create();

sphere_emitter = part_emitter_create(lan_system);


part_type_shape(sphere_type, pt_shape_spark);
part_type_size(sphere_type, .4, .8, .1, 0);
part_type_colour3(sphere_type, c_white, c_yellow, c_orange);
part_type_alpha3(sphere_type, 1, .3, .1);
part_type_life(sphere_type, 3, 6);
part_type_speed(sphere_type, 0, 10, 0, 0);
part_type_direction(sphere_type, 0, 360, 1, 0);


part_particles_create(lan_system, x,y, sphere_type, 1);

Destroy Event:
execute code:

character_west.character_can_act = true;

part_type_destroy(sphere_type);
part_emitter_clear(lan_system, sphere_emitter);
part_particles_clear(lan_system);

Step Event:
execute code:

character_west.character_can_act = false;

if( part_system_exists(lan_system) )
{
  part_emitter_region(lan_system, sphere_type, x-10, x+10, y-10, y+10, ps_shape_ellipse, ps_distr_gaussian);
  part_emitter_stream(lan_system, sphere_emitter, sphere_type, 30);
}

Collision Event with object wall_parent:
destroy the instance
Other Event: Outside Room:
destroy the instance
execute code:

part_type_clear(sphere_type);

Other Event: Game End:
execute code:

part_system_destroy(lan_system);

part_type_destroy(sphere_type);

part_emitter_destroy(lan_system, sphere_emitter);

Other Event: Room End:
execute code:

part_system_destroy(lan_system);

part_type_destroy(sphere_type);

part_emitter_destroy(lan_system, sphere_emitter);

Draw Event:
execute code:

///Don't Draw Self
Code:
Information about object: fortune_particle
Sprite: wall_spr
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: 
Children: 
Mask: 
No Physics Object
Create Event:
execute code:

fortune_system = part_system_create();

fortune_type = part_type_create();

part_type_colour3(fortune_type, c_white, c_yellow, c_orange);
part_type_alpha3(fortune_type, .1, .5, 1);
part_type_blend(fortune_type, .5);

part_type_life(fortune_type, 30, 90);

part_type_size(fortune_type, 0, .4, 0, 0);

part_type_direction(fortune_type, 0, 359, 5, 0);
part_type_speed(fortune_type, 1, 5, 0, 0);

part_type_shape(fortune_type, pt_shape_star);

part_particles_create(fortune_system, x,y, fortune_type, 1);

fortune_emitter = part_emitter_create(fortune_system);
part_emitter_region(fortune_system, fortune_emitter, x-16, x+16, y-16, y+16, ps_shape_diamond, ps_distr_invgaussian);

Step Event:
execute code:

if(part_system_exists(fortune_system) )
{ part_emitter_stream(fortune_system, fortune_emitter, fortune_type, 10); }

Other Event: Game End:
execute code:

part_system_destroy(fortune_system);
part_type_destroy(fortune_type);
part_emitter_destroy(fortune_system, fortune_emitter);

Other Event: Room End:
execute code:

part_system_destroy(fortune_system);
part_type_destroy(fortune_type);
part_emitter_destroy(fortune_system, fortune_emitter);

Draw Event:
execute code:

draw_set_alpha(.4);
draw_circle_colour(x,y,100,c_white, c_white, true);
draw_set_alpha(1);
 
M

maratae

Guest
Fine here's the code for both objects making particles, you look it over and tell me why it's only showing 1 system's particles at a time when both are in one room if you're so clever.

Code:
Information about object: lan_blast_sphere
Sprite: wall_spr
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:

lan_system = part_system_create();
part_system_depth(lan_system, -1009);

sphere_type = part_type_create();

sphere_emitter = part_emitter_create(lan_system);


part_type_shape(sphere_type, pt_shape_spark);
part_type_size(sphere_type, .4, .8, .1, 0);
part_type_colour3(sphere_type, c_white, c_yellow, c_orange);
part_type_alpha3(sphere_type, 1, .3, .1);
part_type_life(sphere_type, 3, 6);
part_type_speed(sphere_type, 0, 10, 0, 0);
part_type_direction(sphere_type, 0, 360, 1, 0);


part_particles_create(lan_system, x,y, sphere_type, 1);

Destroy Event:
execute code:

character_west.character_can_act = true;

part_type_destroy(sphere_type);
part_emitter_clear(lan_system, sphere_emitter);
part_particles_clear(lan_system);

Step Event:
execute code:

character_west.character_can_act = false;

if( part_system_exists(lan_system) )
{
  part_emitter_region(lan_system, sphere_type, x-10, x+10, y-10, y+10, ps_shape_ellipse, ps_distr_gaussian);
  part_emitter_stream(lan_system, sphere_emitter, sphere_type, 30);
}

Collision Event with object wall_parent:
destroy the instance
Other Event: Outside Room:
destroy the instance
execute code:

part_type_clear(sphere_type);

Other Event: Game End:
execute code:

part_system_destroy(lan_system);

part_type_destroy(sphere_type);

part_emitter_destroy(lan_system, sphere_emitter);

Other Event: Room End:
execute code:

part_system_destroy(lan_system);

part_type_destroy(sphere_type);

part_emitter_destroy(lan_system, sphere_emitter);

Draw Event:
execute code:

///Don't Draw Self
Code:
Information about object: fortune_particle
Sprite: wall_spr
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:

fortune_system = part_system_create();

fortune_type = part_type_create();

part_type_colour3(fortune_type, c_white, c_yellow, c_orange);
part_type_alpha3(fortune_type, .1, .5, 1);
part_type_blend(fortune_type, .5);

part_type_life(fortune_type, 30, 90);

part_type_size(fortune_type, 0, .4, 0, 0);

part_type_direction(fortune_type, 0, 359, 5, 0);
part_type_speed(fortune_type, 1, 5, 0, 0);

part_type_shape(fortune_type, pt_shape_star);

part_particles_create(fortune_system, x,y, fortune_type, 1);

fortune_emitter = part_emitter_create(fortune_system);
part_emitter_region(fortune_system, fortune_emitter, x-16, x+16, y-16, y+16, ps_shape_diamond, ps_distr_invgaussian);

Step Event:
execute code:

if(part_system_exists(fortune_system) )
{ part_emitter_stream(fortune_system, fortune_emitter, fortune_type, 10); }

Other Event: Game End:
execute code:

part_system_destroy(fortune_system);
part_type_destroy(fortune_type);
part_emitter_destroy(fortune_system, fortune_emitter);

Other Event: Room End:
execute code:

part_system_destroy(fortune_system);
part_type_destroy(fortune_type);
part_emitter_destroy(fortune_system, fortune_emitter);

Draw Event:
execute code:

draw_set_alpha(.4);
draw_circle_colour(x,y,100,c_white, c_white, true);
draw_set_alpha(1);
Sounds like you're doing us plebs a big favour by asking questions properly, so I don't wanna be a bother and I decided I don't know anything about particles or game maker.
Sorry, can't help.
 
W

Wild_West

Guest
Sounds like you're doing us plebs a big favour by asking questions properly, so I don't wanna be a bother and I decided I don't know anything about particles or game maker.
Sorry, can't help.
That's a great wise ass answer. But pardon me for asking a question and expecting people here to do what this site exists for and actually being helpful. Or even polite as a start. I mean I'm sorry if MY response was a little flippant but hey you don't want to be nice I don't have to be either.
Because I'll tell you something in all the time I've been part of this site never once have I found a thread that matches my situations to the letter. again I say I'm sorry if my particular problems don't fit into some generic newbie issues that get asked everyday. I mean if you know the answer is it really that much of a burden to just type out the answer? If you don't know it or can't work it out from what I say or show, just tell me that. Don't cop an attitude and say "Hey idiot just look it up" or "It's your code you're doing it wrong." I already know it's wrong that's why I'm A-S-K-I-N-G F-O-R H-E-L-P. from the people who supposedly know about these things. and what do I get instead? It's a joke.
 
M

maratae

Guest
That's a great wise ass answer. But pardon me for asking a question and expecting people here to do what this site exists for and actually being helpful. Or even polite as a start. I mean I'm sorry if MY response was a little flippant but hey you don't want to be nice I don't have to be either.
Because I'll tell you something in all the time I've been part of this site never once have I found a thread that matches my situations to the letter. again I say I'm sorry if my particular problems don't fit into some generic newbie issues that get asked everyday. I mean if you know the answer is it really that much of a burden to just type out the answer? If you don't know it or can't work it out from what I say or show, just tell me that. Don't cop an attitude and say "Hey idiot just look it up" or "It's your code you're doing it wrong." I already know it's wrong that's why I'm A-S-K-I-N-G F-O-R H-E-L-P. from the people who supposedly know about these things. and what do I get instead? It's a joke.
If your question is vague, your answers are gonna be vague.
If you start getting rude, ppl are gonna be rude as well, since it's not our job to solve anyone else's problems. We do it because we want to.
I'd give another read to the programming forum guidelines.

I'm willing to give this another chance, so here it goes:
There's nothing wrong with your code itself, at least the one you shared here anyway.
A possible issue I can see is if you have more than one of these objects in the same room, that's for sure.
If this is what you intend to have, then I'd think of another way to go about this, possibly with a single controller object that can call emitter scripts.
I still don't think you need two particle systems.
 
W

Wild_West

Guest
If your question is vague, your answers are gonna be vague.
If you start getting rude, ppl are gonna be rude as well, since it's not our job to solve anyone else's problems. We do it because we want to.
I'd give another read to the programming forum guidelines.

I'm willing to give this another chance, so here it goes:
There's nothing wrong with your code itself, at least the one you shared here anyway.
A possible issue I can see is if you have more than one of these objects in the same room, that's for sure.
If this is what you intend to have, then I'd think of another way to go about this, possibly with a single controller object that can call emitter scripts.
I still don't think you need two particle systems.
I didn't start getting rude until they did for one thing. Now what does this mean?
A possible issue I can see is if you have more than one of these objects in the same room, that's for sure.
There's no explanation in that statement it just says the issue is that I have more than one in the same room which I already said was the cause of the other particles not showing up because I tested them both alone in the room. If they can't exist together I have to know why before I'll be convinced there's no better or simpler way to do it than having a dozen and one particles all handled clumsily by one system.
 
W

Wild_West

Guest
If your question is vague, your answers are gonna be vague.
If you start getting rude, ppl are gonna be rude as well, since it's not our job to solve anyone else's problems. We do it because we want to.
I'd give another read to the programming forum guidelines.

I'm willing to give this another chance, so here it goes:
There's nothing wrong with your code itself, at least the one you shared here anyway.
A possible issue I can see is if you have more than one of these objects in the same room, that's for sure.
If this is what you intend to have, then I'd think of another way to go about this, possibly with a single controller object that can call emitter scripts.
I still don't think you need two particle systems.
Okay so I got it solved. Yes because I put the particles in one system but no thanks to your lack of a simple explanation. Because you see what I had thought you were saying, since you didn't really give me a direction to work with, was that I had to set up EVERYTHING particle related in ONE object. which of course was a mess and didn't even work anyway because again, 2 systems.
So I took out the 2 systems and made one in a controller object, then set the particle types and values in the object that needed to make them. Had you or anyone just said that from the start we could have spared ourselves this unpleasant exchange. But in my defense This is all the documents tell you about particle systems on it's page.

you can put as many or as few particles into any one system as you think necessary, and you can have as many systems as you think necessary too.

For example, if you need some effects to appear above instances, and other effects to appear beneath instances, you would create two systems and set their depths to get the desired effect, with all particles that are added to each system being drawn at the depth you specify.

Nowhere in there does it say if you place 2 particle systems in ONE room, one system will overwrite the other so nothing IN the overwritten system can be shown.
This was not my error okay?
 

obscene

Member
I have one particular room with about 500 particle systems all with the exact same name and they don't overwrite each other. Some are in separate objects and a a dozen or so are in one object. I've never witnessed anything like one system overwriting another, so I don't think that's what's happened to you either. So still not sure what you have done.
 
W

Wild_West

Guest
I have one particular room with about 500 particle systems all with the exact same name and they don't overwrite each other. Some are in separate objects and a a dozen or so are in one object. I've never witnessed anything like one system overwriting another, so I don't think that's what's happened to you either. So still not sure what you have done.
well then you can't really bother speaking can you? Don't say mine is wrong if you don't have the answer or even know where to find it. You said all 500 of your systems have the same name, that's what I just pointed out, that I had t put all the particles in the same system to make it work. Of course the systems have the same name.
 
W

Wild_West

Guest
Glad you fixed your own mistake and sorry I couldn't correctly theorize about how you messed up. Maybe next time I'll guess better.
Passive aggressive. A for effort.
But in the future, like I said, if you don't have anything to say other than "This is wrong. I don't know how to fix it even though you provided the code but I DO know it's wrong because it's not like mine" spare us all the bother and just don't say anything huh? At least the others tried to help, you just critiqued
 

samspade

Member
You can definitely have multiple particle systems in the same room. I've done it in the same object (systems had different names). From the handbook (both versions):

Before you can create particles you need to create a particle system. This is a "container" where you place your particles and emitters (if you need them) ready for use, and you can put as many or as few particles into any one system as you think necessary, and you can have as many systems as you think necessary too.
However, I looked through you code and didn't see anything obviously wrong. Given that you can have multiple systems without a problem and removing the two systems from their original objects and combining them into a new object fixed the probelm implies one of two things. Either (a) the code in one of the systems was just wrong enough that it didn't work so when it was re-done it was fixed. Or (b) an object, likely outside of the original two, was interfering in some way and changing the objects cut off that interference. I think the easiest thing would be to test both systems in a clean project and then bring them in.
 

obscene

Member
Nowhere in there does it say if you place 2 particle systems in ONE room, one system will overwrite the other so nothing IN the overwritten system can be shown.
This was not my error okay?
Here's the thing. My post actually told you something, but in a nice way. What I meant to say was the above post is nonsense. The manual doesn't say one system will overwrite the other because that's nonsense. I have hundreds of particles systems in the same room. They do not overwrite another. When I said their names were all the same, I did NOT mean they are the same system. I mean I have hundreds of LOCAL systems, all with the same names.

Actually this is irrelevant and I shouldn't have includes that part because it just confused you. The names do not matter.

I also have several global system. About 10 of them. They are created at game start and they are used in dozens of rooms all at the same time Particles systems to not overwrite each other. I tell you that so that you can take that fact and apply it whatever it is that you are doing. If you think a particle system overwrote another, you're wrong. You made an error. What that error is I could not POSSIBLY know because I don't A) have your project in front of me and B) understand your mindset. But I CAN give you a fact that you can take and apply to your situation. So you are very welcome. I do not mind doing it. I'm glad I could help.

You can be mad all you want, but it seems half the topics you make end up going this exact same way... so again, I tell you something that you can take and apply to your situation. You do a very, very bad job explaining your problem. In fact I still don't actually know what it is you are trying to do. I doubt anyone else does. Consider posting a video or a screenshot next time as well as your code all in the very first post and then maybe you'll see a resolution in two posts instead of 15 posts with little information shared and nobody still has any idea what the actual problem was.
 
W

Wild_West

Guest
Here's the thing. My post actually told you something, but in a nice way. What I meant to say was the above post is nonsense. The manual doesn't say one system will overwrite the other because that's nonsense. I have hundreds of particles systems in the same room. They do not overwrite another. When I said their names were all the same, I did NOT mean they are the same system. I mean I have hundreds of LOCAL systems, all with the same names.

Actually this is irrelevant and I shouldn't have includes that part because it just confused you. The names do not matter.

I also have several global system. About 10 of them. They are created at game start and they are used in dozens of rooms all at the same time Particles systems to not overwrite each other. I tell you that so that you can take that fact and apply it whatever it is that you are doing. If you think a particle system overwrote another, you're wrong. You made an error. What that error is I could not POSSIBLY know because I don't A) have your project in front of me and B) understand your mindset. But I CAN give you a fact that you can take and apply to your situation. So you are very welcome. I do not mind doing it. I'm glad I could help.

You can be mad all you want, but it seems half the topics you make end up going this exact same way... so again, I tell you something that you can take and apply to your situation. You do a very, very bad job explaining your problem. In fact I still don't actually know what it is you are trying to do. I doubt anyone else does. Consider posting a video or a screenshot next time as well as your code all in the very first post and then maybe you'll see a resolution in two posts instead of 15 posts with little information shared and nobody still has any idea what the actual problem was.
Well listen, I explained my problem very simply okay? I had 2 objects, both defined their own particle system and when I used both in the same room I could never SEE the particles being made by one system but I COULD see the second object's particles. When I take the second object OUT of the room, I can see the FIRST object's particles again just fine. Now if you still can't follow that here it is again using very few words.

If 2 objects making particles are in 1 room together, I can't see 1 object's particles but I can see the other. If EITHER object making particles is in the room alone I can see the particles of said object.

which would lead anyone reading that to think Hey, maybe there's a problem when BOTH of these objects are in the room together. I come HERE and ask about this, waste time debating the manner in which I ask my question with YOU, and get advice about not using TWO systems from someone else.

Still following?

So going by that advice, I remove the separate particle system creation from both objects and just keep HOW the particle types are setup. the particle system these types of particles EXIST in is now ONE system setup in a third control object. after that I can see both object's particles fine.

Now I don't know what's wrong with YOU that you can't ever seem to understand me when I speak but if you really have this big an issue with me why don't you just avoid my posts altogether and save yourself the hassle of dealing with someone you view as difficult?

I'm not making you try to answer me. Yes I am asking for help but if you don't want to fine, just stay away. solves your problem, simple. Instead you go out of your way to argue because you don't like how I ask questions. what sense does that make?

and for the record if I think the code has any problems I DO post it, but I already had someone here say the code looked fine,which is what I knew already.
 
W

Wild_West

Guest
You can definitely have multiple particle systems in the same room. I've done it in the same object (systems had different names). From the handbook (both versions):



However, I looked through you code and didn't see anything obviously wrong. Given that you can have multiple systems without a problem and removing the two systems from their original objects and combining them into a new object fixed the probelm implies one of two things. Either (a) the code in one of the systems was just wrong enough that it didn't work so when it was re-done it was fixed. Or (b) an object, likely outside of the original two, was interfering in some way and changing the objects cut off that interference. I think the easiest thing would be to test both systems in a clean project and then bring them in.
The only thing I changed was the joint system. the names and code for everything else is still exactly what it was when I initially made the objects. I mean I don't know what to tell you, I pay attention to changes I make. I'd say if I had altered something drastically because none of the other objects in the room had anything to do with particles. and like I said already like 3 times now, the particles work when they are in the room alone. Just not together. so how could something in one of them be just wrong enough? mess anything else up when there's 2 in the room. I can even have 2 of the same object in the room but as soon as there's 2 objects using different systems one of them stops being visible. I understand they wouldn't skip saying the systems can overwrite each other in the manual if that's the case, but I don't know what else it could be so that just seems to be the thing happening. and my adjustments DID fix it so what other conclusion can I come to?
 
Last edited by a moderator:

obscene

Member
Alright, I just figured this out...

upload_2018-1-9_18-23-48.png

My apologies for missing it. You had a small error in your code...

You had...
part_emitter_region(lan_system, sphere_type, x-10, x+10, y-10, y+10, ps_shape_ellipse, ps_distr_gaussian);

Should have been...
part_emitter_region(lan_system, sphere_emitter, x-10, x+10, y-10, y+10, ps_shape_ellipse, ps_distr_gaussian);

Because sphere_type is not an emitter, the region was not set and the particles were appearing in the top left corner. Maybe you had something on your screen blocking you from seeing that.

You thinking this was because two of them were in the room was not COMPLETELY wrong. I managed to put both objects in the room and even with your typo, they both worked. The trick was that lan_blast_sphere had to have the lower ID so that it's emitter was created before object_fortune_particle.

So in closure, you weren't as crazy as I thought. :) Your conclusion had merit. But as is almost always the case, the problem was a typo and unfortunately it was a very easy to miss one.
 
W

Wild_West

Guest
Alright, I just figured this out...

View attachment 15660

My apologies for missing it. You had a small error in your code...

You had...
part_emitter_region(lan_system, sphere_type, x-10, x+10, y-10, y+10, ps_shape_ellipse, ps_distr_gaussian);

Should have been...
part_emitter_region(lan_system, sphere_emitter, x-10, x+10, y-10, y+10, ps_shape_ellipse, ps_distr_gaussian);

Because sphere_type is not an emitter, the region was not set and the particles were appearing in the top left corner. Maybe you had something on your screen blocking you from seeing that.

You thinking this was because two of them were in the room was not COMPLETELY wrong. I managed to put both objects in the room and even with your typo, they both worked. The trick was that lan_blast_sphere had to have the lower ID so that it's emitter was created before object_fortune_particle.

So in closure, you weren't as crazy as I thought. :) Your conclusion had merit. But as is almost always the case, the problem was a typo and unfortunately it was a very easy to miss one.
See, I told you I wasn't crazy.
No no I'm kidding. Listen, I started thinking last night and without going into a lot of personal detail I have been blowing up a lot lately at anything that sets me off. My anger is becoming a problem I need to learn to deal with, I shouldn't be taking my frustration with feeling like I'm failing at everything out on you. I apologize for that.

so as far as that stupid typo goes, I should have caught that myself. God knows I make enough of them. I'm just trying to remember now I DO have a menu sprite in the top left corner but it was closed (invisible) during the time I was testing this. At least I think it was. I know I made the menu after I tested the projectiles, but I guess it doesn't matter now that it's all working.

Even now I went back in and had the same issue, turns out I was trying to clear everything when all I needed was to clear of the emitter after the projectile was destroyed, not the particle type for the projectile too :p

So in the future I will TRY to make my posts more detailed.
 

obscene

Member
All good man, you don't need to apologize. I could probably stand to not be purposely rude but I probably won't. :p I can give it, I can take it.
 
This was an epic thread, with heroes and villains, conflict and drama, with a surprise twist and a unpredictable happy ending which hints at a hopeful future for the participants.

Good work @obscene for persisting and assisting with solving the issue.

@Wild_West I want to acknowledge you for your graceful and humble apology in your last post. It can be really frustrating sometimes debugging code! And communicating via text isn't always the easiest way, as mistakes can arise more easily than when you are sitting in front of someone.

I wish The Last Jedi had been more like this thread!
 
Top