Script Call Movement doesn't wait

I currently have a problem that the RPG Maker does not wait after a MoveRoute script call. Even if I set move_route.wait=true.

No matter where in the code i place the " move_route.wait=true " it just won't wait, leading to several bugs.

Only if I place " wait = x " the code does wait. But the problem is I don't know how many frames I need the Code to wait until the objects are moved.

Why does RPG Maker ignore the "wait until moved" and how can I fix this?

Screen 1: Making the MoveRoute Script Call global and setting it up.

Screen 2: Script Call

Screen 3: What it exactly should do with the Script Call. (This was my old method)

movesetup.JPG

scriptcall.JPG

drag&drop.JPG
you should use the set move route command instead of the script commands for that.


I'm not sure why it fails, but my guess is that this is due to the commands being in two different script command windows: whenever a new script command is given, the interpreter re-initialises, and all local variables are erased when that script command is completed.
This is why I set the variables to global. I also tried to copy and paste all the comands from the first screenshot infront of the code from the second screenshot. It just seems, that the MoveRoute.wait function is broken in script calls. 🙁

But thanks for the comment.
Where did you set the variable to global? Please show the script changes you made for that.
In the first screenshot I put a $ infront of the variables, making them global. Its in an autostart-event at the beginning of the game. (I also tried using it local but this still failed)
If putting a $ sign on a variable would allow it to break out of a sandbox, then the entire programming language would be one big security risc.


It would be the same as if a prisoner inside a cell could make a random key and have it be able to open the cell door by declaring that it should work outside...


Sorry, but you can only declare a variable to be global if you have global access from the outside, you cannot do that from within the interpreter's script command.
Okay good to know. But the strange thing is, other global variables worked to declare and to read within a script command.

Do you know how I can let the code wait until an object is moved?
No, especially because that is an extremely unusual way to handle things.


Perhaps you should take a step back and explain why you want to place the move route by script command?


It would be one thing if you wanted to do that from a real script, but to do so from an events script command makes absolutely no sense.
I wanted to "simplify" my commands. I needed 4 pages of common events to handle each players movement, variables and such. This was a real issue if I changed large parts of the common events or if I added new features, new variables, playfields etc. . I had to change all 4 large blocks.

So I wanted to use only 1 code which is capable of handling all 4 player-events using variables for IDs. With " $game_map.events[$turn_number].force_move_route($move_route) " the common event can move all 4 events depending on the current turn number (=player 1-4). But it just seems bugged. Why is there a wait command for the MoveRoute Script Call if it just has no use? D:

Unfortunately I can't script so I can't write a real script. 🙁
Please do not make multiple posts asking the same question. You have already made a post here which you have been getting assistance with. Stick with the original one, or you're just confusing people.


Closing.

Original thread: https://forums.rpgmakerweb.com/threads/script-call-movement-doesnt-wait.41498/