Bind Events, when/how to update position

GO TO ADMIN PANEL > ADD-ONS AND INSTALL ABSTRACT SIDEBAR TO SEE FORUMS AND SIDEBAR

CT_Bolt

Global Moderator
Staff member
Resource Team
Joined
Nov 12, 2015
Messages
566
Points
248
Website
ctbolt.wordpress.com
Recently I started to create a plugin to bind events to certain objects like players and followers...
See here: https://rpgmakermv.co/resources/bind-events.1470/

However I've been having trouble getting it to sync perfectly though...

Currently I set the "bound event" location to the followers location inside an aliased "Game_Followers.prototype.update" function.

Is the best place?

It seems pretty choppy & appears before the player/follower gets in the correct place. There is most likely a better way.

Would anyone care to look this over and fix my mistakes?
 

trapless

Villager
Joined
Dec 28, 2015
Messages
57
Points
41
Age
35
Website
sqwisp.com
I believe I can point you in the right direction. I had a look at your position update function. If my memory is correct, actors have a target x and y set befor they move. That would explain why the event gets there first. After that target is set, they move in "steps". I think there is a "step size" variable somewhere. something like... "step_size = 4;" maybe? That would make each step move the actor 12px since each tile is 48px. That is how the actors move smoothly. "$gamePlayer._x" references the players "tile x" not "pixel x".
tile1._x = (1 * 48) + (48 / 2) I think. I don't want to take a lot of focus from my own coding right now so i'm not going to rip the whole thing apart. Have fun :)
 
Top