How do I make an event run in sync with the player?

Hello,
my event is a shadow and should run synchronously under my player. Unfortunately it runs only delayed. I did not put the shadow in the player sprite because it will have other properties.

RedditSchatten.png


The event runs with "toward player" behind the player. However, this causes the event to run delayed.

I think I should run the event with the same command that runs the player. The player follower does not run delayed either. Is there any way to do this? That the event reacts on the same command as the player?

I hope someone can help me. This is a very important function for my game.

Greetings
Matthias
I'm assuming you use MZ?

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

Probably easier to make an extra spritesheet for that. Slap your shadow onto the character, and change the player image, done.
Probably easier to make an extra spritesheet for that. Slap your shadow onto the character, and change the player image, done.
I did not put the shadow in the player sprite because it will have other properties.
@SGHarlekin Good solution but OP said they have a reason they chose not to do that.

(I suspect the shadow is likely to interact with the player perhaps, if so that sounds pretty cool of an idea)

... ... ...
The event runs with "toward player" behind the player. However, this causes the event to run delayed.

I think I should run the event with the same command that runs the player. The player follower does not run delayed either. Is there any way to do this? That the event reacts on the same command as the player?
Yep no prob.
I have a couple great ways to do this.. I'll post asap when I get to my PC in a couple hours.

Also curious, is your event movespeed/frequency set to the highest?
...if not, that might even already solve your issue.
Hello, thank you for your answers. ct_bolt has already recognized well that I can't include the shadow in the spritesheet.

Also curious, is your event movespeed/frequency set to the highest?
...if not, that might even already solve your issue.
I have already tried that, it makes it worse. The shadow reacts too late and then accelerates too fast.

Yep no prob.
I have a couple great ways to do this.. I'll post asap when I get to my PC in a couple hours.

If you can help me solve the problem, you are my hero!

And yes i use RPG Maker MZ
Hello, thank you for your answers. ct_bolt has already recognized well that I can't include the shadow in the spritesheet.


I have already tried that, it makes it worse. The shadow reacts too late and then accelerates too fast.



If you can help me solve the problem, you are my hero!

And yes i use RPG Maker MZ
No prob 🙂

Try this out... not sure what exactly you need though.. so I might have to make it different to suit your specific needs... but I made a plugin that "binds" any event to any character (players, events, etc.)


Works best with my core plugin:

Place core plugin above all my other plugins 🙂
1677108637130.png


Well see how that works for ya 🙂
Let me know how it goes ☺️
Edit:
Also just made it work with X/Y offsets something like this:
1677110982452.png
Offsets are in terms of the tile size so .25 is 25% of the tile size. 1 is a whole tile size

Edit:
idk.. wasn't quite working the way I wanted it to
...changed version to be 0.70 & now this is an "in development stage" plugin
working a bit differently now then my original posted plugin, but functions well still

Edit (again):
lol okay updated now to back up to a version 0.80 & am pretty happy with the results.

...let me know how it goes 🙂
... also now there is actually a lot more functionality to this plugin then I've described
but I will wait for your reply back before I go further into details on that
Thanks for your effort. Tried the plug in, the shadow no longer runs delayed. Very cool! Only one thing is there, the shadow flashes when it moves. Probably because it always refreshes itself. Is there any way to solve this problem?
Thanks for your effort. Tried the plug in, the shadow no longer runs delayed. Very cool! Only one thing is there, the shadow flashes when it moves. Probably because it always refreshes itself. Is there any way to solve this problem?
That's good to hear

Flashes when it moves?
& no it doesn't refresh itself.. I do have it animate as the player is "walking", so if you have blank spaces in your sprite sheet that would be what causes the flashing.. but I can also make it not do that

...can I see an example of the sprite sheet image you're using?
And your no longer using any move route stuff correct? (Since this plugin replaces the need to do any of that)

If you can, can I see your sprite sheet image & screenshot of the event?
I made a short video of what it looks like. Next to it runs another shadow event and this one works smoothly.



And my sprite sheet is here

SpriteSheet.png


My character has a speed of 4.6, if I slow him down, the problem is less.

I hope this information helps you
And here is the Event. The event is set to speed 4.6 by another EVent so that it is as fast as the player.
Event.png
Ahhh I see I never tested on a scrolling map.
Changed it up a little, I believe it should work as needed now now 🙂

Test it out, let me know how it goes.

Sidenote:
Also I did notice the sprite you gave me has a slight graphic issue with the left/right/down frames:
Spoiler
1677184776911.png

Edit:
Well no more flickering so that's good

...but sadly after more testing it's still not quite perfect...
..seems to not quite line up 100% if the player is "running"
Well test it out see how it goes, but I'm gonna play with this more to get it more 100% perfect
..it's so close but, looking into it further I may need to rewrite the whole thing with a different approach

Edit:
Sucess I think it's 100% perfect now (lol I hope)

I did remove the bindPageTo script call & now it is just bindTo instead
like this:
JavaScript:
this.bindTo($gamePlayer)

Example:
Page_Code: <this.bindTo($gamePlayer)/>

Now instead there is an unbind code:
JavaScript:
this.unbind()

Comment Tag would then be like this
Page_Code: <this.unbind()/>

Edit:
Dang... everything works great but now somehow this broke touch movement
...so if you don't use touch movement, that's great but if you do I'm working on a fix for that now
Oh my god yes, it works! Thank you so much! So it is perfect for me! :--)
Oh wow, @ct_bolt, it's super useful plugin! Can I also use this? What about TaC of this? Thank you!
@fizzly
I think if you follow his terms of use, it should be fine. ^^

@ct_bolt
Hey, one last thing. I want to move the shadow down a bit because I want the shadow to be bigger. I tried it and it didn't work. The shadow has disappeared. I send here a screenshot how I did it.

Would be very happy if you could answer me again.

Code.png
Quick question as the plugin itself looks like an interesting solution:
@ct_bolt Can this be used to bind an event so it acts lile a follower?

@BK-tdm​

Yes, it can. I have solved the problem myself. You have to write the code like this: Page_Code: <this.bindTo($gamePlayer,.0,.480)/>

Then the event will be moved to the bottom. If you want to have a follower, you have to change the numbers.
Hello, I tried binding it into an event but it does not work.
1679179817559.png
@EonRDK if you have the core plugin, it might work, else set it on top.
if you dont use the core plugin, you need to use the scriptcall instead
of comment tag.

if it still doesn't work, ct_bolt wont help you anymore. (refer to this page).
so only advance coders that understand his coding skill might be able to
help you or alter to make it work.

I hope you get it to work, or make a new thread.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-an-event-run-in-sync-with-the-player.155189/