Description
part_system_create_layer() and part_system_layer() allow a particle system to be moved (or directly created into) a specific layer.
According to documentation for both of these functions, the "layer" parameter can either be a string (the layer name), or the layerID.
The layerID no longer works as an input for either of these functions, only the layer name
To give an example, this code used to work, but now doesn't:
var myLayerID = layer_create(0)
var sysID = part_system_create_layer(myLayerID,1)
and the same happens to this code:
var myLayerID = layer_create(0)
var sysID = part_system_create()
part_system_layer(sysID,myLayerID)
The error given is
"part_system_create_layer argument 1 invalid reference to (layer) - requested 5 max is -1"
where "5" is the index of the layer (so it may vary depending on the code that's tested with)
A workaround to this is to just use layer names, which layers luckily get assigned one automatically if one is not provided. So the two blocks of code from above work if we tweak them like this:
var myLayerID = layer_create(0)
var sysID = part_system_create_layer(layer_get_name(myLayerID),1)
and this:
var myLayerID = layer_create(0)
var sysID = part_system_create()
part_system_layer(sysID,layer_get_name(myLayerID))
Notes:
- Bug occurs on Runtime v2024.4.0.168, IDE 2024.4.0.137,
- It did not occur on Runtime v2024.2.0.168, IDE 2024.2.0.132, nor on 2023 versions.
- I've attached a sample project with just the affected code: partSysLayerFunctionsBug.zip
Expected Change
Expected Result: "part_system_create_layer()" and "part_system_layer()" accept layerIDs instead of only layer names
Steps To Reproduce
- Create a new GMS2 project, IDE v2024.4.0.137, Runtime v2024.4.0.168.
- Place an object in the first room so it will run code
- On the creation event, create a layer with layer_create(0) and store the layerID in a variable
- Create a particle system with part_system_create_layer() and use the layerID from step #3 as the layer where you want the particle system created.
- Alternatively, create a particle system with part_system_create() and store the particleSystemID, and try to move it to that layer created in step# using part_system_layer()
Result: The "part_system_create_layer()" and "part_system_layer()" don't accept layerIDs
How reliably can you recreate this issue using your steps above?
Always
Which version of GameMaker are you reporting this issue for?
2024.4.0 (Monthly)
Which platform(s) are you seeing the problem on?
Windows
Contact Us Package Attached?
Sample Project Added?
Description
part_system_create_layer() and part_system_layer() allow a particle system to be moved (or directly created into) a specific layer.
According to documentation for both of these functions, the "layer" parameter can either be a string (the layer name), or the layerID.
The layerID no longer works as an input for either of these functions, only the layer name
To give an example, this code used to work, but now doesn't:
and the same happens to this code:
The error given is
where "5" is the index of the layer (so it may vary depending on the code that's tested with)
A workaround to this is to just use layer names, which layers luckily get assigned one automatically if one is not provided. So the two blocks of code from above work if we tweak them like this:
and this:
Notes:
Expected Change
Expected Result: "part_system_create_layer()" and "part_system_layer()" accept layerIDs instead of only layer names
Steps To Reproduce
Result: The "part_system_create_layer()" and "part_system_layer()" don't accept layerIDs
How reliably can you recreate this issue using your steps above?
Always
Which version of GameMaker are you reporting this issue for?
2024.4.0 (Monthly)
Which platform(s) are you seeing the problem on?
Windows
Contact Us Package Attached?
Sample Project Added?