NPC walk in front of player (Human Shield)

Hello guys, so I tried to do this already without success, and I think I'll need to use Script...

I want to make an NPC, of my choosing(on event triggerd), to follow me, and stay always in front of me(player). So to speak, to use it as a human shield.

I can make an NPC follow me, using Move Toward Player, Turn Toward Player, but I want to be always in front of player, where the player is facing.

Can you give me some insight, ideas?

Would I need to use Script..., if yes, how... I don't know much on scripts on this engine, I'm new.

Thanks a lot.
I won't move it to script requests straight away as there are probably other ways of doing it. If it turns out that it can only be done with a script, please Report this post and ask for it to be moved.
but I want to be always in front of player,
What if the player turns toward another direction? How is your human shield supposed to react?
The human shield shoul move to be constantly, at any player movement, in front of him, in his face. So turning other direction shoul, activate the human shield to move fast in front of the player.
If by "move fast" you mean transfer the human shield directly in front of the player, then it is possible. If by "move fast" you mean that the human shield is supposed to actually move there, it is not possible (not without accepting the fact that it will not stay there every time). When the player turns back (180°) the human shield should move 2 steps (1 to enter the player square and one to reach the final destination). That is already slow on its own when the player is standing still, if the player is moving it becomes even harder because the number of squares for that movement becomes 3.

All that could be theoretically done with a very fast movement, at some point the human shield would reach its destination, but if the player is dashing that becomes very ugly as the player would move too fast and the difference between the event speed and the player speed would be too small.

In the end everything comes down to the fact that in order to achieve this, the human shield is supposed to move even when the player is still, and there is no way it can reach its destination without taking some time (unless you directly transfer it there). In that time span, the player could move, turn around again, or do anything else, and that would mess up the timing. This is simple math:

The human shield movement when the player turns can be quantified in squares as:
Code:
2 + y

The player movement, on the other hand, can be quantified as
Code:
y

In this case x is the player position.

It goes without saying that
Code:
2 + y > y
regardless of the actual value of y.
Ok, so there still are 2 options.

1. To slow down the player, which would not be at random, (holding an human shield should slow anyone down logically)

2. Or to do the transfer thingy. Which is not bad either.

But I still don't know, a thing that is used in either of these options. How to tell the NPC, where the player is facing, that variable...

Can you help?
2. Or to do the transfer thingy. Which is not bad either.
If the human shield is being directly held by the player then transferring it when the player turns is the way to go. If you wnat to add realism then you can even slow the player, that works too.

In order to transfer the event you simply need to store the player direction in a variable (you can do that with event commands) and then use a parallel process event that checks the player direction each frame. If the current direction is different than the one stored in the variable, you transfer the player at the coordinates obtaining by rounding the player X and Y value with the current direction.

Direction is as follows:
2 - Down
4 - Left
6 - Right
8 - Up

The rounded coordinates are (I am only going to list the ones that are different, the coordinate not listed stays the same as the player's), according to the player direction, the following:
2 - (Y + 1)
4 - (X - 1)
6 - (X + 1)
8 - (Y - 1)

Another option would be that of creating a bigger sprite for the player when he is holding a human shield. That would solve all your issues at once, although you have to remember that the sprite must be 9 times bigger than the normal one (3 times larger and 3 times taller).
Also, I didn't mention I think, I'm using RPG Maker MV, and didn't found a MV forum, so that's why I posted this here. Can it be done the same in MV or should I take the VX Ace?
MV and ACE event commands are the same with the only exception being MV Plugin Command which does not exist in VX Ace, but anything you can do with that can easily be achieved with script calls so differences are literally minimal.
Ah, I know I may be asking too much, but, I'm really just starting to learn this, I know UE4 well, but I need to do a mission, in not much time, and UE4 is time consuming, so I took the advice of using RPG Maker, but it's a whole new world for me.

If you could take me step by step, I would be forever grateful.
As storing such things in variables is very basic I strongly advice to follow Andar's tutorial link in my signature, it has a whole section that covers variables and switches usage. The tutorial is for VX Ace but, as I said, the event commands are the same and you can apply what is in there to MV as well (except for the scripting parts).

As for the transfer part you can use the "Set Event Location" command, you can find it in the second page of your event command list and you can designate the new position using variables (possible the ones where you stored the new position).

I've moved this thread to MV Support. Thank you.

How about changing the Graphic of the Player to the Events Graphic and the Events Graphic to the Player Graphic?
Than it would look like the player is following the Event, while in reality its vice versa.
A Event that is looking like the player is following the Player which is looking like an Event.
@Bex that would mess up the collisions though.
You need this for a literal "human shield"?

Because if thats your goal i did the same on a shooting game i have by merging sprites so the player is grabbing the enemy and walks with it on a hold, which ends up with one tile sprite, no conditionals, no events, no direction checking, no parallels, nothing!

Just a simple "switch character sprite to" event.

So check if what you want to do can be achieved visually instead of using a lot of parallel checks/branches/scripts.
Another option would be that of creating a bigger sprite for the player when he is holding a human shield.
@BK-tdm indeed, that is exactly why I mentioned this other option above.

Original thread: https://forums.rpgmakerweb.com/threads/npc-walk-in-front-of-player-human-shield.113897/