Change another map's tileset

I want to change the tileset based on map id
The way I used to do it is to check before transferring the player then changing the tileset accordingly
However, it gets messy after a while. I thought I must ask for help on tackling this issue since there must be a faster way to do it!
Better link the plugin you use
I'm not sure which one
@pasunna I think he doesn't use a plugin at all, but the event command...

@nujood there is the technical problem that other maps do not exist while playing on one map, they are only loaded from file into the gamemap on the player going there. Which means you cannot change that unless you change the stored files, and that would get even more messy.

What is theoretically possible is to use a plugin that stores the tileset information for all maps on its own, and then uses that data to change the tileset on mapload.
But such a plugin would have to be requested to be written as I don't think something like that exists yet.

That said, please explain why you're changing tilesets - most cases I know of where such a mechanic is used can easily be done by a parallel process on mapload on the map that is to be changed, without getting messy at all. If we know what you're doing we might be able to point you to a better solution.
Yes, I use no plugin just the old change tileset command!
Thanks @Andar I should have known since the function was on the game object class!
I do pretty much what you described but was rather hoping for a one simple command.
Thanks folks! I am off learning JS to make this plugin 😀
why do you need a plugin? Just put the Change Tileset command into a parallel event (that erases itself) on the same map you want to change. Because it's a parallel event, the change should happen before the fadein.

Original thread: https://forums.rpgmakerweb.com/threads/change-another-maps-tileset.120048/