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. 🙁