Hello all,
I have been at this a few hours now, and I am at my wit's end. I have been trying to find a script call that returns the passability of the tile that the player is currently standing on. I am aware of the existence of the very handy: $
but the issue is with the direction parameter. It only allows for the checking of tiles at least one away from the player without causing issues. If I try to correct it by adding or subtracting from the x or y values then it can trigger when I don't want it to. For example:
The intended use is clearly to jump up one tile at a time if the player is stuck on the current tile until they are in the clear using a parallel process. However, if the player were to have their back to the wall below or an npc would pass behind them they would still jump forward as soon as they became adjacent to the tile. I understand the logic behind that since the player's y value plus one still fails the passability check when going forward. I hope I'm just dumb and there is a simple solution to getting the passage type for the current tile or something like that, but I can't seem to find a solution. Thanks for the help!
I have been at this a few hours now, and I am at my wit's end. I have been trying to find a script call that returns the passability of the tile that the player is currently standing on. I am aware of the existence of the very handy: $
JavaScript:
$gamePlayer.canPass(x,y,dir)
JavaScript:
if($gamePlayer.direction() == 8) {
if(!$gamePlayer.canPass($gamePlayer.x, $gamePlayer.y+1, 8)) {$gamePlayer.jump(0,-1)}
}