Lyra's "Out Of My Way!" (NPCs can push & shove the player)

Out Of My Way!
excuseme.png
​
Ever had your NPCs on a nice custom move route, but then the player just stands in the way and screws up your whole perfectly-timed scene? Want a solution other than freezing the player? Why not let the NPCs push the player around! You could do it with a lot of eventing and by setting their trigger to "Player Touch", but then they wouldn't be able to also have normal dialogue interactions, so I came up with this plugin to help.

How to Use
Add the .js file to your project's js/plugin folder, then open up the plugin manager in the editor and add the plugin.
There's general help to the left side and specific settings help if you double-click on them.
There are settings to set a Common Event to trigger when the different types of forced movement happen.
There are settings to toggle "safe mode" for the different types of forced movement. Safe mode will prevent that movement if there are any events in the square the player would be moved into, even ones with Through ON. Useful to not get swapped into invisible triggers.

Once you've added the plugin, simply add any of these tags to an event's note box:
  • <swapPlayer> If the event wants to enter the player's space, will attempt to swap places with them in order to keep moving.
  • <pushPlayer> If the event wants to enter the player's space, will attempt to move the player one step forward in the direction the player is facing. Only triggers if the player is NOT facing the event, so you can still stop them and talk to them easily.
  • <shovePlayer> If the event wants to enter the player's space, will attempt to push the player one step forward in the direction that the event is facing.
  • <movePlayer> If the event wants to enter the player's space, it will attempt to swap, push, then shove in that order.
  • <rudeMovePlayer> If the event wants to enter the player's space, it will attempt to push then shove in that order. It will never swap.
You can also add one or more of these tags in addition to one above to modify the behaviour:
  • <mustFace> Make the event only able to move the player when the event is facing them (will stop move routes that are trying to turn a corner).
  • <politeMove> Prevents swaps or shoves if the player is facing the event (push already works like this). Useful for NPCs that you need to talk to.
  • <dashOnly> Will make the swap/push/shove only happen if the player is dashing and the event walks into the player.
  • <walkOnly> Will make the swap/push/shove only happen if the player is NOT dashing and the event walks into the player.
  • <dashPlyForce> Will force the swap/shove to happen if the player dashes into the event.
  • <dashPlyPass> The event won't block collisions if the player is dashing.
Example video of swap and shove
Example video of push
(the "Excuse me!" text is from a common event calling this plugin)

Note to VisuStella Users
If you use VisuStella's Events and Movement Core and give an event a Move Route Custom Command that involves heavy pathfinding (such as Move To: x, y) then you may sometimes get strange results where you are getting pushed from nowhere. Try adding the <mustFace> tag to help alleviate this. Due to VisuStella being obfuscated, there is little I can do to mitigate this.

Performance Notes
This adds extra calculations to RPG Maker's default pathfinding, so it may contribute to lag on very large maps with lots of events.
This will only work with orthoganal movement and doesn't take into account diagonals. Diagonals would be even more expensive to calculate!

Terms of Use
You can view the license here. In short, it is free for commercial or non-commercial use. Credit is optional as long as you don't claim it as your own work.

Downloads
You can download just the plugin here. Press the 'Raw' button then Ctrl+S to save it.
urgh ok im gonna finish what i have on MV And Jump On the MZ bandwagon A.S.A.P! Great mod!
I've actually thought of having something like this in the past when I wanted to add more behavior to my pedestrian NPCs, but rather having the player be the rude one pushing people out the way when trying to move (HEY I'M WALKIN' E'RE!) so far I just have them on the through command so there is alot of easy flow.

I'll give this a test run but I'm going to expect a few unusual things due to having custom move route scripts.
I've actually thought of having something like this in the past when I wanted to add more behavior to my pedestrian NPCs, but rather having the player be the rude one pushing people out the way when trying to move (HEY I'M WALKIN' E'RE!) so far I just have them on the through command so there is alot of easy flow.

I'll give this a test run but I'm going to expect a few unusual things due to having custom move route scripts.
Let me know how it goes or if you find any odd behaviour. Happy to add some more tags if there's something you feel is missing 🙂
Might be a selfish request, but may I suggest an additional option that makes NPCs budge out of the actor's way when moving- irregardless if the event is in through mode?
The reason behind this is to break off that momentary wait inbetween actions because of the solid events but to make it seem as if the event is being pushed faster, I'm still testing 😛
Oh, you mean like force the NPCs to take a step forward (no matter the Through setting) if they are in the Player's way?
will this work in MV? is it is pretty neat to have those different stuff.
nice plugin otherwise 🙂
I wrote it for MZ (since that's what I use), however I have not tried it in MV. I'm busy for a few days but when I can I'll check it out. If you want to try it in MV in the meantime feel free!

EDIT:
@ShadowDragon tested it on MV quickly before I went to bed. Ran fine with no crashes and the NPC swapped happily. Seems promising!
@LyraVultur that's great to hear =)
I will test later how things works, as it can be really usefull at some
parts of the game and cutscenes.

thanks for trying it out on it.
I'm not using VisuStella's Events and Movement Core but using my own script to give some of my events custom move route.

Will test this.
@LyraVultur may I request a small feature on this nice plugin?
as the notetag <shovePlayer>, <swapPlayer>, <pushPlayer>,
<rudeMovePlayer> etc works, and read the text from the parameter,
this is fine and everything, but would it be passible to add something
like this:

<rudeMovePlayer> = default parameter text
<rudeMovePlayer: "overwrite text"> to say something else?

so each npc that is rude can say something else
<rudeMovePlayer: "your in my way freak">
<rudeMovePlayer: "Hé! watch it man!">
<rudeMovePlayer: "Loser! Keep your eyes open next time!">

to give some samples, it's not specific usefull on all tags, but this
one seems a nice fit.

or if they are friendly "sorry, my bad", "won't happen again", or something
at random in the parameter with [option 1, option 2, option 3 etc].
which might be easier, but if you are able for the 1st 3 samples, it would
be amazing feature 🙂
@LyraVultur may I request a small feature on this nice plugin?
I wasn't planning on adding this -- that's what the Common Event on Swap/Push/Shove in the plugin settings are for. You could call a common event that uses a plugin such as this and some variables to pull it off.
that is for MZ which dont work in MV 🙂
but I can see if I can get it to work if I can target the events
if possible to pull it off nicely.

if some dev uses alot of npc's in town, it could be a nice touch 🙂
but I see what I can do with it.
I have a suggestion which could add great effect.

What if there was the option to have sprinting result in a rude swap?
So if you're running into someone they complain about it?
I have a suggestion which could add great effect.

What if there was the option to have sprinting result in a rude swap?
So if you're running into someone they complain about it?
Updated to version 1.2, added the following tags:
  • <dashOnly> Will make the swap/push/shove only happen if the player is dashing and the event walks into the player.
  • <walkOnly> Will make the swap/push/shove only happen if the player is NOT dashing and the event walks into the player.
  • <dashPlyForce> Will force the swap/shove to happen if the player dashes into the event.
  • <dashPlyPass> The event won't block collisions if the player is dashing.
If you want different effects if the player is dashing (like complaining), you can check in the common event if the player was dashing with $gamePlayer.isDashing() inside a Conditional Branch.

EDIT: now v1.21, fixed a bug where the shove tag would let you pass if you were dashing no matter what.
I'll have to give this another test run soon as I get all my urgent fixes done thanks for the update.
Hi! Your plugin is great and I have one question.

I want the event to shove the player more than one tile and also bypass any non-walkable tile. How could I do this? Thank you!
I want the event to shove the player more than one tile and also bypass any non-walkable tile. How could I do this? Thank you!
Thanks for liking my plugin! I have just updated the plugin to version 1.3:
  • you can give an NPC the <unsafePush> tag to let them push/shove the player, ignoring collisions.
  • you can give an NPC the <pushLength: x> tag to let them push/shove the player x tiles instead of the normal 1. Just replace x with a number.
Hope this helps! The <pushLength: x> looks a bit strange visually, so I will hopefully have time to update it in the future to look nicer.
Thank you so much!! You are very, very kind for adding these functionalities to your plugin.
♡\( ̄▽ ̄)/♡
I'm using it to make an event shove the player so they can bypass non-passable tiles. I look forward to the improved pushLength animation!

I have tested the plugin and everything works! But.. it seems to be incompatible with the Rosedale Collision Altering Plugin's pixel movement option.

It's fine though!! Because for now I just put your plugin on top of the Rosedale plugin in the list and then disable the pixel movement on maps where I need your plugin, but if you are interested in patching it I could provide the project for debugging purposes privately :]

Under the spoilers below there are videos displaying the issue with Rosedale Collision Altering plugin ON, and then a video with the Rosedale Collision Altering plugin OFF. There is also the event page.

Spoiler: Collision Altering Plugin ON


Spoiler: Collision Altering Plugin OFF


Spoiler: EVENT
Note: <shovePlayer> <pushLength: 3> <unsafePush>

Screenshot 2025-07-28 193834.png
So, this DOES work with Maker MV, right? Because I'm currently going a little insane trying to get it to work. Do I need to hook up the swap/push/shove to a common event then call it for it to work? Any help is appreciated.

1755639766158.png

Original thread: https://forums.rpgmakerweb.com/threads/lyras-out-of-my-way-npcs-can-push-shove-the-player.149788/