MV Camera in front of the player

Hello. I've been looking around without much luck.
What I'm looking is a plugin that moves the camera forward one tile when the character stops walking.
Let me explain: The character is walking, the camera is centered on him, as it is by default. but when the character stops the camera moves one tile in front of him. That's it.
The same in all directions.
Can anyone help me?
I dont have that issue, can you make a gif? or do you have plugins
that alter the camera? or events to do so?
*cough*

Anyways, this can be accomplished with eventing. Maybe someone has a more graceful way of doing this, but here it is tested in my own game working.
MapScrollEvent.png


Here it is in action:
Desktop 2022.10.19 - 19.50.23.03.gif
I dont have that issue, can you make a gif? or do you have plugins
that alter the camera? or events to do so?
It's not a problem, it's something I want to do. I'm looking for a plugin that does what I just described.
*cough*

Anyways, this can be accomplished with eventing. Maybe someone has a more graceful way of doing this, but here it is tested in my own game working.
View attachment 242997

Here it is in action:
View attachment 242998
I'm going to try it! Thank you!! :LZSexcite:
Edit:
@TheAM-Dol ok, the problem is that if the player moves up several times in front of a wall the camera keeps moving until the player can't be seen. It would be great if the camera only moved once in front of the player.
It looks like that approach probably wouldn't work in multiple directions though. After this gif, if the player moves left or right, the camera will stay offset upwards. Moving down will only bring it down by one tile, even though it now needs to move by 2 (one to center everything again, and one more to create the offset).
Also, if you walk up to a wall and keep repeatedly pressing the 'up' key you can move the camera as far up as you'd like.
It looks like that approach probably wouldn't work in multiple directions though. After this gif, if the player moves left or right, the camera will stay offset upwards. Moving down will only bring it down by one tile, even though it now needs to move by 2 (one to center everything again, and one more to create the offset).
Also, if you walk up to a wall and keep repeatedly pressing the 'up' key you can move the camera as far up as you'd like.
That's right, that just happened. u.u
Well, turns out, this is actually a rather tricky problem. Not just the logic of how to re-center and move the camera to where it's needed (since the extra scroll can remove itself depending on how the player walks), but also when it comes to not breaking near the edges of a map. That's certainly not how I was planning to spend this afternoon, but at least now I know a lot about how RPG Maker's camera works xD

Give this a try:
Well, turns out, this is actually a rather tricky problem. Not just the logic of how to re-center and move the camera to where it's needed (since the extra scroll can remove itself depending on how the player walks), but also when it comes to not breaking near the edges of a map. That's certainly not how I was planning to spend this afternoon, but at least now I know a lot about how RPG Maker's camera works xD

Give this a try:
amazing! It works perfect! :LZSexcite:It does feel a little weird though when the camera returns to the player before moving in another direction, but I also have no idea how to solve that.
How can I make the movement slower?
It does feel a little weird though when the camera returns to the player
I think the only reasonable solution would be to do it more in the way most 2D games handle this sort of camera: continuously, slowly moving it to a point in front of the player while they're moving, with a nice easing function so it's not so noticeable. Unfortunately, I don't think that's possible to do by just calling vanilla's scroll function, you'd kind of have to rewrite all the camera controls, which is definitely beyond the scope of a one day plugin.

How can I make the movement slower?
The speed is always equal to the player's speed, but I suppose it's not a bad idea to make it customisable. Time for a version 1.1 xD
You're right, there are some flaws with the system I built, but you could modify by checking the players X & Y and if the camera is greater than 1 tile away from the player then it shouldn't turn on the camera move switch.
You could use the same x & y check to see if the camera is on the opposite side of the player (for example the camera is one type up from the player when they are moving down) and if so you can tell it to move the camera down 2 instead of 1.

Another option that comes to mind is using something like SRD Camera Core and maybe Yanfly's Event Spawner. The logic of the event would need a slight adjustment, but it would give you more control over the way the camera moves.
You could use the event spawner to spawn an event that Camera Core would want to follow (using the Focus Camera plug-in command). Every time the player moves you can use the clear spawned events command to remove the cameras focus, then use a Reset Focus plug-in command with a few frames to snap the camera back to the player.
Well, by now I've already made a plugin that does exactly this, so using it is probably much easier than remaking its functionality with events/other plugins 😉
Well, by now I've already made a plugin that does exactly this, so using it is probably much easier than remaking its functionality with events/other plugins 😉
The plugin works really well, thank you very much!
I'm going to bother you a little more with this but forgive me. How can I make the camera only move up? I've thought better of it and I really just need it to move to the front of the character. No other direction. Really sorry. I've been trying to edit the plugin to achieve just that, but it doesn't work.

Edit: Forget it, I only had to delete two lines, haha. It is perfect!

Original thread: https://forums.rpgmakerweb.com/threads/camera-in-front-of-the-player.152075/