I'm using RPG Maker MV (actually, also RPG Maker MZ) and I’d like some help with the following:
I want tiles from group A (A1 to A5) to be drawn above the player only when they are marked with a specific region, in this case region 255.
I’ve already managed to make the passability work, but what I’m trying now is to make those same tiles appear graphically above the hero, as if they were on an upper layer, even though they’re from group A.
I tried adapting this using AI-generated plugins in all sorts of ways, but it didn’t work. Below is my current code, which only handles passability.
I want tiles from group A (A1 to A5) to be drawn above the player only when they are marked with a specific region, in this case region 255.
I’ve already managed to make the passability work, but what I’m trying now is to make those same tiles appear graphically above the hero, as if they were on an upper layer, even though they’re from group A.
I tried adapting this using AI-generated plugins in all sorts of ways, but it didn’t work. Below is my current code, which only handles passability.
JavaScript:
/*:
* @plugindesc Libera passabilidade para tiles A marcados com uma Região específica. (Apenas função de passagem)
* @author ChatGPT
* @param RegionID
* @type number
* @default 255
* @desc Região que ativa a passagem livre.
*/
(function() {
const parameters = PluginManager.parameters('FixWithRegion'); // Nome deve ser o mesmo do arquivo .js
const REGION_ID = Number(parameters.RegionID || 255);
// Permite passagem onde houver a Região definida
const _Game_Map_checkPassage = Game_Map.prototype.checkPassage;
Game_Map.prototype.checkPassage = function(x, y, bit) {
if (this.regionId(x, y) === REGION_ID) {
return true;
}
return _Game_Map_checkPassage.call(this, x, y, bit);
};
})();