"event move to event" not working correctly (beginner question)

Hello,

I want to move an event to another random moving event. It kind of works with the script:

$gameMap.event(3).moveTowardCharacter($gameMap.event(4));

But event 3 (purple guy) keeps blocking event 4s (white girl) movement in the end; both are stuck and it looks like this:

event3.png


Event 3 looks like this, there is nothing on page 2 (event 4 is empty). When I activate the upper script it works as described and the events get stuck. This is the first issue. I can't figure out how to manipulate the speed of event 3 aproaching event 4. I'd like event event 4 to be able to always be ahead some steps.

event1.png


I tried the lower script I also found in the MZ Script Calls here in the forum and I get an error and this is the second issue. Why is it not working?

event4.png


Thank you for you time!
1) from your screenshots, your event 3 does exactly what it is told to do - nothing more, nothing less.
If you have problems with the move of event 4, then you should show us how event 4 is controlled as that has nothing to do with your event 3 that goes exactly where it was told to go to.

That said, your biggest mistake is to split commands between events that should have gone together.
In any form of cutscene you should always have a signle controlling event with all other events being remote controlled empty placeholders. Which means you need one event to control the moves of both event 3 and 4 to be able to coordinate their move.

2) "THIS" is a placeholder that gets replaced with the true data object based on context.
Which means its functions are context-sensitive, and the error message you got simply tells you that in the context where you used this, the finddirectionto function does not exist.
Or in other words: you're using the function in the wrong place and the wrong way, and you need to go back to its description on how to use that.

3) and it would have helped if you told us what your event is supposed to do.
we cannot tell you how to do something correctly< if you don't know what you want to do - as said above the move does exactly what you told it to do, so there is no internal error in the event command. that it does not what you thought it would do doesn't matter if you don't tell us what it is supposed to do instead.
Hello,

I want to move an event to another random moving event. It kind of works with the script:

$gameMap.event(3).moveTowardCharacter($gameMap.event(4));

But event 3 (purple guy) keeps blocking event 4s (white girl) movement in the end; both are stuck and it looks like this:

View attachment 281361

Event 3 looks like this, there is nothing on page 2 (event 4 is empty). When I activate the upper script it works as described and the events get stuck. This is the first issue. I can't figure out how to manipulate the speed of event 3 aproaching event 4. I'd like event event 4 to be able to always be ahead some steps.

View attachment 281362

I tried the lower script I also found in the MZ Script Calls here in the forum and I get an error and this is the second issue. Why is it not working?

View attachment 281363

Thank you for you time!
If you use that script outside of a move route, "this" becomes the game interpreter. You would have to either put that script in a move route or if you leave the script where it is, change it to "this.character(0)" to refer to the event whose page youre calling it from.
one event to control the moves of both event 3 and 4 to be able to coordinate their move
I'll keep that in mind, thanks.

I don't know if it is of importance but the above described szene does not happen in a cutscene. It's parallel to the player characters movement. My initial intention was to create an alien (from the movies) lifecycle:

Hatch an egg -> facehugger (event3) -> run to npc (event4) -> infest -> birth chestburster

The player places the eggs and collects the newly born chestbursters. So far everything worked except the "run to npc" part. After I found the script

$gameMap.event(3).moveTowardCharacter($gameMap.event(4));

I noticed that the events start blocking each other and I was curious how to change that (not that it is important for my alien lifecycle). So here is event 4:

show us how event 4 is controlled
event5.png

It just walks around randomly.

No matter how fast or slow I set any of the events movement, event 3 always catches up and both are stuck. It looks like event3 fastforwards itself.
Use the passable events plugin from here:

That is because your other event is incomplete to what you want.
you need code to detect if the event 3 has reached event 4 and then change its behaviour, and that code is completely missing.

as said above, with your description now the event 3 does exactly what it is supposed to do, only that you forgot to add the code to check for the later parts of
-> infest -> birth chestburster
Use the passable events plugin from here:

I'll have a look at it.

as said above, with your description now the event 3 does exactly what it is supposed to do, only that you forgot to add the code to check for the later parts of
Okay, I start there.
No matter how fast or slow I set any of the events movement, event 3 always catches up

If you want the escaping event to not be caught, set its move route to move away from the chasing event. there should be a special command for it in the "set move route" menu. It won't stand much of a chance if it's moving randomly...
Also, frequency is more relevant than speed when it comes to events movements. a frequency of 3 is too low imo to simulate a realistic chase.
If you want the escaping event to not be caught, set its move route to move away from the chasing event. there should be a special command for it in the "set move route" menu.
There isn't, there's only move toward/away from the Player.

But the other event could use the moveAwayFromCharacter() script call just like moveTowardCharacter() is already being used.

Original thread: https://forums.rpgmakerweb.com/threads/event-move-to-event-not-working-correctly-beginner-question.162372/