RMMZ Tile passibility changes?

Ahuramazda

Veteran
Veteran
Joined
Nov 9, 2012
Messages
262
Reaction score
128
First Language
English
Primarily Uses
RMMZ
In RPG Maker MV I was using the same tileset with the same exact setup as I'm testing in MZ, but unlike the MV version I can no longer walk on top of my outdoor cliff areas properly.

In MV I was able to move around on top and not walk over the sides at all, which is the way I was expecting it to be this time, but when I set up a testing area, this is what I get instead:

1597955882476.png

the red lined areas block pathing as you would expect, but I can walk through anything with the blue-ish lines like there is no sides there at all. If i put the passibility to an X in the database then I cannot walk on the areas in question at all :/

Back in MV there was a code snippet used to fix this same issue:
Code:
Game_Map.prototype.checkPassage = function(x, y, bit) {
    var flags = this.tilesetFlags();
    var tiles = this.allTiles(x, y);
    for (var i = 0; i < tiles.length; i++) {
        var flag = flags[tiles[i]];
        if ((flag & 0x10) !== 0)  // [*] No effect on passage
            continue;
        if ((flags[tiles[i]] >> 12) === 1) // EDIT - Added to make it so you cannot walk off cliff edges.
            continue;
        if ((flag & bit) === 0)   // [o] Passable
            return true;
        if ((flag & bit) === bit) // [x] Impassable
            return false;
    }
    return false;
};

and the code for MZ is also identical besides the updated syntax/commands/whatever it may be called:
Code:
Game_Map.prototype.checkPassage = function(x, y, bit) {
    const flags = this.tilesetFlags();
    const tiles = this.allTiles(x, y);
    for (const tile of tiles) {
        const flag = flags[tile];
        if ((flag & 0x10) !== 0) {
            // [*] No effect on passage
            continue;
        }
        if ((flag & bit) === 0) {
            // [o] Passable
            return true;
        }
        if ((flag & bit) === bit) {
            // [x] Impassable
            return false;
        }
    }
    return false;
};

I'm wondering if there is a way to do the same check as the edited MV snippet, or how I could go about finding the same effect because copy/pasting in the added section has no effect on the cliffs when testing.



EDIT: I have no idea how/why, but I closed my RPG Maker MZ and reopened it after triple checking my settings in MV and now its working the way I was expecting in MZ without changing anything, so maybe some kind of bug or something o_O I am completely confused as to what happened.
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,894
Reaction score
14,526
First Language
English
Primarily Uses
RMMV
Are you mapping using autolayers or manual layers? I believe what you're seeing is the default behaviour of those autotiles, but I'd have to experiment to make sure. Passability on autotiles does not rely purely on the X and O - those "upper" tiles have special passability that you can't modify, that determines whether you can go on them from different directions. The only reason it works where the red lines are is because of the cliff faces below them.

That snippet (which I provided) had nothing to do with autotile passability. It was to fix a different issue where you used an O tile on top of the cliff edges (that were impassable when you didn't have another tile on top) and it would allow you to walk off the edges.

Is your top left B tile set to a star for passage?
 

Ahuramazda

Veteran
Veteran
Joined
Nov 9, 2012
Messages
262
Reaction score
128
First Language
English
Primarily Uses
RMMZ
I was using manual layers and at the time of the issue was even trying putting small 3x3 sections of the cliff tops side by side and was walking across all of them regardless of layers. I've been using the program flawlessly since I did that restart and I still am clueless as to what happened and cannot get it to reproduce.

The B tiles were set right (star in top left). And I'm glad you knew where that snippet came from, because it had been so long I had actually forgotten exactly what it was for, lol.

Testing: now that you reminded me of what that was for it seems MZ has the same thing in it for being able to walk off a cliff tile if there is a B-E passable tile on the top of it (but not if its on the "bottom edge" of the cliff)
Untitled-2.pngUntitled-3.png

1597971325090.png
(not making 1 more screenshot to show it has 4 way passability on that dirt clod tile, lol)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,894
Reaction score
14,526
First Language
English
Primarily Uses
RMMV
Yes, I fully expected that.

You could create your own .js file with a similar snippet for MZ:

Code:
Game_Map.prototype.checkPassage = function(x, y, bit) {
    const flags = this.tilesetFlags();
    const tiles = this.allTiles(x, y);
    for (const tile of tiles) {
        const flag = flags[tile];
        if ((flag & 0x10) !== 0) {
            // [*] No effect on passage
            continue;
        }
        if ((flag >> 12) === 1) { 
            // [Terrain 1] No effect on passage
            continue;
        }
        if ((flag & bit) === 0) {
            // [o] Passable
            return true;
        }
        if ((flag & bit) === bit) {
            // [x] Impassable
            return false;
        }
    }
    return false;
};

(yay - my first MZ plugin :D)

however note that this might not work with other plugins that change passage settings - anything with pixel movement, maybe region restrictions, etc.

Glad you got the first issue sorted out though - sounds like an editor glitch.
 

Jragyn

JABS codemonkey
Veteran
Joined
Aug 14, 2012
Messages
142
Reaction score
125
First Language
English
Primarily Uses
RMMZ
Heya Shaz (and OP)!
I see the issue was resolved, AND it was over a half year that this was originally posted...

But I was running into a similar issue when trying to code up the knockback functionality for JABS where some autotiles were marked with X, but you could still pass over them because the middle portion of the autotile was default passable.

Thanks to the code snippet above (for the sake of my work at least), giving a tiny little snippet along with a bit of context, has resulted in resolving my problem! Granted, this doesn't solve the underlying problem with autotiles seemingly having mandated passable/impassable functionality, but I've been bashing my head against the wall for months trying to fix it in any capacity. (unfixed = knocking enemies back on the map will result in hitting them into unreachable locations)

So, thank you both!
 

Latest Threads

Latest Posts

Latest Profile Posts

Yesterday I went to get some new jeans for my new job... and discovered I'm a plus size. I'm planning on dieting so I can get back to where I was before 2020. I decided on a Japanese food diet because the recipes I can cook at home are both low-calorie and delicious.
Did you ever had the wish to become a carpenter?
:kaojoy:Here comes a better driver AI. I sent some monks to pacify angry car drivers who previously just run over people without any consideration of life.
(Sorry, no English version of the video this time.)
Another character battle theme

Forum statistics

Threads
110,500
Messages
1,053,790
Members
143,596
Latest member
phantomgalaxy
Top