Hey, so this:
$gameMap.terrainTag($gameVariables._data[71],$gameVariables._data[72]) == 7
Checks the terrain tag of tile XY (where x = variable 71 and y = variable 71)
How do I check the tile's collision? I want to check if the specific tile has a collision or not 🙂
You could Paint a Region ID as collision indicator. Than you check if the target destination got Region ID1 or not.
Terrain Tag could also work, but i liked Regions better, or combine both of them.
The 3rd one could be a Range of Event Ids on that Position, for example Events 1 to 30 are collision Events.
Depending on what you need it needs different approaches.
Can't I just ask in JS if that particular tile has a collision or not? I mean, the info has to be stored somewhere?
Hi!
If when you mean collision, you mean if the player can walk above the tile, you can check with the script call:
$gameMap.isPassable(x, y, direction)
It will return true if the player can walk through these tiles in the specified direction.
Just what I needed! Will direction accept the up/down input or the numeric value of the directions?
This worked like a charm, thank you!
Necro, but I need to upgrade this.
$gameMap.isPassable(x, y, $gamePlayer.direction()) seems to only work for the map collisions.
What about if I want to check for all collisions? Not just the map, but also collisions with all other events that are on the "Same as player" priority?
Yep, it's defined for all characters. Just swap $gamePlayer for the appropriate character reference, e.g. $gameMap.event(5). 🙂