Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Bind Events, when/how to update position

CT_Bolt

Global Moderator
Staff member
Resource Team
Xy$
0.02
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
Xy$
0.00
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