MV Can someone post me a Move Route example? Move Route issue...

Hello there folks! Me again, this time with a help request regarding this: putting Set Movement Route into scripts.
I have looked at the scripts and made a simple routing: move left, move up. Each time I'd do something like this, the character instantly skips the first step and performs the last step normally. I'd be interested in making a script for a movement route that looks like this: UP: 3, RIGHT: 4, UP: 2, LEFT: 1.
Can anyone please post me your way of putting this into a script?

Thank you in advance!
Hugs, stay awesome and live (b)right! >😀<

Yours truly,
Annwfn
It would help if you post what you did so that we can see where you made your mistakes.

However it would help even more if you post what and why you want to do this.
javascript isn't a miracle worker, and there are good reasons why most people use events to create move routes - it is rather difficult to get anything involving the main game loop right in javascript, especially for people who never did anything in javascript in the game loop.

and we need that background information to see if javascript is even the correct way to do whatever you want to do.
I will rephrase my question then 🙂
I would like to introduce that Set Movement Route part into a Script text box (not necessarily make use of JavaScript. It's too quirky and confuses me), if possible, where the AI will move based on a big Switch case, which will be based on the student's movement phase. (I know there can be only 1 wait function in a script box, since they trigger simultaneously).

Why I'd need this is because my AI events can end up as very lengthy, with students performing 200+ steps each, If I could put some of them in a big script instead it would use less space. Already data folder is 60Mb for 6 maps 😀
I believe someone made a scriptcall to follow a region ID path.

so if you use 20 and line out the path, it will follow that path straight,
or back and forth 🙂
that doesn't answer my question, but it shows that you're missing a few things.

1)
In 99% of all cases, the set moveroute command is actually shorter than the equivalent script commands. So if you want to make your events shorter, then trying to replace set move routes with javascript is not going to do so, it will make those script boxes longer and more difficult to read.
and in the few exeptions you're better off using a pathfinding script/plugin anyway.

2)
using a common event to control map events is usually a bad idea - for example if anything goes wrong and you activate those events on the wrong map, they will cause everything to go wrong because on different maps, the event IDs are usually for different event cases.
and the common event will command the events based on the local ID.


3)
which brings us back to my original question.
I asked for the purpose of what you're doing, not for the mechanics of it, exactly because I assumed that you have some convoluted and needlessly complex construct going on.
and you answer above convinced me that this assumption is correct.
Please tell us what the purpose of all that is, so that we might be able to point you to a better solution.
I would like to introduce that Set Movement Route part into a Script text box (not necessarily make use of JavaScript. It's too quirky and confuses me)
That is...what the Script box is. It's for JavaScript code. That's what Script means.

Just out of curiosity, why isn't all of this on the actual events on the map? You'd have one event page for each switch condition, and just the movement route for that switch on that page, no conditionals or multi-page events. I can't think why you'd want all of that to be taken out into common events running in parallel.
I believe someone made a scriptcall to follow a region ID path.

so if you use 20 and line out the path, it will follow that path straight,
or back and forth 🙂
Thank you for the point, but my maps with have 80-ish AIs that will move more or less at the same time. Imagine the chaos 😀 And they each have 200-ish steps to perform at certain times.
That is...what the Script box is. It's for JavaScript code. That's what Script means.

Just out of curiosity, why isn't all of this on the actual events on the map? You'd have one event page for each switch condition, and just the movement route for that switch on that page, no conditionals or multi-page events. I can't think why you'd want all of that to be taken out into common events running in parallel.
I heard Parallel Common events are somewhat more optimised than map-bound events. And optimisation is something I really seek.
Events move in Movement Phases, each incrementing from previous one. Events have to move a lot of steps and if player changes map and returns, the events will be reset. So something has to keep track of how much they walked, or would walk as the time passes. There is going to be an event that will place the students where they should be plus adjust their remaining path to travel based on what time the player switches maps. Plus, each student has several stances which I don't need mostly as a separate page, only in a few cases I do.
If I think though, it would be good to put them back into map events, since they would instantly stop when player changes map, instead of having to force-shut the Common Events down. Was also thinking of this.
I heard Parallel Common events are somewhat more optimised than map-bound events. And optimisation is something I really seek.
no, that is either wrong or most likely taken out of context.
as I already mentioned above there are actually additional problems when trying to control map events from common events.

. So something has to keep track of how much they walked,
that is usually done by a plugin for "remember event position", which are several different available for MV and should have been your first stop before anything else.

also don't forget that the common events also reset on map change, and that can also cause problems if the common event is too long because you'll never know where on the event the process currently was.

and there are other ways to sync time even if the player is not on the map, but that depends on how much micromanaging you really want, most people settle for "approximate" because of too much micromanaging.
no, that is either wrong or most likely taken out of context.
as I already mentioned above there are actually additional problems when trying to control map events from common events.


that is usually done by a plugin for "remember event position", which are several different available for MV and should have been your first stop before anything else.

also don't forget that the common events also reset on map change, and that can also cause problems if the common event is too long because you'll never know where on the event the process currently was.

and there are other ways to sync time even if the player is not on the map, but that depends on how much micromanaging you really want, most people settle for "approximate" because of too much micromanaging.
"approximate" is not a word for me. It's either exactly or doesn't help. Timeframes are specific and cannot allow approximation, or it means too much extra code for that.
Regarding the Remember Event Position plugin, well, I know of it, have used it but I gave up on it since events have to be teleported on the map to their specific location on map change. So remembering their location isn't helpful. If player comes 1 hour in-game time later, students won't be in the same place as 30 minutes ago (in-game time).
Didn't know Common Events also reset on map change. XD this can complicate things, since there are different students per floor, but they have the same ID so they will be easier to remember. Anyways there is a force-shut down event to end Common Events before player is transported to the new map.

Also, this refreshing is similar to Exit Event Processing, right? When map change occurs, they end themselves and start all over from the beginning, right? Thank you in advance!
OK, in this case there is one thing you should consider very hard before making the final decision on how to approach:

"Players" (which means NOT you as the developer) rarely like to micromanage a game. There are exceptions to this (I'm more of a micromanager myself as a player), but most people play to pass time without effort, and micromanaging requires effort to most.

So if you as the developer put in that precision and detail level, then it will either be ignored by most players (if the game can be played without the same level of detail on the player side) or the player will leave the game as "not fun" if it requires that attention to detail.

If this doesn't matter to you and you still want to get that precision into your game - go ahead.
It will be easier using map events for controlling what happens on the map, and the common events for time tracking and estimates of between-map-synchronisations). And scripted move routes is definately the wrong way to go with this.

But it can be done this way, most developers just aren't willing to put in the effort to get to that precision considering that most player will either ignore (if it has few effects on their play) or run away from it (if you force it on them).
OK, in this case there is one thing you should consider very hard before making the final decision on how to approach:

"Players" (which means NOT you as the developer) rarely like to micromanage a game. There are exceptions to this (I'm more of a micromanager myself as a player), but most people play to pass time without effort, and micromanaging requires effort to most.

So if you as the developer put in that precision and detail level, then it will either be ignored by most players (if the game can be played without the same level of detail on the player side) or the player will leave the game as "not fun" if it requires that attention to detail.

If this doesn't matter to you and you still want to get that precision into your game - go ahead.
It will be easier using map events for controlling what happens on the map, and the common events for time tracking and estimates of between-map-synchronisations). And scripted move routes is definately the wrong way to go with this.

But it can be done this way, most developers just aren't willing to put in the effort to get to that precision considering that most player will either ignore (if it has few effects on their play) or run away from it (if you force it on them).
Hello and thank you again! Gosh, you a fast one :3
Well, I thought about map events, initially the game was like that. there is no micromanaging on the player, game is mostly a Visual Novel, with the part that one can move on the map and will have to perform certain things/ duties, or "quests", let's call them so. The micromanagement is needed so that things work well and it's always on my side. I can't care whether people notice it or not, it's my mark, I always dwell in intricacies. Time event is parallel Common Events as well.

Figured out it's bad to do scripted movement routes, thought it would be a thing just to have far less commands written if I could've put part of the simpler movement into a script box. But many of the movement parts include detection, interaction, sound playing and this is annoying to put in scripts since it takes time, and there are 200ish students to do that for. With 4, 5 or 6 movement Phases. 😀
just to have far less commands written if I could've put part of the simpler movement into a script box.
actually as hinted, the javascript variant requires MORE space than the event command.
all the tiny settings and checkboxes you have on the set moveroute window? each of them is an additional command line under javascript, that gets added to all the other command lines of the move route itself.
The whole point of RPG Maker is you can make your game however you like, and no one will try to take that away from you. That being said, you are choosing to make things more convoluted and difficult than they need to be, which most often leads to would-be developers giving up without a completed project.

The reason you're having a hard time finding examples of how to do this is...people don't do this in their games 😛 The amount of effort and complexity to code this kind of autonomous world is just not worth it for how much it gets noticed or how much it matters to any player.

Even huge, world-based games from full production studios like Skyrim have only very basic versions of this - this lady goes from her house to her market stall in the morning, then back to her house to sleep at night. This guard patrols between these two points all day.

There just isn't a reason to make things so complex unless you're doing a dissertation on AI, in which case you'd probably know enough about it to not be asking for help 😉

But if it's truly what you want to do for your own enjoyment, whether or not it ever results in anything, you're going to get pretty deep into some very complex events or JavaScript code. RPG Maker just isn't designed to do this kind of background management, so you're going to have to write it yourself.

I think the best approach would be to have one event (if possible, it may take up too many lines and have to get split up) that tracks the intended location of every event in your game at every moment of the day. Then each event on the map has pages with different move routes. Each map has an autorun event that checks against the common event for where all of its map events should be, teleports them, and sets them to the appropriate page to move from there.

But, then, I wouldn't try to do this at all 🤣 It just seems like there are many more worthwhile things you can be doing with your game.
The whole point of RPG Maker is you can make your game however you like, and no one will try to take that away from you. That being said, you are choosing to make things more convoluted and difficult than they need to be, which most often leads to would-be developers giving up without a completed project.

The reason you're having a hard time finding examples of how to do this is...people don't do this in their games 😛 The amount of effort and complexity to code this kind of autonomous world is just not worth it for how much it gets noticed or how much it matters to any player.

Even huge, world-based games from full production studios like Skyrim have only very basic versions of this - this lady goes from her house to her market stall in the morning, then back to her house to sleep at night. This guard patrols between these two points all day.

There just isn't a reason to make things so complex unless you're doing a dissertation on AI, in which case you'd probably know enough about it to not be asking for help 😉

But if it's truly what you want to do for your own enjoyment, whether or not it ever results in anything, you're going to get pretty deep into some very complex events or JavaScript code. RPG Maker just isn't designed to do this kind of background management, so you're going to have to write it yourself.

I think the best approach would be to have one event (if possible, it may take up too many lines and have to get split up) that tracks the intended location of every event in your game at every moment of the day. Then each event on the map has pages with different move routes. Each map has an autorun event that checks against the common event for where all of its map events should be, teleports them, and sets them to the appropriate page to move from there.

But, then, I wouldn't try to do this at all 🤣 It just seems like there are many more worthwhile things you can be doing with your game.
Thank you for the point. I do love AI design. I'll see what comes out of the project anyways. I am here to test the limits of any platform I'll ever use, as well as the limits of my imagination, that put it into code. One way or another. And I will succeed. Optimisation is the only thing I seek, yet JS isn't the most optimised to start with and yes, can end up very confusing and messy in big projects 😀

Original thread: https://forums.rpgmakerweb.com/threads/can-someone-post-me-a-move-route-example-move-route-issue.148559/