A tricky eventing problem

First off, sorry 'bout the title, I have a hard time explaining this in a single sentence.

Starting point:

I have a "Park" map. In this map there's an old man walking towards a bench.

What I want:

1. The player to be able to talk to the old man as he's walking.

2. When the player visits the park for the 2nd (or higher) time, the old man will stay on the bench and will say something else when talked to.

What I did:

1. Created an auto-run event that adds +1 to "Park Visits" variable, then destroys itself (to avoid an endless loop).

2. Created an event of the old man with a walk route to the bench. Added the following commands:

Spoiler
[IMG]http://puu.sh/6woA7.png[/IMG]
3. Created another event with the same sprite, this time on the bench. Added the following commands:

Spoiler
[IMG]http://puu.sh/6woFA.png[/IMG]
End Result:

Both old men exist in the world. If I speak to the old man on the bench, he deletes himself (I always test in a new game, thus "Park Visits == 1").

I tried using Autorun and Action button triggers on both men, but didn't get my wanted result:

Wanted Result:

The 2nd old man does not exist in the first visit in the park. The 1st old man does not exist in any visit afterwards. In both cases you can talk to the old man.

Any tips?

Thanks!
Erase event is not a permanent command.  It only means that the event vanishes until the next time you visit that map.

Instead of having erase event, put in a control self switch.  Make a second page.  Make that switch a condition. Have no graphic.

then when the switch is activated the game will use the blank second page, and you won't see the first old man at all.
I think you're over complicating this a bit. At the end of the old man's move route to the bench, turn on a switch. Have a second page conditioned to that switch, and there you can change the graphic to a sitting one and have the dialogue change when he's sitting down. The only thing you'd have to have is a conditional check in a parallel process when you start the map (like, if you have one where you tint the screen, you can put this there) that checks whether or not the "Old Man Sitting" switch is on. If it is, you'd use the set event location command to move the old man's event to the bench instead of where his initial move route would've started.
I think you're over complicating this a bit. At the end of the old man's move route to the bench, turn on a switch. Have a second page conditioned to that switch, and there you can change the graphic to a sitting one and have the dialogue change when he's sitting down. The only thing you'd have to have is a conditional check in a parallel process when you start the map (like, if you have one where you tint the screen, you can put this there) that checks whether or not the "Old Man Sitting" switch is on. If it is, you'd use the set event location command to move the old man's event to the bench instead of where his initial move route would've started.
Yes! It worked! Thanks for the help!

Something I'd like to add: Because the man is old, he moves slowly, so it's possible that the player will leave the map before he gets to his destination (thus leaving the switch off and causing him to walk from the beginning). To fix this, I've made a parallel process event like you said but instead of having the switch trigger I've added 2 conditional branches: one checking for the switch (in case he did get to the bench) and one checking if "Park visits > 1". There's a slight problem with it - if the old man's event is moved because of "Park visits >1" (Which is the 2nd conditional branch), the old man will appear for a few frames and then "teleport" to the bench. Any way to make it so he teleports instantly, preferably without making a new event?
If you want the old man to stay on the bench without creating a second event (which is much more stable, by the way, than creating a parallel process event) there is a script which will enable you to do that.  I'll see if I can find it for you.

EDIT

Here it is. http://forums.rpgmakerweb.com/index.php?/topic/1853-remember-event-position/

As a general rule, I think it best to avoid putting in parallel processes unless strictly necessary.  Even one poorly designed parallel process can cause significant lag and other problems.
If you want the old man to stay on the bench without creating a second event (which is much more stable, by the way, than creating a parallel process event) there is a script which will enable you to do that.  I'll see if I can find it for you.
If creating a new event is better, than I'll use that.

What I'm worried is filling the map with those kinds of events but for other characters.
Better that than having parallel processes all over the place.
May I see your parallel process event? Because I just tried it out and my character teleported instantly.

And parallel processes on there own aren't bad, it's really just the amount of code you put into it. If you've got several massive parallel processes running in tandem, then yes you're going to have lag, but a few small ones like this aren't going to do much harm.
May I see your parallel process event? Because I just tried it out and my character teleported instantly.
Sure, here you go:

Spoiler
[IMG]http://puu.sh/6ws0R.png[/IMG]
I don't know if it matters, but I have another autorun process for counting park visits (Adds +1 to park visits variable, then deletes the event).
Why would you have that in an autorun event instead of just putting it in the parallel process? That's probably what's causing the wait, since autorun events don't start until the map loads, and parallel processes start before. And also adding the erase event command at the end is helpful, because it stops the event from looping (which can also cause lag if you've got it looping through lots of code). But this is how I had mine set up and it worked just fine:

3R2Dc1B.png


You also need to make sure to turn on the switch in the variable condition to make sure you trigger the old man event's second page
Thanks! That helped. I have a lot to learn when it comes to effective use of events.

Mods - you can lock the thread now.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/a-tricky-eventing-problem.22857/