Changed boolean && to bitwise & (woops)
Spoiler
// Added by GIL 2016.02.26
Game_Character.prototype.four_way = function(code) {
this.fourway = code;
}
var GIL_Game_Map_checkPassage = Game_Map.prototype.checkPassage;
Game_Map.prototype.checkPassage = function(x, y, bit) {
var ev = this.eventsXy(x,y)[0];
if (ev && ev.fourway) return ev.fourway & bit;
return GIL_Game_Map_checkPassage.call(this, x, y, bit);
};
Game_Character.prototype.four_way = function(code) {
this.fourway = code;
}
var GIL_Game_Map_checkPassage = Game_Map.prototype.checkPassage;
Game_Map.prototype.checkPassage = function(x, y, bit) {
var ev = this.eventsXy(x,y)[0];
if (ev && ev.fourway) return ev.fourway & bit;
return GIL_Game_Map_checkPassage.call(this, x, y, bit);
};
Now it works just like the tileset 4-way passage options only you can set it on any event tile and dynamically change the passage options as desired. Have to use my handy binary table in previous post to determine what number to pass into the function to set the desired directions. URLD standing for Up Right Left Down. Coincidentally my bits were set the same way that checkPassage bit works so that was fortunate. I'll likely start a separate thread once I get a nifty bridge puzzle working to demonstrate.