Is there a script call that returns the Tileset name? I'm trying to figure out what type of map my player is on at any given time (Overworld, Inside, Outside, etc) and I think the only way to do that is to get the name property of the Tileset, right? If so, how would I get that value? It looks like $gameMap has a tileset object, but I can't see a tileset property that would have the name in it.
Getting the Tileset name
RPG Maker MV SupportThe script call you want needs to call from $dataTilesets. You can see the properties of the tileset by opening up your Project\data folder and opening the Tilesets.json file.
The property you're looking for is $dataTilesets[n].name, where 'n' is the tilesetID.
But how do you give it the tileset ID 'n'? That's where $gameMap comes in. $gameMap has a function to call the tilesetID (for the current map). So your total script call will look like this:
$dataTilesets[$gameMap.tilesetId()].name
You can use that in the Control Variables "script" box to store the value to a variable.
The property you're looking for is $dataTilesets[n].name, where 'n' is the tilesetID.
But how do you give it the tileset ID 'n'? That's where $gameMap comes in. $gameMap has a function to call the tilesetID (for the current map). So your total script call will look like this:
$dataTilesets[$gameMap.tilesetId()].name
You can use that in the Control Variables "script" box to store the value to a variable.
I think it will be better if you solve your curiosity from another side.
Because the name of the tileset does not exactly define the map - especially on large game you often end up with dozens of different tilesets, and how do you determine then which tileset is of which type?
It would be much better if you set the info you want as notetag in all your map's noteboxes, and then use the meta function (see help file) to get that info directly, without trying to figure out the name of the tileset.
Because the name of the tileset does not exactly define the map - especially on large game you often end up with dozens of different tilesets, and how do you determine then which tileset is of which type?
It would be much better if you set the info you want as notetag in all your map's noteboxes, and then use the meta function (see help file) to get that info directly, without trying to figure out the name of the tileset.
What I'm trying to do is determine which maps would display weather effects and which would not. As of right now, I have Overworld, Outside, Inside, and Dungeon for my tilesets. I haven't really created any new ones (even though I need to eventually), so the script call is easiest for me. Checking the individual maps (almost 200 of them) would be much more time-consuming. I agree that semantically it's not awesome, but it works for the time begin.
I think you might have overthought your weather effect handling.
Usually weather effects are set by self-erasing parallel process on the map that have it, and removed on the transfer events that go off that map.
No need to check anything that way.
Usually weather effects are set by self-erasing parallel process on the map that have it, and removed on the transfer events that go off that map.
No need to check anything that way.
You'd have to keep track of the existing weather effect when you switch maps, though, right? Like from traveling from one outdoor map to another, or from an outdoor, to an indoor (where it gets turned off) and then back to the outdoor, where the existing weather resumes.
store that in a variable and have it checked when entering a map.
If that check is complex, write it in a common event and have that CE called by the parallel process that activates the weather effect.
And if you want a more complex weather simulation, you'll probably better off with a plugin.
If that check is complex, write it in a common event and have that CE called by the parallel process that activates the weather effect.
And if you want a more complex weather simulation, you'll probably better off with a plugin.
Original thread: https://forums.rpgmakerweb.com/threads/getting-the-tileset-name.76060/