Can I use switches to change impassable tiles to passable ?

So I actually have some tiles and I have a terrain tag on them . And I want to change the tiles with this terain tag to passable - walkable when a certain switch is on and return them to impassable when the switch is off.

Is something like this possible?
There are multiple solutions:

- If it's only a few tiles, consider placing events there and set them to "Below Characters" when the switch is on.

- Duplicate the tileset. The first version has those tiles inpassible, the second has them passable. Switch between them when needed.

- I believe there are scripts that specifically deal with switching tiles.

Also, you could extend Game_Map.passable? like this:

class Game_Map    alias 😮riginal_passable? 😛assable?    def passable?(x, y, d)      return true if terrain_tag(x, y) == <Terrain-ID> && $game_switches[<Switch>]      original_passable?(x, y, d)   end end
Where <Terrain-ID> is your terrain tag and <Switch> is the number of your switch.

But this is pretty dirty and i advise you to use one of the other solutions.
by default switches can only change events, not tiles.


I would suggest you follow the first option given above and make the map passable, blocking only part of it by events conditioned to the switch.


That is because the other option all require some experience with using the makers, but events are more simpler.
About the first solution  (since you don't recommend the last one That I would have probably followed if you didn;t mention it was dirty) 

It doesn't seem to be working...

I have a lake and when I try to pass over it with the switch active it doesn't work...


Actually I forgot to make the tiles passable by default

Original thread: https://forums.rpgmakerweb.com/threads/can-i-use-switches-to-change-impassable-tiles-to-passable.40586/