An ability for a specific map only

I'm trying to make an ability that can only be used when on a specific map, so during battle or any other map it will not work.

So far; I have the new abilty trigger a common event.. but that common event should only work when on that specific map.
How would I go about doing this?
On the map where it should be avaible to use, set a variable to map id of the current map (Get Location Info on event tab 3). Then in the common event, make a condition: when that variable = X (ID of that map), then do (...)
On the map where it should be avaible to use, set a variable to map id of the current map (Get Location Info on event tab 3). Then in the common event, make a condition: when that variable = X (ID of that map), then do (...)
Heyyy.. that got it working.

Thank you!
if it's a special skill, add skill on that map, and when leaving remove that map.
it depends if its a skill at least or how the mechanic works.

with the event page visible, we can direct you how to approach it.
you can also use a switch for the Common Event when entering and Switch OFF
when leaving the area.

there are some ways to control it or as Fizzly said, but I dont know if its fully
evented or by plugin or a combo of to make it work.
The other easy thing to do would be to simply make it so you can only use the skill on that map.

Using VisuStella Skills and States, give it the notetag:
Code:
<JS Skill Visible>
visible = $gameMap.mapId()==69;
</JS Skill Vislble>

where 69 is the ID of your map. Then the player won't even see the skill cluttering their list for the rest of the game.
The other easy thing to do would be to simply make it so you can only use the skill on that map.

Using VisuStella Skills and States, give it the notetag:
Code:
<JS Skill Visible>
visible = $gameMap.mapId()==69;
</JS Skill Vislble>

where 69 is the ID of your map. Then the player won't even see the skill cluttering their list for the rest of the game.
For now it works... not perfectly, but well enough.
I'll keep this in mind for later though. Thanks for the suggestion.
You could "teach" them the skill upon entering the map and make them "forget" upon leaving the map though when you make use of the teleporters.

Edit: Place an Event that adds the Skill onto the Party Member who should use it(or the entire party) and also turn on a Switch.
as for every single troops you plan on using for the Map you tell the game to take away the skill from the party member (or the entire party) upon the start of the fight (that's why you need that switch).

As for ANY movement OUTSIDE of the Map, you send the player to the next map, then remove the skill and so on.

sources:
Screenshot1 shows the troops I set up for this
Screenshot2 shows the Event needed to give the skill and turn on the switch
Screenshot3 shows one of the Teleporters taking away said skill and turn off a switch
Screenshot4 shows my Gunner Edward having the skill equipped due to the Event on the Map
Screenshot5 Shows that the Skill is no longer available in battle due to the troops battle behavior.

Original thread: https://forums.rpgmakerweb.com/threads/an-ability-for-a-specific-map-only.161785/