NPC movement question!

Hello.

I set a custom route for an NPC on repeat movement, and made it skip if cannot move so it doesn't get stuck in a wall. However, if that happens, then the NPC's route will never be the same again. They will be able to move, but their route will be all messed up. the point of the movement, is to make the NPC sit on a table and wait, and then walk to the stove and wait some more, rinse and repeat. If I block the NPC's path, I am basically runing their route for good since they will from then on, be waiting next to the table, rather than on it as originally intended. Any way to make the NPC auto correct their route after skipping movement?

Thanks in advance.
Instead of strictly defining the movement route, you can put it into event commands and use a pathfinding plugin, such as Yanfly's Move Route Core. That will tell them to go from this point to that point and maneuver around obstacles.
Wouldn't it be enough to not have them skip if cannot move?
Wouldn't it be enough to not have them skip if cannot move?
You can test it, but my understanding is if you don't check that box, the move route will try to move a direction, be blocked by the player, and then execute the next command in the route. That wouldn't help the OP as the NPC event wouldn't be going to and from the correct coordinates from that point on.
Wouldn't it be enough to not have them skip if cannot move?
In this particular instance it is. It was my mistake. The reason why they were getting stuck when not skipping movement was because the movement wasnt uniform. They would move left once, and then on the way back, they would move right twice to go to another counter. It was the repeat that made them eventually get stuck in a wall. I tried to fix it by skipping movemebt but that obviously doesn't fix it. Thank you for the reply 🙂
Good to know!
You can test it, but my understanding is if you don't check that box, the move route will try to move a direction, be blocked by the player, and then execute the next command in the route. That wouldn't help the OP as the NPC event wouldn't be going to and from the correct coordinates from that point on.
If I dont tick the box, the NPC will just stop until the next move is available for them. If the movement is uniform, say, wait - down - down - down - left - wait - right - up - up - up, then its fine because they will keep doing the same route if I dont tick skip if cannot move. However, because I originally intended the NPC to be on one counter, them move to the table, and then move to another counter next to the first one, then the movement would not be uniform. In this scenario if I leave it unticked, the NPC will eventually block itself from moving. If I tick it, then his route will be all messed up if blocked. I would need to do as you said in your post and use the plugin. But since I just started using RM and the default features are still a bit overwhelming, I will try that method later when I feel comfortable enough with the default content. For now, I'll abandon the idea of the NPC moving to 2 different counters.

Thank you so much for the replies!
However, because I originally intended the NPC to be on one counter, them move to the table, and then move to another counter next to the first one, then the movement would not be uniform. In this scenario if I leave it unticked, the NPC will eventually block itself from moving.
I don't understand this logic. Just put in the entire route, from table to the different counters etc. until it gets back to its starting point. Then it can repeat.

It sounds like you're trying to use the same route to move to two different places, which doesn't make sense.

If there's some reason you can't get it all into one route, you should also be able to pretty easily do it by turning on and off self switches to go between different event pages, but I don't see why you wouldn't be able to program it all in.

Perhaps you can post screenshots of the event and the map its moving on for reference.
I don't understand this logic. Just put in the entire route, from table to the different counters etc. until it gets back to its starting point. Then it can repeat.

It sounds like you're trying to use the same route to move to two different places, which doesn't make sense.

If there's some reason you can't get it all into one route, you should also be able to pretty easily do it by turning on and off self switches to go between different event pages, but I don't see why you wouldn't be able to program it all in.

Perhaps you can post screenshots of the event and the map its moving on for reference.

So I have redone the whole event in the meantime, but I just recreated it in a new map just to show it:

1662058304033.png


So the NPC is supposed to wait on that counter a bit, then move down to under the table right at the edge, face up, wait, and then step twice to the right and go up to the sink. And then either maintaining the Table - Sink route, or go back to alternating counters.

This is how I set up the route:

1662058488758.png


Thank you for your time.
So the NPC is supposed...
So wouldn't you simply add a Wait: 400 or 500 or whatever, Move Left, Face Up and it's back to where it started at the counter next to the sink? And then it can repeat...I'm not trying to be patronizing or anything, but I really don't get the problem.

Or if you want to go from the sink to the lower counter and then back to the original counter, you'd put that in. Right?

Edit: You understand you can enter more commands than you have there, right? Just highlight that bottom blank line and enter more, it will generate a scroll bar. It's not like your move route is "full."
Like previously, you can have a pathfinding plugin and use a scriptcall.
this can also make it shorter.

if you use a npc scheduler, try implimenting a time system from
the time 07.00 to 09.00 dishes, 9.20 to 11.00 watching tv, from x to y,
shopping etc.

or it does alot of dishes 😀
seems fun, than if you keep waiting, I wonder how many plates it has.
So wouldn't you simply add a Wait: 400 or 500 or whatever, Move Left, Face Up and it's back to where it started at the counter next to the sink? And then it can repeat...I'm not trying to be patronizing or anything, but I really don't get the problem.

Or if you want to go from the sink to the lower counter and then back to the original counter, you'd put that in. Right?

Edit: You understand you can enter more commands than you have there, right? Just highlight that bottom blank line and enter more, it will generate a scroll bar. It's not like your move route is "full."

I don't mind if you are patronizing. The fact that you are here replying to my probably stupid questions outweighs any patronizing tone you might possibly use.

So just adding move left and turn up wouldnt do, since the point is to go Counter A - Table - Counter B - Table, but I get what you mean. I just have to make the entire route passing through the 2 counters until i am back at the counter I started on, and let it repeat. that way there is no discrepancy in the loop. The NPC wasnt doing the path properly because I only set the route Counter A - Table - Counter B. So the NPC would then start the loop as if they were on counter A. I just have to make the route Counter A - Table - Counter B - Table - Counter A, and THEN it can start to loop and there wont be any problems.

I understand this a little better now so thank you again for replying!
Like previously, you can have a pathfinding plugin and use a scriptcall.
this can also make it shorter.

if you use a npc scheduler, try implimenting a time system from
the time 07.00 to 09.00 dishes, 9.20 to 11.00 watching tv, from x to y,
shopping etc.

or it does alot of dishes 😀
seems fun, than if you keep waiting, I wonder how many plates it has.

Thanks for your reply. The problem was me not considering the full scope of what I was trying to do. I don't actually need any plugin for the specific thing I was trying to do and have figured it out already. I wasn't adding the full route before it started looping and that was the sole reason for the issue.

But I really appreciate your reply and the information. I will definitely be checking plugins eventually, but will only do so when the default content doesnt feel as overwhelming as it is feeling right now. Still new to this, but I will get better thanks to you guys here in the Forum!
I just have to make the entire route passing through the 2 counters until i am back at the counter I started on, and let it repeat. that way there is no discrepancy in the loop.
Exactly. 🙂 That's what I was trying to say a few posts back with:
Just put in the entire route, from table to the different counters etc. until it gets back to its starting point. Then it can repeat.

Just so you know, we're not supposed to post twice in a row. If you forgot to say something, you can click the Edit button on the bottom of your post; and if you want to reply to multiple people, you can just click Reply on each post (or use the +Quote buttons, or @ user them, bunches of ways).

Good luck with your game!
Exactly. 🙂 That's what I was trying to say a few posts back with:


Just so you know, we're not supposed to post twice in a row. If you forgot to say something, you can click the Edit button on the bottom of your post; and if you want to reply to multiple people, you can just click Reply on each post (or use the +Quote buttons, or @ user them, bunches of ways).

Good luck with your game!

Wait, did I do that? Afaik I always just replied to people individually. You mean like just making several posts? I did make 3 posts here today. Is that what the rule means? I can only post once every 72 hours? So if I have 3 different questions in the same day, I would just edit a single post to include all the questions? Sorry if I'm being slow on this.
Wait, did I do that? Afaik I always just replied to people individually. You mean like just making several posts? I did make 3 posts here today. Is that what the rule means? I can only post once every 72 hours? So if I have 3 different questions in the same day, I would just edit a single post to include all the questions? Sorry if I'm being slow on this.
The rule refers to you posting multiple times in a row. For example, if I posted another post behind this reply to you, I would be double posting. As long as others have posted after your last post, it's all good.
And this also applies only to posts in the same thread. If you have three different questions it is actually encouraged to make three different threads for them. You do not need to wait 72 hours between the creation of different threads.
The rule refers to you posting multiple times in a row. For example, if I posted another post behind this reply to you, I would be double posting. As long as others have posted after your last post, it's all good.

Oh I see where I did that. I replied to 2 people in a row individually.

And this also applies only to posts in the same thread. If you have three different questions it is actually encouraged to make three different threads for them. You do not need to wait 72 hours between the creation of different threads.

I shall reply to multiple people this way from now on. Thanks for your help!
Moved to: MV Support

Original thread: https://forums.rpgmakerweb.com/threads/npc-movement-question.150994/