Making a "magic" bridge

Hi guys!

I have a problem that is blocking the operation of a puzzle. I gonna fully explain you so you can understand me well:
I'm creating a dungeon with puzzles based on an air element.
The thing is that when pushing a statue to a certain block, it must activate an "air bridge" that allows the player to cross to the other platform.
The mechanism of the statue and the data reading of its position to activate the bridge I know how to do it.

The problem is the bridge itself:
As the bridge is an "event" with the sprite of an animation, it is impassable by default because the event is on an impassable tile.
I solved this by making that when the player "touches" the event, it moves the player 5 steps to the left bypassing these impassable tiles.
So far so good, the problem is that the sprite of the bridge is above the player when it passes.
I thought "Oh good, I just put the event page" below "and that's it", but of course, now I can't touch the event when I get close to it, causing it not to activate and therefore getting stuck on the first platform.

How can I make the sprite below the player?
Or what other alternative do I have to be able to achieve what I am looking for?

Srry if my english is bad, If there is something that was not understood well, tell me and I will try to clarify it a little better.


1609561898552.png

1609561968798.png
how about making a clone tile (same image... in your case transparent image) to that unpassable tile but the cloned one is actually 'passable'... then to block the player from moving to that tile... you can place 'blocker' event with 'same as character' priority with no image... (this also will later transform as the walkable 'air' bridge)

then when the 'air' bridge 'activate' (maybe using switch)... change that 'blocker' event page to event page with 'below character' priority so player can walk on top of it... thus your player free to walk on top of the clone tile + transformed 'blocker' event and cross the bridge.

hope this help.
Incredible how it did not occur to me to clone or directly edit one of the tiles that I used to have a more transparent slot that is passable.

Thanks Estriole! I did it there and it worked perfect! :ahappy:
Try adding through ON with move route followed by Through OFF.
You can add a parrell event to check when bridge is on ( then each event using a switch to set as below character )
Thanks for the responses. I already figure it out with estriole solution.
But now I have 2 new problems, 1 is silly but the other one is a big problem:

The easy one (I hope so...) is when I move the statue to a place where it cannot move, even though it does not move, it still continues to reproduce the sound I placed when moving ... and it remains poorly polished.

But the main problem that I have now with this system of bridges and statues, is that when I leave the map and re-enter, the events return to their original position, and it makes the whole puzzle assembly screw up.

If it were a puzzle with only 1 single path, I could solve it with switches, making new events that supplant the original ones and are already active ... but the problem is that each statue has the possibility of activating different bridges, depending on where are placed, so it is impossible for me to choose to leave them immovable ...

Is there a way to make events remember their position on the X Y axis when re-entering the map?
Thanks for the responses. I already figure it out with estriole solution.
But now I have 2 new problems, 1 is silly but the other one is a big problem:

The easy one (I hope so...) is when I move the statue to a place where it cannot move, even though it does not move, it still continues to reproduce the sound I placed when moving ... and it remains poorly polished.

But the main problem that I have now with this system of bridges and statues, is that when I leave the map and re-enter, the events return to their original position, and it makes the whole puzzle assembly screw up.

If it were a puzzle with only 1 single path, I could solve it with switches, making new events that supplant the original ones and are already active ... but the problem is that each statue has the possibility of activating different bridges, depending on where are placed, so it is impossible for me to choose to leave them immovable ...

Is there a way to make events remember their position on the X Y axis when re-entering the map?
without plugin... there's a way... although not too easy... first you need to store all 'statue' event position x and y to each variables in ANY EVENT that make you EXIT the room... let's say for example you have 4 statue. then you need 8 variable to store x and y.
ex:
var 113 => statue A x coordinate
var 114 => statue A y coordinate
var 115 => statue B x coordinate
var 116 => statue B y coordinate
and so on...

second create this event with these pages:
page 1: autorun -> set all the 'coordinate' variable to -1 then flip a switch ON (to flag this is not the first time you nter this room let's call it NotFirst).

page 2: autorun with above NotFirst Switch turned ON condition ->
do some conditional check IF a statue X coordinate variable > 0 AND IF the same statue Y coordinate variable > 0... you can do that using nested conditional branch event command.
if YES then move the first statue coordinate to that variable x and y position using Set Event Position event command.
do all check with ALL statue... and at the end ERASE this event using "Erase Event" Event Command
(so it will run again after reentering the room).

but if you want easier version you can use plugin ... unfortunately in MZ only VisuStella Events and Movement Core that have that feature as far as i know... It's Tier 1 plugin so it's should be free (grab it from their demo)...

hope this help.
You can u use yanflys save events location plugin n tag save event location done. Not sure about mz though.
To make the sound play only when the statue moves, you can use Conditional Branch > Script:
  • Check whether the character can move before applying move routes:
    JavaScript:
    const c = this.character(0); c.canPass(c.x, c.y, $gamePlayer.direction())
  • Or check whether the move was successful after moving:
    JavaScript:
    this.character(0).isMovementSucceeded()
    Note that for this one you need to wait 1 frame before checking, because move routes process 1 command per frame. The event might look like this:
    Spoiler: Event example
    Code:
    ◆Comment:Apply move routes
    ◆Set Movement Route:Player (Skip)
    :                  :◇1 Step Forward
    ◆Set Movement Route:This Event (Skip)
    :                  :◇Move away from Player
    ◆Comment:Wait 1 frame for move route to start
    ◆Wait:1 frame
    ◆Comment:Check for successful movement
    ◆If:Script:this.character(0).isMovementSucceeded()
      ◆Play SE:Push (10, 90, 0)
      ◆Show Balloon Icon:Player, Sweat
      ◆
    :End
Note that if you use a tile image for the event, that event page will use the tile's passability. There's no option (at the moment) to use animated tiles for this, though, so your workaround is probably the best option here. 😴

Saving event locations: there is VisuStella Events & Movement Core, as mentioned. If you want an alternative, I also have a free plugin for that (and other things)...just add a <save> tag to the event's little Note box. Plugin link: view/download Cae_MapEvents (Google Drive). (There are probably other options available because saving event locations is helpful and not very difficult to code.)
To make the sound play only when the statue moves, you can use Conditional Branch > Script:
  • Check whether the character can move before applying move routes:
    JavaScript:
    const c = this.character(0); c.canPass(c.x, c.y, $gamePlayer.direction())
  • Or check whether the move was successful after moving:
    JavaScript:
    this.character(0).isMovementSucceeded()
    Note that for this one you need to wait 1 frame before checking, because move routes process 1 command per frame. The event might look like this:
    Spoiler: Event example
    Code:
    ◆Comment:Apply move routes
    ◆Set Movement Route:Player (Skip)
    : :◇1 Step Forward
    ◆Set Movement Route:This Event (Skip)
    : :◇Move away from Player
    ◆Comment:Wait 1 frame for move route to start
    ◆Wait:1 frame
    ◆Comment:Check for successful movement
    ◆If:Script:this.character(0).isMovementSucceeded()
    ◆Play SE:Push (10, 90, 0)
    ◆Show Balloon Icon:Player, Sweat
    ◆
    :End
Note that if you use a tile image for the event, that event page will use the tile's passability. There's no option (at the moment) to use animated tiles for this, though, so your workaround is probably the best option here. 😴

Saving event locations: there is VisuStella Events & Movement Core, as mentioned. If you want an alternative, I also have a free plugin for that (and other things)...just add a <save> tag to the event's little Note box. Plugin link: view/download Cae_MapEvents (Google Drive). (There are probably other options available because saving event locations is helpful and not very difficult to code.)
i haven't seen other people plugin beside VisuStella that save event position... but i only search this forum though 😀...
does your plugin posted in this forum? if not yet can you post the plugin there 😀...
since i think people always need 'alternative' plugin beside VisuStella... because sometime other people plugin conflict with VisuStella plugin and now it's harder for people to make compatibility patch with VisuStella because obfuscation... so 'alternative' plugin would be helpful 😀...
does your plugin posted in this forum? if not yet can you post the plugin there 😀...
👋 You can find my RMMZ plugins here:
(I have links on my profile's About page and in my signature, but I guess people don't check those...)

Original thread: https://forums.rpgmakerweb.com/threads/making-a-magic-bridge.131716/