Object from point a to point b by animation

I'd like to learn througth javascript how to make an ingame object go from point a to point b inside map by animation.


It can be a sprite, an event, a projectile, a soccer ball, an annoying companion/follower, someone blocking my path, etc.
Hey, I think this can help you:
No. It doesn't help.


I want to throw things, nothing related to pathfinding.


Also, I don't ask for a plugin. I want to learn things. 
No. It doesn't help.


I want to throw things, nothing related to pathfinding.


make an ingame object go from point a to point b

Pathfind

Also, I don't ask for a plugin. I want to learn things. 

You can learn by yourself reading the code


Hope you find someone to help.


Cheers!
make an ingame object go from point a to point b

Pathfind

I didn't said "make an ingame object go from point a to point b". I've said "make an ingame object go from point a to point b inside map by animation". It's not the same.


Throwing things has nothing in common with pathfind. What thing do you think will happen when you kick a ball? Ball will go directly without searching for a path.

Also, I don't ask for a plugin. I want to learn things. 

You can learn by yourself reading the code



This is a learning javascript board. I want to learn something about animation to use in my plugins.


Greetings.
@Lantiz, @ICF-Soft, please keep the tone civil


The problem with ICF's idea is the way how animations work - if you're talking about animations in the database.


They're basically sequences of pictures that are displayed on one specified coordinate - which means they can only go relative to that point, they can't go independently.


If you're talking about something else, you need to give more details about what you want - because in that point Lantiz is correct in so far as that your descriptions can have multiple interpretations, and his answer is the correct one for some of those other interpretations.
I think that is better to ask for a better explanation than prove to be right by removing important conectors that change sentence.


On first case I explain better what I mean.


On the other case I explain why he is wrong.


I didn't knew this sounds so bad. Sorry for this.
That warning was more a preemptive sentence to prevent this from deteriorating, not because anyone already said something bad.


And while this is most probably caused by language barriers, you (@ICF-Soft) didn't really explain what you want. You used a lot of words that have either none or several meanings in the area of RPG-Managers (like animation can mean an animation from the database or a general technique for drawing something by javascript commands or something done as an on-map cutscene.


Or, more to the point - there are only two things that can be moved at all on the screen - pictures or events. Moving a picture is a direct event command, and you can look up its javascript equivalent in the topic that lists all javascript equivalents to event commands.


And if you want to move an event, that requires pathfinding (simple pathfinding if trough is on and passability is ignored, but still pathfinding).
I'm 90% sure they want to know how to smoothly move an object's x/y position to a different position over time, as in animating its movement across the screen/map/whatever, instead of having it be in one place and then instantly appear somewhere else.


And an answer to that depends on what kind of motion you want. Linear motion is the easiest, but it's also rather unnatural. Looking around on google for animating something's position would help. What you're essentially doing is calculating a smaller part of the change in position you want to apply over a number of frames.
How should the object move from point A to point B?
Well, I find frustrating when I request something and it goes to a 100% wrong point (on second line of what I request you'll find why) and still says is a right solution every time I say/explain why it isn't.


So I say that a solution that involves pathfinding is far away of the solution.


@Andar, you're close with "a general technique for drawing something by javascript commands or something done as an on-map cutscene" to what I want.


@Zalerinian, you're even closer. I want to move an event this way and update position when finished, and to throw projectiles between players/events.


Some examples:


-There is a soccer ball that can be kicked by players. When kicked it does it's natural movement and updates when finished.


-You are pissed about those party followers movement, so you grab one of them and throw him to another place.


-An event takes a stone from the floor and throw it to another event.
You're looking for something like this: http://javascript.info/tutorial/animation


RMMV has an internal animation system. You could plug into that, create a specific animation, and use a script call event on the object you want to be thrown.


If you want to learn, your best bet is to find the resources yourself. I'm sorry, but the scope of what you're asking for is far too much to expect that someone would take the time to teach you.
If there is a chance of getting a solution I want to ask how may I write this function to work inside map:


proyectile(initpoint, finalpoint, frames)


With this I think I'll be able to derive all what I need.
Unfortunately, I don't think it's quite so easy as that. For an example of animation, look at the title screen. There's a fade-in effect. That should help you figure out how to decipher RMMV's animation system, then co-opt it using the information in the link I sent you.

Original thread: https://forums.rpgmakerweb.com/threads/object-from-point-a-to-point-b-by-animation.67938/