[RMMV] How to tell which map I'm on

I'm using the plugin CE_MapLoad as a nag message once the player's negative karma reaches a certain level warning them that they need to do something about it. There are certain maps where I do not want this to occur, particularly within a specific building or two. I'd like to simply put in a conditional statement, or a script call that says

Code:
Pseudo Code
If CURRENTMAP = Map020
  Exit Event Processing
End

If CURRENTMAP = Map025
  Exit Event Processing
End

etc etc


That way even if the specified Common Event runs, nothing will happen other than executing a couple of conditional statements.

I'm not sure how to go about doing this. If anybody can point me in the right direction I'd appreciate it.

Regular event coding or a Script call will do. I suspect it's more of a script call solution but I'm not sure what calls/variables to use.
this._mapId
on an event page or common event page

E: If you want nothing to happen just leave it blank under the if or else statement
whst you want to use is the control variable command followed by a conditional branch.
the game data section of control variable even defaults to map id, although it contains almost any data from your game.
The script from AquaEcho will do what you asked for, but you can make it a bit nicer by simply checking if the id is part of a list, so that you can do this with just a single conditional. So in your conditional branch you could put this script: [1,2,3,20,25].contains(this._mapId) to check if the current map's id is part of a list of restricted ids (in this example 1, 2, 3, 20 or 25).
Instead of using IDs I would use a meta tag in the map properties.
Notetag example:
  • Map note <noBadKarmaWarning>;
  • Event check Conditional Branch -> Script: $dataMap.meta.noBadKarmaWarning.
@Mac15001900 : To clarify - Is this script one I need to get from somewhere, such as a plugin? If so, where do I find it? or is [1,2,3,20,25].contains(this._mapId) the whole script?
@Mac15001900 : To clarify - Is this script one I need to get from somewhere, such as a plugin? If so, where do I find it? or is [1,2,3,20,25].contains(this._mapId) the whole script?
You wouldnt need a plugin to use that. It's standard javascript with this._mapId being a property of the Game Interpreter object in the core engine files
You wouldnt need a plugin to use that. It's standard javascript with this._mapId being a property of the Game Interpreter object in the core engine files
Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-how-to-tell-which-map-im-on.165165/