• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

 Particle Systems on Layers

G

GhostlyFeline

Guest
I was looking through the manual to see if there were any changes to how the particle systems work. One thing that I found notable was the lack of being able to assign a particle system to a layer, instead of a depth. This seems strange to me, as other elements have changed to put an emphasis on this new layering system. Are there any plans to add such functionality, or is it going to stay depth based?
 
N

NPT

Guest
part_system_create_layer(layer_id, persistent);

layer : The layer ID to assign the particle system too (can be any layer type)
persistent: Flag the particle system as persistent (set to true) or not (set to false)
 
A

Aura

Guest
Some functions are yet undocumented, and some just aren't visible in "search", but are in proper chapter in documentation.
File this as a bug, so that they remember to fix it? Particularly the functions that are not documented yet.
 

codemouse

Member
Hello, I know this is a bit of an older thread but noticed a couple of quirks with the GMS2 particle commands, so at worst maybe this will help folks going through tutorials.

Currently using v2.0.3.56
1. part_system_create_layer() strangely requires the persistence flag declaration (true/false). It's not optional - GMS2 will throw an error if you don't declare it.
2. If you don't set a layer for your particle system (for example, following the youtube tutorial for particles) nothing will appear. You need to either set a layer (part_system_layer), create directly on a layer (part_system_create_layer), or use one of the default effect commands (effect_create_below/above)
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Why "strangely" for requiring the persistent flag? It's part of the function and not documented as being optional... http://docs2.yoyogames.com/index.ht...article systems/part_system_create_layer.html

As for using part_system_create() that should create a managed layer for the system (much like instance_create() will), so it should appear. Try changing the particle system depth and see if it becomes visible as it may be under other layers... if it's not then it sounds like a bug and I'd appreciate it if you file it as one.
 

codemouse

Member
I had a think on this, and you're right. Most GMS functions do seem to use required variables. I would argue the approach of other frameworks where little used flags are considered optional, but that's really just my own opinion and I'll leave it at that.

Regarding point #2, it's definitely a bug. Even with a background image, if you don't bind the particles to a layer, nothing appears. I'll see if I can file a bug about it, but unfortunately YYG is forcing a referral/tracking link if you go to the /bug2 URL, which seems to get blocked often...
 

gnysek

Member
Why "strangely" for requiring the persistent flag? It's part of the function and not documented as being optional... http://docs2.yoyogames.com/index.html?page=source/_build/3_scripting/4_gml_reference/drawing/particles/particle systems/part_system_create_layer.html

As for using part_system_create() that should create a managed layer for the system (much like instance_create() will), so it should appear. Try changing the particle system depth and see if it becomes visible as it may be under other layers... if it's not then it sounds like a bug and I'd appreciate it if you file it as one.
If I go back to room, where persistent particle layer is created, would it cause a memory leak and create two systems (one actually persist, and a new one??
 

gnysek

Member
@Nocturne Would be good to mention in manual. Something like extra bordered div "Like any other persistent things, it will be duplicated if action which created it is called again (by instance event or room creation code)" for al resources which can persists.
 
Top