Help with animations on map.

Hello.

I'm just starting out learning JavaScript and what i'm aiming to do is the ability to execute animations
on the map with a key press based on the equiped Weapon's Attack Animation with a offset parameter.
How do i write a simple Plugin/Script like this?
How far are you in the learning of javascript? I'll try to explain as clearly as possible and go through each logical step to build what you're describing:
1) First of all, you need to code that you can use a certain input on the map. However, you don't want to be able to use that input while an event is running and other stuff. So to add a player input on the map, you need to go into the Scene_Map:
Code:
Scene_Map.prototype.updateScene = function() {
    this.checkGameover();
    if (!SceneManager.isSceneChanging()) {
        this.updateTransferPlayer();
    }
    if (!SceneManager.isSceneChanging()) {
        this.updateEncounter();
    }
    if (!SceneManager.isSceneChanging()) {
        this.updateCallMenu();
    }
    if (!SceneManager.isSceneChanging()) {
        this.updateCallDebug();
    }
    // So basically here.
    if (!SceneManager.isSceneChanging()) {
        if (Input.isTrigerred("escape") { // I used the "escape" input but you can use any other input.
            // this is where you'll want to call or code the method to play the animation
        }
    }
};
2) From there, you can code the play animation. To play an animation, you basically need 3 things: the animation id, the x, and the y. Although I have no idea what you want to do with the animation position (player position? mouse position?), to get the animation is pretty easy. Get the actor's weapon, then get the weapon's animation id. As simple as that.
@MushroomCake28 Thanks, didn't knew i needed to Scene_Map stuff. I'll play around with it and see what i can do. I'm starting to learn JS but i'm familiar with C#.
If you're familiar with C# it should be easy for you to learn javascript. And yeah, everything that happens on the map goes through Scene Map at the base (especially in the update function). Now, how you implement the animation is completely your choice and can be done in many ways from the game interpreter (if you treat it as an event), or you could even create it directly in the Scene Map (create a sprite animation, but it will be like drawing on a canvas instead of drawing on the grid map).
You could always look at the JS form of the event command "Show Animation" (make sure its not Show Battle Animation coz thats for the battle scene), and just utilize/call it from your button press code
Hey @MushroomCake28 @Engr. Adiktuzmiko and others, Instead of creating another thread i'll make another question here instead.

I want to create a simple combat Plugin that basically lets you play attack animations and damage Events wich also attack/do damage.
So, i have some questions about scripting in MV:

Can i write a Script/Plugin with my own Classes, Functions and variables like you would do in most game engines and access its parameters from events/other scripts?

In Unity engine, to do damage on a enemy and animate it i would do the following:

Spoiler: Code
If(Input.GetMouseButtonDown(0))
{
var direction = transform.TransformDirection(Vector2.right);
var distance = 1;
RaycastHit2D hit = Physics2D.Raycast(transform.position, direction, distance, layerMask);
if(hit.collider.tag == "Enemy")
{
var damage = 10;
hit.collider.SendMessage("ApplyDamage", damage);
animation.Play("Swing");
}
}

Is there a simple way to implement a Plugin like this, maybe similar to the code above?
I still don't understand much how to make Plugins so i would appreciate some explanations.
Also, the lack of a Scripting API really bothers me...
Anyway, thanks in advance!
Yes, you could do your own Functions, Variables etc.. As for the How-To, lets wait for someone more experienced with MV and JavaScript since my experience lies more with VX Ace's RGSS3
Unity allows more control from the editor since you can set properties that can be accessed through the editor. The editor was made for that, unlike in RPG Maker MV.

You can create your own battle system from scratch, which is what I did. However, I would suggest doing it completely in the code, and maybe with the database (for skills, actors, enemies, etc). It will be much simpler than to try to incorporate the Game Interpreter and events.

Trust me, javascript is simpler than C#, and because it is an interpreted language, you can simply save the change in the code and play test it immediately.

TLDR: You can't access object properties with MV editor like in Unity. The closest thing to that in MV is the script command, but then again you can only call a function of an object through the Game Interpreter, which uses the eval command that is terribly innefficient.
Unity allows more control from the editor since you can set properties that can be accessed through the editor. The editor was made for that, unlike in RPG Maker MV.

You can create your own battle system from scratch, which is what I did. However, I would suggest doing it completely in the code, and maybe with the database (for skills, actors, enemies, etc). It will be much simpler than to try to incorporate the Game Interpreter and events.

Trust me, javascript is simpler than C#, and because it is an interpreted language, you can simply save the change in the code and play test it immediately.

TLDR: You can't access object properties with MV editor like in Unity. The closest thing to that in MV is the script command, but then again you can only call a function of an object through the Game Interpreter, which uses the eval command that is terrible innefficient.

Thanks for the aswer! I'll try learn more about JS then.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-animations-on-map.104923/