MV Smoothly Fade Tilemap to Black

Hello! I found a thread whilst searching for an answer for this problem and it half solved it.

This script call below can set the tilemap alpha to 0 which is just what I need, but I can't make it go from 1 to 0.9, 0.8 and so on until 0.
Code:
SceneManager._scene._spriteset._tilemap.children[0].tilemap.upperZLayer.alpha = 0;
I searched why it wouldn't accept floats and it turns out rpgmaker doesn't do floats.
So I'm kinda stuck. Is there another way of doing this with script calls, a better way with built in functions or is there a solution to this float problem?
Thank you in advance.
I searched why it wouldn't accept floats and it turns out rpgmaker doesn't do floats.
That's not an accurate general statement. RPG Maker uses decimal values for many things internally - some specific functions may be coded to only work properly with integer values.

To make sure your question is clear - you're trying to fade out the map without affecting the character/events/UI?
Like Turan says, there's normally no problem with floating-point alpha; e.g. etc.tilemap.alpha = 0.8 correctly makes characters 80% opaque. MV's tile layers seem to be a special case, perhaps because they implement a custom render process (cf ZLayer in pixi-tilemap.js)?

Whatever the reason, you may be able to work around it with parallax mapping. If you have no "above character" tiles to deal with then you could achieve that without a plugin: make an image for the background of your map, give it a filename with ! at the start, e.g. !Map042.png (this disables its parallax motion), then assign it as the map's parallax image. Then:

SceneManager._scene._spriteset._parallax.alpha = 0.8;
Otherwise this approach would need a plugin to bind images to the map on specific layers, e.g. Galv's Layer Graphics:
I use PIXI filters to achieve this and only target the tilemap for tinting instead of using actually using parallaxes or tinting the screen. If all else fails, use the [PIXI Controller Filter plugin].

PLUGIN COMMAND: createFilter TINTMAP adjustment 3
PLUGIN COMMAND: setFilter TINTMAP 0 0 0 0 0 0 0

This will return all black. The range must between 0 and 1 as floats. Try using the moveFilter plugin command to move in between 1 and 0 to achieve your effect without the use of parallaxing. Good luck!
Like Turan says, there's normally no problem with floating-point alpha; e.g. etc.tilemap.alpha = 0.8 correctly makes characters 80% opaque. MV's tile layers seem to be a special case, perhaps because they implement a custom render process (cf ZLayer in pixi-tilemap.js)?

Whatever the reason, you may be able to work around it with parallax mapping. If you have no "above character" tiles to deal with then you could achieve that without a plugin: make an image for the background of your map, give it a filename with ! at the start, e.g. !Map042.png (this disables its parallax motion), then assign it as the map's parallax image. Then:

SceneManager._scene._spriteset._parallax.alpha = 0.8;

Otherwise this approach would need a plugin to bind images to the map on specific layers, e.g. Galv's Layer Graphics:
I solved this by using layer graphics because I already had the plugin in my project. Thank you for the clarification btw! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/smoothly-fade-tilemap-to-black.167290/