[SOLVED] Get the Map ID (for using it in a common event)

Is there any simple way in MV to get the ID of the currently active map?

I want to use this in an common event to show a specific picture. So for example:

If MapID = 001
Show Picture: #1,

If
MapID = 002

Show Picture: #2,

If MapID = 003
Show Picture: #3,

I mean, I could create a variable to determine which picture is shown, and everytime a new map is loaded it changes the number of this variable. But I thought there might be an easier way that I just don't know yet.
I think you could do this more directly instead of a conditional branch. Can't test this atm but try this script in your common event:

$gameScreen.showPicture($gameMap._mapId, name, origin, x, y,
scaleX, scaleY, opacity, blendMode);

This should show the picture with the ID that matches the map ID. If you are using a plugin that calls a specified common event each time you transfer maps, it should update every time.
Control variable, use script option to set it to $gameMap._mapId
Or just Control Variables -> Game Data -> Other -> Map ID.
I've tested the script but I could not get it working.
However, It got me in the right direction. I've tested a bit in different ways and in the End I've found the solution that JGreene provided. Its basically the same like caethyril, just one as a script and one using the already implemented function.
MapID.png

So I have now a clean and simple solution.

Thank you all for the fast reply 🙂
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/solved-get-the-map-id-for-using-it-in-a-common-event.156516/