Set Move Route and passability help

OK, so I've created a small town, and I'm populating it with NPCs who go about doing their own things (like in Majora's Mask). For example, at 7pm, a fisherman gets up from his fishing spot and walks all the way to his cottage. This is not hard to do with a parallel event and Set Move Route.

The problem is that I want those NPCs to be able to be blocked (you might want to make the fisherman late for dinner, for example), but not permanently. To do this, I've created another parallel event that checks where the fisherman is and, if he is still there two seconds later, he says "Excuse me" and temporarily checks the "Through" passability option, just enough to free himself from whatever is blocking him. To make him late, the player would have to be insistent and block him several times.

The thing is: I can't use Set Move Route to change his passibility because there is already a Set Move Route queue from the first parallel event (the one that defines his walking route). So he remains stuck. I thought I could avoid this by having two event pages for the fisherman, one with "Through" off and another with it on. Then, instead of messing with Set Move Route, I could simply change a switch. But that doesn't work. The page change cancels the whole Set Move Route queue. The NPC becomes passable for a couple of seconds, but doesn't keep on walking after that.

Does anyone have any suggestions? Is there a script call I could use to check and uncheck the "Through" option without going through Set Move Routes? That would probably work.
Setting the full move route then changing it mid way won't work... You will need to make the move route step by step if you want to do that... Like, check if blocked, if yes, wait in place, if not move one step. And so on.
Also, using a set move route on parallel pages is very bad for lag, especially in a town with a lot of NPCs.


It's a lot better to use autonomous movement whenever possible, but I admit that autonomous movement cannot be mixed with set move route commands, so that "late" function will become more trickier.


But whenever an event has only a single move route at a sequence, you should set it as autonomous to reduce lag.
Thanks for the answers!

I could make the move route step by step, but I ran into another problem: I'm using Victor's pixel movement, and there's currently a bug that overrides the option to wait in place when blocked. Since I'm also using Eventing: Fine Tuning v3.2 By V.M., I'm using its waypoint(x,y) script call instead, which is really useful for my solution below. This isn't actual ruby syntax, obviously, but you get the idea:

The NPC event is placed at 1,1, and this is a different parallel process:

PAGE 1 CONDITION: gametime == 1040

If $NPC_variable == 0
  Move Route script call: waypoint(5,1)
   if NPC position == 5,1
      $NPC_variable = 1

If $NPC_variable == 1
  Move Route script call: waypoint(5,5)
   if NPC position == 5,5
      $NPC_variable = 2

If $NPC_variable == 2
  Move Route script call: waypoint(10,5)
   if NPC position == 10,5
      $NPC_variable = 3

Wait 30
       

PAGE 2 CONDITION: Gametime == 1041

If NPC's Position == 1,1
  Transfer NPC to 6,5
  $NPC_variable = 2

If $NPC_variable == 0
  Move Route script call: waypoint(5,1)
   if NPC position == 5,1
      $NPC_variable = 1

If $NPC_variable == 1
  Move Route script call: waypoint(5,5)
   if NPC position == 5,5
      $NPC_variable = 2

If $NPC_variable == 2
  Move Route script call: waypoint(10,5)
   if NPC position == 10,5
      $NPC_variable = 3

Wait 30


... and so on. You get the idea. I have one of these pages for each in-game minute (12 seconds) the walk is supposed to last, meaning the player can leave a house AFTER the NPC is supposed to have started walking and find him already on his way. To determine whether the NPC is late or not, I just have to determine a time for him to get there and compare it to the game time when he actually gets there.

The blocking mechanic I explained in my previous post now works as intended, since the parallel process above just restarts the Move Route when the NPC event changes pages. Once the walk is done, that event is erased.

I think this will be fine lag-wise, since I don't have dozens of NPCs walking around at the same time. They all have different schedules, and the events only run during the brief time they are supposed to be walking somewhere.
Please provide the links for the scripts you're using (all that affect movement, passability and/or maps), we can't help you otherwise.


But I have to admit that this will probably be very difficult to solve, especially when mixing scripts for pixel movement with scripts for event repositioning...
Oh, no, I don't need help anymore. 😀 I was just posting my solution in case anyone needs it in the future.

The Pixel Movement move route bug is still there, but I found an acceptable workaround ^. I can wait until Victor fixes it now.

Edit: I've just realized I was unclear. The bug with the Pixel Movement script only affects normal Set Move Route movements (DOWN, LEFT, UP, etc). The waypoint(x,y) script call from V.M.'s script works as intended.

Original thread: https://forums.rpgmakerweb.com/threads/set-move-route-and-passability-help.36749/