How do you make a bridge over a damage tile?

I need some help with a puzzle I’m making regarding damage tiles.

To put it short, I wanted to make a puzzle of sorts where you must push a boulder unto a poison tile, to whcih it turns into a bridge tile, and then you can cross over it without taking damage. But no matter how I do it, my characters still take damage when they cross it.

I tried looking for tutorials on how to circumvent this, but most I could find don’t really align with what I’m trying to do. Anyone here could lend me some help?

rpg_objects.js, line 5987. This is the code we need to figure out how to modify

Game_Map.prototype.isDamageFloor = function(x, y) {
    return this.isValid(x, y) && this.checkLayeredTilesFlags(x, y, 0x100);
};

You could save the above as a .js file and install it as a plugin, it will override the normal functionality with whatever you wrote in your plugin

So now the trick is to figure out how you want to tell the game that this poison tile is no longer a poison tile. Adding a check if there’s a below-layer event on it will be incompatible with any cutscene events that you happen to locate on top of a poison tile. Of course, you could also avoid having any events on a poison tile to avoid that oversight from happening.

So if you wanted your game to say if any event is on a poison tile, it is no longer a poison tile, this is the code you want to save as a .js and install as a plugin. Be aware this has potential to lag your game on maps with a large number of events!

_aliasIsDamageFloor = Game_Map.prototype.isDamageFloor;
Game_Map.prototype.isDamageFloor = function(x, y) {
    return _aliasIsDamageFloor.call(this, x, y) && this.eventsXy(x, y).length == 0;
};

I think I kind of end up faking the damage tiles with events. With VXAce and onwards you can have one event checking if you’re over a specific region, and if you are apply damage. Then for the place where you want to drop a bridge, make that part of the logic of the bridge. If the bridge is set and you fall there, don’t do damage, else apply damage.

I’m sure you can work it out better through code, but yeah when I need a quick and dirty solution I just do that.

I think this is a little misleading. It’s true, technically speaking, but the scene isn’t refreshed all that often – as far as I know, only if you go to a different scene and return (eg a battle, opening the menu, etc).

What this means in practice is that if you need the bridge to change back into a damage tile later, it won’t work properly. If you only need a one-way conversion though, this approach should be fine.