How do I make the room dark with exceptions?

Hello everyone,

being the complete noob in MZ, I was wondering how I could make the whole room pitch dark with only the player, button and door sprites being the exception. You see, it's supposed to be a 'remember the path' puzzle where the player lights up the room only by walking over the red button.

1775066235390.png


Would I need to use plugins after all? Thanks.
You could simply create a black image the size of your game window and display that using the show picture command upon entering the room.

(You can make this seamless by using the show picture command before any fade in commands after having transferred the player into the room, meaning it would go onto the entrance to the room on whichever other map leads to it.)

Then when stepping on the button, you simply use the move picture command to reduce its opacity. Fade it out, or just make it 0 in 1 frame, whatever you like.

Then after a couple seconds you just set the opacity to 255 again.

Now this wouldn't really reveal the player, so that's likely a problem, so what we can do is making sure the map is way bigger than your game window. (Just change the size of the map, not the room. This makes sure our character stays centered on the screen.)

Then you'd make the same black image as before, but cut out a circle in the middle of it and bam, the player will be visible and you won't have to deal with a common parallel event that tracks the player location and adjusts the picture because we made sure the player will always be centered.

The button event remains the same.

This approach wouldn't really reveal the button, but I think it would be the simplest solution to getting this puzzle to work in a decent way.

Alternatively we can take an entirely different approach and just make the path into events that only show for a couple of seconds, and then go invisible again. That would keep the mechanic of "remember the path" exactly the same but without the whole hiding stuff picture bit.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-the-room-dark-with-exceptions.183099/