BishoujoHelper

Veteran
Veteran
Joined
May 6, 2017
Messages
54
Reaction score
46
First Language
English
Primarily Uses
RMMV
Apologies if this is necro-posting, but I'd like to get this working too. I'm also getting the "never goes invisible" on the demo project, but my F8 console log is clear - EXCEPT that the Network tab shows the same error messages in a different format yet they don't appear on the console. The 3 pixi files are where they're supposed to be in the demo's lib/js folder.

I know too little of Javascript to be sure, but a validator didn't like the ";" missing after "
Tilemap__paintTiles.call(this, startX, startY, x, y);
}
".
And after some digging in rpgcore.js and rpgobjects.js, and some crashes from trying this._regionId as a substitute, I can't figure out how the temp_mx and temp_my values are getting updated in the Tilemap__isHigherTile portion, as only tileID is being passed in.

Could we get a plugin guru to look at this, please? mykrme has been AWOL since January 10, maybe died in his sleep. ;L
 

Izimori Anahuyu

Villager
Member
Joined
Feb 3, 2013
Messages
24
Reaction score
2
First Language
Canadian
Primarily Uses
RMMV
Can a tile's region be changed mid-game?
It'd be nice to go behind a wall, and then later be walking on top of it.
 

luizcubas

Veteran
Veteran
Joined
Oct 7, 2015
Messages
30
Reaction score
59
First Language
Pt-BR
Primarily Uses
RMMV
I made some little adjusts, check if its working properly.
Code:
/*:
 * @plugindesc    The SecretPassage plugin allows you to make an otherwise impassable tile passable through the use of regions.
 * @author    mykrme
 *
 * @param    Passable
 * @desc    The region number used for a secret passage - always passable.
 * @default    1
 *
 * @param    Impassable
 * @desc    The region number used for the surroundings of a secret passage - always impassable.
 * @default    2
 *
 * @param    Invisible
 * @desc    The region number used for a secret passage - always passable. Character is invisible.
 * @default    3
 *
 * @help 
 */
var settings = PluginManager.parameters("SecretPassage");
var passable_region = parseInt(settings["Passable"]) || 1;
var impassable_region = parseInt(settings["Impassable"]) || 2;
var invisible_region = parseInt(settings["Invisible"]) || 3;

var _Game_Map_checkPassage = Game_Map.prototype.checkPassage;
Game_Map.prototype.checkPassage = function(x, y, bit) {
    var region = $gameMap.regionId(x, y);
    switch (region) {
        case passable_region:
        case invisible_region: return true;
        case impassable_region: return false;
        default: return _Game_Map_checkPassage.call(this, x, y, bit);
    }
};

var ShaderTilemap__paintTiles = ShaderTilemap.prototype._paintTiles;
ShaderTilemap.prototype._paintTiles = function(startX, startY, x, y) {
    this._temp_mx = startX + x;
    this._temp_my = startY + y;
    this._tileId_below = this._readMapData(this._temp_mx, this._temp_my + 1, 0); // only checks A type tiles
    ShaderTilemap__paintTiles.call(this, startX, startY, x, y);
}

var Tilemap__isHigherTile = Tilemap.prototype._isHigherTile;
Tilemap.prototype._isHigherTile = function(tileId) {
    var currentTile_invisibleRegion = this._readMapData(this._temp_mx, this._temp_my, 5) == invisible_region;
    var tileOneBelow_invisibleRegion = this._readMapData(this._temp_mx, this._temp_my + 1, 5) == invisible_region;
    var playerStandsBelow = $gamePlayer._realY > this._temp_my;
  
    if (!tileOneBelow_invisibleRegion && playerStandsBelow) { // to show the hat tops
        return Tilemap__isHigherTile.call(this, tileId);
    }
    if (currentTile_invisibleRegion) {
        return 0x10;
    }
    if (tileOneBelow_invisibleRegion && Tilemap.isSameKindTile(tileId, this._tileId_below)) { // to hide the hat tops
        return 0x10;
    }
    return Tilemap__isHigherTile.call(this, tileId);
};
 
Last edited:

DragonVine

May or May Not be Batman
Veteran
Joined
Jun 17, 2014
Messages
350
Reaction score
386
First Language
English
Primarily Uses
Holy cow, it works now! Well done dude. I'm going to compare it to the original so that I can see what changes you made. Might help me learn a little JavaScript haha.

EDIT: Is there a way to add another region function? Say for region 4 that switches off the the passibility effect so the passage than can be walked on? i.e. a bridge. So you can walk below the bridge using region 3, then climb some stairs and hit a region 4 allowing you to walk on top of the bridge, then walk down a set of stairs on the other side, walking on top of a another region 4 that then allows you to go under the bridge again?
 
Last edited:

luizcubas

Veteran
Veteran
Joined
Oct 7, 2015
Messages
30
Reaction score
59
First Language
Pt-BR
Primarily Uses
RMMV
Hey @DragonVine, I'm glad it worked for you.

Sure it's possible, I'm kinda busy developing other stuff in my project in next weeks, but that would be a nice feature.

When it's done I'm gonna share in this post.
 

Latest Threads

Latest Profile Posts

2dfloor.png
What a fun tileset I've got here so far!
Minecraft Tiles, Maid Day, Custom Menu, Retry at GameOver, Save in Appdata | RPG Maker News #36

side view special bust.png
Reworking the art for the 'special busts' in important game dialogue. Potentially replacing the more 'dead-on' look of the original:
original.png
Me: Imma work on my game! Let's get some progress done
Me, five minutes later smoking a cigarette: *screams into the void*
Just got back from work... I got to recommend a dish I liked to a group of senior ladies, and they said they'd order it for dessert! What was it? CHURROS! It's one of my favorite desserts at my workplace.
What's your favorite dessert? I'll eat any pastry with cinnamon and sugar, but especially churros. And then there's chocolate... omg, so good!

Forum statistics

Threads
111,262
Messages
1,059,652
Members
144,542
Latest member
codyquakenbush
Top