Hi, I'm having a problem where I have most of my main objects on layer 0, and I'd like to add a layer below that layer. This makes the new layer 0 and the old layer 1. Is there a way to have all of the events in my event sheet refer to the objects in their correct, new layer 1 instead of layer 0 in a way where I don't have to change each event by hand?

sanderstyler wrote:Hi, I'm having a problem where I have most of my main objects on layer 0, and I'd like to add a layer below that layer. This makes the new layer 0 and the old layer 1. Is there a way to have all of the events in my event sheet refer to the objects in their correct, new layer 1 instead of layer 0 in a way where I don't have to change each event by hand?

Thanks!

Just curious, sanderstyler. How are you currently referring the objects in layer 0? I'm curious, because I haven't had any issues with objects residing in old layers after adding new layers nor after changing layer orders..

You can also change the layer name to something else. Click the [Layer 0] and press [F2] on your keyboard to change the layer name to another name and see if that name would change after adding a new layer and put that layer underneath. It won't change.

No, sanderstyler's right, it doesn't work, I'm working around by storing the game layer in a variable, and just referring to that every time, that way, no matter how many layers I add, I just can just update the variable.

A number to the right. This is a zero based index of the layer (the first layer is number 0, not 1). If you need to enter a layer number in the event system, this is the corresponding number. (You can also enter layer names in the event system which might be more convenient if you regularly reorder layers.)

Some quick experimentation reveals that to refer to a layer by name, you would use quotation marks, while a variable or other expression with the same name can be referenced without quotation marks.

A number to the right. This is a zero based index of the layer (the first layer is number 0, not 1). If you need to enter a layer number in the event system, this is the corresponding number. (You can also enter layer names in the event system which might be more convenient if you regularly reorder layers.)

Some quick experimentation reveals that to refer to a layer by name, you would use quotation marks, while a variable or other expression with the same name can be referenced without quotation marks.

@Ashley maybe it could be worth considering changing the layer field default for the System-Create Object action (and others?) to be the name "Layer 0" rather than 0?

It would help in the situation where a user does significant work on their project, then decides to add a background or other layer beneath the initial one. Currently they would have to go back through all their events that created objects and update the layer field for each.

The second benefit would be for those who don't realize you can use layer names to reference the layer at all, as it really isn't immediately obvious.

I can't currently think of any situation where using the layer index would be preferable to the layer name.