Make an event get the appearance of the tile below

Hey people !

I'm looking for a way to change an event's appearance based on the tile it's on !
I believe it can't be achieved without a bit of scripting, but I don't know how to retrieve the sprite from a tile and change an event's appearance in RGGS3.
How can I do something like this, if it's possible ?
I have a problem understanding the question. Can you elaborate? it might be better with image mockup.
Alright ! I'm doing some kind of chase sequence in my game using some big spider character.
It looks like this :


1577712929313.png

Thanks to another person on the forums, I've learned how to anchor the character at its center, and the chase event itself works. There's just an aesthetic problem when the spider follows me too close to the walls :


1577713398440.png

​

I've tried to find ways to fix that, by incorporating the wall in a tileset and display it above the player, for example, so the spider's legs would also be underneath the walls, and then block the player from going down underneath that wall, but it only works if the spider's Event Priority isn't Above the player, which it has to be, unfortunately.

I think that the most accessible workaround would be to use Above the Player events looking like the walls that would have a higher ID than the spider event, so they would be displayed above its legs.
Problem is, I don't want to make several hundreds of wall events to fix every tile one by one, so I thought of a system that would check if the spider is nearing a wall, then move events looking like the walls around it (walls would be determined based on a specific region id), so it would look like this :


1577715213354.png


But this would also work :

1577715229325.png


And that, as well :

1577715243730.png

So if I were to move events around the spider as it is approaching walls, they would have to look like the wall they're moved onto, so the spider's legs are displayed below the walls but the walls don't look weird.
I've fiddled with scripts enough to know how to do the first part, with the movement of events based on another event, but I don't how I can use script calls to change an events appearance based on what tile it's standing on, if it's even possible.

Or, if you have any other ideas for workarounds, that's cool too !
I hope it's easier to understand now, thanks for your help !
I hope it doesn't count as necroposting, but I have found the solution myself after looking around in the game's base scripting, so I'm adding it here in case some people with the same problem find this post.
To make it so one event displays above all other events (including other Above the Player events), you have to find your event's ID, and use this script call :

Ruby:
$game_map.events[id].instance_variable_set(:@priority_type,2.1)
Where you replace 'id' with the actual Event ID.

Explanation : Event Priorities are stored as numbers (0 for Below the Player, 1 for Same as the Player, 2 for Above the Player). This code snippet gets the event you want and changes its priority to 2.1, which is a bigger number than 2. Consequently, this event will be considered higher on the z-axis by the game, and will therefore be displayed above all other events.

If you create another event which has to be displayed above all other ones, including the one of priority 2.1, just use the same code but replace 2.1 by any bigger number.

Original thread: https://forums.rpgmakerweb.com/threads/make-an-event-get-the-appearance-of-the-tile-below.116741/