How to force the player to follow an event?

Ok, so a part of my game revolves around one protagonist (a 100+ year old sorcerer) protecting the main protagonist (a 36(equivelant of 10 human) year old shape-shifting dragon that is too young to fight or control her abilities) from a powerful group of people wanting to capture and manipulate her. At a certain point near the climax of this part of the game the dragon is captured by a group of mercenaries under the employ of the people that want her under their control. During this point of the game I want to switch the playable character between the sorcerer trying to catch up with and rescue the girl, and the girl using what she's learned from her journey thus far with the sorcerer in order to make her own escape attempt. So what I need is to give her the ability to be controlled by the player, but also to be able to check for how far away she is from her captor.

Read this only if you don't care for explanations of why it's needed!

 Basically what I need is for a way to "force" the player to follow an event but allow the player control during this time. I figure it probably will have to utilize x and y coordinates which are the one of thing that confuses the crap out of me in eventing. The most I've ever done with them is simple puzzles and I have little idea how to start on this. If anyone has a clue/has done something similar and wants to give advice it would be greatly appreciated.
I think you might want to explain it in more simpler terms...it doesn't quite make sense to me.

And saying "Force-follow an event while having player control" is contradiction?
Ok, maybe I didn't explain it the best. It isn't really a full contradiction, I want the player to be able to control the character as in move around and stuff, but I want to be able to check the player's x and y coordinates against another events x and y coordinates and cause something to happen if say, the player strays more than 4 tiles from the event. I also need to make sure that the events move route, while stopped while dealing with the player straying to far, continues where it left off when the straying event runs it's course, so that the final destination is the same no matter how many times the player "attempts to escape" (unless she does escape). That's why I put the first part as context before just explaining the system strait out, I thought between the two it was fairly well explained. Hope this clears it up further.
Ohhh, basically an event will occur if the player is outside the distance range of a specific moving event.

It's possible to do something like

x  x  x  x  o   x  x  x  x

x  x  x  o  o  o  x  x  x

x  x  o  o  o  o  o  x  x

x  o o  o  E  o  o  o  x

x  x  o  o  o  o  o  x  x

x  x  x  o  o   o  x  x  x

x  x  x  x   o   x  x  x  x

E would be the event, and o would be the tile spaces around E where the event would not activate. (This example would be for three tiles away from the event)

I'm not sure how to event this, but the script "N.A.S.T.Y. Text Popup Over Events" can perform this using a snipplet of

class Game_Interpreter def distance_to_event(event_id) x1 = $game_map.events[event_id].x y1 = $game_map.events[event_id].y x2 = $game_player.x y2 = $game_player.y return ((x2-x1).abs + (y2-y1).abs) endendYou can do a condition branch check to see if this method is greater than 4.

Condition Branch: Script: distance_to_event(id) > 4

Replace id with the event's ID.   This check should be a parallel process.
Is that supposed to be inserted into a slot under main along with the referenced script, is it a function of the referenced script, or is it supposed to be put in the event's 'script' section while using the referenced script? (probably something different because I get an error each way except the second, which I don't see in that script).

Script: Game_Interpreter' line 1411 syntax error occurred.

unexpected tInteger, expecting')'

def distance_to_event(2)

Happens during script call, or on start up if entered as a snippet, with or without Nelderson's script...

sorry if being dense, I went with events first because I understand what is going on when they go wrong easier than with scripting.
That snipplet for Distance_To_Event should be placed under a new slot below Materials and above Main. You don't need the Text Popup script at all because this is a small stand-alone function that the script author just used for his other script.

The parallel process event should just look like

1ucSYX6.png


The 1 frame wait is there to sometimes help functionality issues. It's something I personally add to all my parallels.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-force-the-player-to-follow-an-event.19912/