Set movement route script call

Hey guys,

Quick question:
Is it possible to use the event command ''set movement route'' through a script? And if so, what is the proper command.

Thanks in advance!
I wrote a tutorial on this for Ace (it should be in the Ace Tutorials forum). The same logic applies, but the commands will be different for Javascript. It's not just one command - you have to create the movement route object, then you have to create one movement route command for each step and add it to the movement route object, then you have to apply it to the character.

More information on what you're trying to do, and why you're trying to do it via script instead of the event commands, would be helpful, if you want more detailed assistance.
Hmm i dont see any stickies of you on the ace forum, and i dont have a clue what you called the topic. Would you be so kind to send me a link?

Also the reason I wanna use a script for this, is because id like to make the specific command you give with set movement route - variable.
For instance: (Im guessing the set movement route script looks in some form or shape similar to this) "$setmovementroute(jump 0, 0,)"
I wanna make the "jump 0, 0" - variable, like this; $setmovementroute(gameVariable.value(*)) just so that i can easily change that variable, and thus change the whole set movement route without too much effort.

The reason for this is because im building a interaction system for npcs, and i need them to do specific movements, when I wish it so. The way i had it in my head would be something similar to this:
This being in the event that the player is talking to.

Code:
◆If:Movement Order is ON
  ◆Script:setMovementroute(thisEvent)Skip, Wait,"$gameVariables(43)"
  ◆Control Variables:#0099 Interaction Event Order = -1
  ◆
:Else
  ◆Comment:---
  ◆
:End

This would replace what im doing right now - which works, but is incredible tedious, and would require me to either remake all npcs events if i forgot one set move command, or place literally all move event commands in the event, which would also clutter the event. Currently it looks like this:
Code:
◆Comment:---
◆Control Variables:#0100 Person ID = 1
◆Comment:---
◆Control Variables:#0099 Interaction Event Order = -1
◆Control Switches:#0006 Npc Interaction Trigger = ON
◆Comment:---
◆Label:1
◆If:Interaction Event Order = -1
  ◆Jump to Label:1
  ◆
:End
◆Comment:---
◆If:Script:$gameVariables.value(99) === "Direction Fix ON"
  ◆Set Movement Route:This Event (Skip, Wait)
  :                  :◇Direction Fix ON
  ◆Control Variables:#0099 Interaction Event Order = -1
  ◆Jump to Label:1
  ◆
:Else
  ◆Comment:---
  ◆If:Script:$gameVariables.value(99) === "Direction Fix OFF"
    ◆Set Movement Route:This Event (Skip, Wait)
    :                  :◇Direction Fix OFF
    ◆Control Variables:#0099 Interaction Event Order = -1
    ◆Jump to Label:1
    ◆
  :Else
    ◆Comment:---
    ◆If:Script:$gameVariables.value(99) === "Through ON"
      ◆Set Movement Route:This Event (Skip, Wait)
      :                  :◇Through ON
      ◆Control Variables:#0099 Interaction Event Order = -1
      ◆Jump to Label:1
      ◆
    :Else
      ◆Comment:---
      ◆If:Script:$gameVariables.value(99) === "Through OFF"
        ◆Set Movement Route:This Event (Skip, Wait)
        :                  :◇Through OFF
        ◆Control Variables:#0099 Interaction Event Order = -1
        ◆Jump to Label:1
        ◆
      :Else
        ◆Comment:---
        ◆If:Script:$gameVariables.value(99) === "Jump"
          ◆Set Movement Route:This Event (Skip, Wait)
          :                  :◇Jump:+0, +0
          ◆Control Variables:#0099 Interaction Event Order = -1
          ◆Jump to Label:1
          ◆
        :Else
          ◆Comment:---
          ◆If:Script:$gameVariables.value(99) === "Turn toward Player"
            ◆Set Movement Route:This Event (Skip, Wait)
            :                  :◇Turn toward Player
            ◆Control Variables:#0099 Interaction Event Order = -1
            ◆Jump to Label:1
            ◆
          :Else
            ◆Comment:---
            ◆If:Script:$gameVariables.value(99) === "Turn away from Player"
              ◆Set Movement Route:This Event (Skip, Wait)
              :                  :◇Turn away from Player
              ◆Control Variables:#0099 Interaction Event Order = -1
              ◆Jump to Label:1
              ◆
            :Else
              ◆Comment:---
              ◆If:Script:$gameVariables.value(99) === "1 Step Backward"
                ◆Set Movement Route:This Event (Skip, Wait)
                :                  :◇1 Step Backward
                ◆Control Variables:#0099 Interaction Event Order = -1
                ◆Jump to Label:1
                ◆
              :Else
                ◆Comment:---
                ◆If:Script:$gameVariables.value(99) === "1 Step Forward"
                  ◆Set Movement Route:This Event (Skip, Wait)
                  :                  :◇1 Step Forward
                  ◆Control Variables:#0099 Interaction Event Order = -1
                  ◆Jump to Label:1
                  ◆
                :Else
                  ◆Comment:---
                  ◆
                :End
                ◆
              :End
              ◆
            :End
            ◆
          :End
          ◆
        :End
        ◆
      :End
      ◆
    :End
    ◆
  :End
  ◆
:End
I hope im being clear enough
I didn't say it was stickied/pinned, or in the Ace forum. I said the Ace Tutorials forum. You could just search that forum for a post by me with Move Route in the title, which is exactly what I just did:

https://forums.rpgmakerweb.com/index.php?threads/creating-a-move-route-with-a-script-command.59367/

You don't need to script the entire movement route just to make the jump height/distance dependent on a variable. The Movement Route window has a Script command. Just create a movement route via events, and when you want to do the jump, use the Script command to add the jump command. It'll be something like:

this.jump($gameVariables.value(1), $gameVariables.value(2));
@Shaz But what im looking for is to make the actual event command variable, taking your example, Similar to this:
this.$gameVariables.value(3)($gameVariables.value(1), $gameVariables.value(2));
And then the idea would be to name variable 3 - "jump", or whatever other set movement route command I would need it to be.

@Shaz Ive just now gotten the time to look at the link. And im curious - where can i find the proper MV commands - because the only way i know how is to browse through the ''f8 thing'', and this is hard for me because i have no idea where to look.

Also is there a RGSS Reference Manual for rpg maker mv?

Original thread: https://forums.rpgmakerweb.com/threads/set-movement-route-script-call.84179/