• 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!

Windows Layer Visibility Issue

B

bowmop

Guest
Normally I have a layer in my room that is set to invisible but has various in-game effects such as lighting and collisions



But when I go to another persistent room (an inventory for example).....



The layer returns to being visible again




Room with "solids" layer visible



Room with "solids" layer as it is normally.... invisible



Both the inventory and game room are kept to persistent to keep track of where the player is and what items are where in the inventory



Normally the solids are hidden except in debug mode, yet they are still showing up when the room is returned to.

//hide the solids
var solid_layer = layer_get_id("Solids");
layer_set_visible(solid_layer,debug_mode);


I also have a key press event with:
layer_id=layer_get_id("solids")
layer_set_visible(layer_id, false);
That fails to hide the layer when the key is pressed after a room change.

The issue is happening with or without the room being persistent and with or without the lighting effects.

Aside from unchecking the object is visible, I am not sure how to make a layer appear or disappear after a persistent room change

 
J

Jordan Robinson

Guest
Normally I have a layer in my room that is set to invisible but has various in-game effects such as lighting and collisions



But when I go to another persistent room (an inventory for example).....



The layer returns to being visible again




Room with "solids" layer visible



Room with "solids" layer as it is normally.... invisible



Both the inventory and game room are kept to persistent to keep track of where the player is and what items are where in the inventory



Normally the solids are hidden except in debug mode, yet they are still showing up when the room is returned to.

//hide the solids
var solid_layer = layer_get_id("Solids");
layer_set_visible(solid_layer,debug_mode);


I also have a key press event with:
layer_id=layer_get_id("solids")
layer_set_visible(layer_id, false);
That fails to hide the layer when the key is pressed after a room change.

The issue is happening with or without the room being persistent and with or without the lighting effects.

Aside from unchecking the object is visible, I am not sure how to make a layer appear or disappear after a persistent room change

I dont know if this could be related but I was having an issue where persistent objects appeared to be changing layers after a room change. I guess it happens if the order of layers is different between rooms as the instances seem to maintain depth. My fix was to reset their layer in room start events
 

rIKmAN

Member
I dont know if this could be related but I was having an issue where persistent objects appeared to be changing layers after a room change. I guess it happens if the order of layers is different between rooms as the instances seem to maintain depth. My fix was to reset their layer in room start events
Sounds like this issue which may be what OP is also experiencing.
 
B

bowmop

Guest
Huh, I guess it was a bug... I updated gamemaker to 2.2 from 2.1 with the same code and issue is fixed. I'm glad someone already found and submitted this bug.
 
Top