Run event on tile adjacent to wherever the player may be?

Hiya!

So my goal here is to create a convincing Legend of Zelda-ish sword extension. Not quite what RM is intended for but I keep thinking there must be a way to do this.

Basically, if the actor is pointing left, a button activation would call a common event showing the extension of the sword in that direction. So if the player is facing left, it'd show the left-facing sword graphic on the tile immediately to the players left. And the same for right, up and down.

In general I'm just not sure how you might have a "portable" event like that, that could be created on the fly on a tile adjacent to the player. I feel like there must be a way to do it by querying the player's grid location but even if I could figure that out, I wouldn't know how to query the player's direction, let alone have an event happen on a tile where there's no event.

Any thoughts at all would be very much appreciated -- thanks!  😀
Is this event supposed to make the sprite look bigger?  If so, why not just have two versions of the sprite - a regular one, and one with the sword extended, and have your common event switch around the actor graphic briefly and then switch it back again?

You COULD use an event, but the problem with that (apart from getting the logic working, which we could certainly help you with) is that you'd need to "reserve" a dummy event on every single map where you want to be able to do this, and that event would have to have the same event id on every map.
Iiiinteresting ... yes it's just supposed to make the sprite wider. I suppose I haven't experimented much with that. So it's possible to create a sprite that's simply wider? I wonder, would switching the sprite cause it to go off-center momentarily, since the center of the new wider sprite would be offset?

Feels like something I should do some more research on. Thanks for the push in the right direction!!
Absolutely you can do that.

Take your regular sprite and put it into its own spritesheet - just a single character, and save it with a $ at the start of the filename.  Make it wider and longer, and then space out the rows and columns evenly, so your sprites are all still in the center of the cell horizontally.  Save it as two different files.  In one version, add your sword images.  Because you've got them spaced out the same way, there will be no issues with it going off center when you switch between them.  It just means your "without sword" sprite will have a lot of whitespace on the sides and above the character, but that's fine, because it won't be visible to the player, and it won't affect collisions or gameplay in any way.
That's awesome -- did not know I could do that. Thanks again!  👍

Original thread: https://forums.rpgmakerweb.com/threads/run-event-on-tile-adjacent-to-wherever-the-player-may-be.52637/