Galv's Move Route Extras not turning a self switch.

Consider the following scenario:

-The game has Galv's Move Route Extras.

-You've set an NPC to move toward to an event like this:

repeat(99)move_toward_event(2)end_repeatself_switch("A", true)If the repeat hasn't finished yet (say the NPC moved only 10 squares and reached the event), it won't set the self switch to true.

Is there any way to fix this?
As long as those 99 steps have not been taken, it will never trigger.

With this script you don't need to tell it how many steps to take.  Whether the target event is static or itself moving, if you put use the move route that is available when you check Custom as the type of move you want, then in the script call there simply put

move_toward_event(2)

Whether event 2 is static or itself moving, the first event will go to it because that custom move route acts like a parallel process and just keeps going.

What you will then need is some way to trigger the self switch command.

However, if event 2 is static, then rather than use move_toward_event, you could use the move_toward_xy(x,y) command.

Edit

If there is nothing to get in the way which might trigger the self switch command accidentally, set the chasing event to Event touch

Then on the commands side of its page have the script call

$game_self_switches[[map_id, event_id, "A"]] = true

with event_id in this case being 2
As long as those 99 steps have not been taken, it will never trigger.

With this script you don't need to tell it how many steps to take.  Whether the target event is static or itself moving, if you put use the move route that is available when you check Custom as the type of move you want, then in the script call there simply put

move_toward_event(2)

Whether event 2 is static or itself moving, the first event will go to it because that custom move route acts like a parallel process and just keeps going.

What you will then need is some way to trigger the self switch command.

However, if event 2 is static, then rather than use move_toward_event, you could use the move_toward_xy(x,y) command.

Edit

If there is nothing to get in the way which might trigger the self switch command accidentally, set the chasing event to Event touch

Then on the commands side of its page have the script call

$game_self_switches[[map_id, event_id, "A"]] = true

with event_id in this case being 2
Oh my! Must have screwed up the the logic. Since the event was static (the exit to a room) I set it to move toward to event. I'll do a few more tests to be sure.

Original thread: https://forums.rpgmakerweb.com/threads/galvs-move-route-extras-not-turning-a-self-switch.41707/