I have a simple script which is getting the layer 1 tile ID via a variable, this is being set by a Get Location Info within eventing.
I'm then overriding several tiles with this tileID so that it has the same lower tile as stored in the variable. The code for doing that is:
This works absouletely fine, until it meets an autotile such as carpet or path at which point it paints in the tile as it was in the variable, which makes sense.
Working fine with grass
Less so when on the path
What I want to do is to work out how to get the non border version of the autotile and use that instead. Looking at the Tilemap class I can see what I think I need to call in the
so a TLDR; Trying to work out when I have a tileID alone, from a autotile generated tile, how to get the border free version of that autotile.
Realise this is also in the wrong forum, and probably is a little off learning JS
I'm then overriding several tiles with this tileID so that it has the same lower tile as stored in the variable. The code for doing that is:
JavaScript:
// Looping through the map
for(let x=0, w=$dataMap.width; x < w; x++){
for(let y=0, h=$dataMap.height; y < h; y++){
// Check the Variable is one we want to swap
var tileRegion = $gameMap.regionId(x,y);
if( tileRegion == 1 ){
// Swap the current map tile with our stored variable.
$dataMap.data[(1 * h+y) * w+x] = $gameVariables.value(8);
}
}
}
This works absouletely fine, until it meets an autotile such as carpet or path at which point it paints in the tile as it was in the variable, which makes sense.
Working fine with grass
Less so when on the path
What I want to do is to work out how to get the non border version of the autotile and use that instead. Looking at the Tilemap class I can see what I think I need to call in the
_drawAutotile() function but without knowing which bitmap to grab I can't see how to use it.so a TLDR; Trying to work out when I have a tileID alone, from a autotile generated tile, how to get the border free version of that autotile.
Realise this is also in the wrong forum, and probably is a little off learning JS