Two questions about variables and switches for two different scenarios.

Back with yet another question:

So I have this room seen below. The player talks to the guy to his left and asks him if he can go into the room at the top. Once he has permission, it sets a variable called Grant Access to 1. Then when I talk to the guy in front of the door, he moves to the side. If I interact with him again he says "You can go in I said." I can then go into the room and come back out. Here is my problem: when I come back out, the guy who was guarding the door is back in front of it again.

I followed this tutorial to get this far:

But what if I wanted it so that when you came back out the guy is still standing to the side of the door? The video doesn't really go over this. In the video, he just sets it so when you exit out of the door in the other room, it sets the Grant Access variable to 3 and on the NPC he makes an event page that has no commands and a blank image, basically rendering the event invisible and gone.

So is there some way to do this easily?

A follow-up, more advanced question for a large scale change would be this: In a lot of RPGs you would go to a town and every NPC would have their dialogue set, but then after you go and complete a set action - lets just say you go and beat a dungeon - then when you return to the town you might have it so all the NPCs are different. They might have different dialogue now that reflects your completed action or new positions, etc.

How is something like this set up in RPG Maker? Is it variables or switches again somehow?

Sorry if I'm creating a lot of threads and asking a lot of questions, but I'm learning a ton from all the answers I've been getting and am really starting to love this program.

upload_2018-1-15_23-13-44.png
Move Route and Set Event Location commands do not save the location where the event went if you leave and re-enter a map. That's one of the most frustrating things I run into, really.

What I do if I want to save a position for the event, is I use that map for the cutscene, and then COPY it, paste it under and that map is for player interaction. And on that map you can set it so that the event with the npc is just there rather than walks there.

I basically have two separate sections of maps, one for cutscenes and one for player interaction after those cutscenes as they usually have different events placed there.

Another way would be to make a parallel process event with "Set Event Location" command so that the event constantly sets that event's position to the side of the door so even if he moves back, before the screen of the transfer fades in, the event will already be there.

Also, you can use a conditional branch for the variable as explained in the video to do a constant set event location as well if you wish. It would add more space for interaction, but isn't necessary.

EDIT: And do not be sorry for asking a lot of questions. It's okay, we have all been there. And besides, you're not asking those "Hey, how do I make my char speak?" Type of things where the answer is obvious.
Actually, there is a much, much easier way.

Create an event at the position you want the NPC to be when you enter the room after he has moved away.
When the player leaves through the now unblocked entrance, the Grant Access Event is now set to 3, correct?

So make it so then when it's set to 3, the event where you want him to be is now visible. (Make the Page's Variable condition Grant Access 3 or above)

Now, when you come back, the old NPC is gone and the new NPC that's in the right spot is there.

As for updated dialogue, you just make it so that a variable, perhaps named Story Progression, is set higher and higher as you go through the game.

Then, for NPCs, make new pages and set the Variable condition for that page to be aligned with the Story Progression. Maybe story progression is 15 when you defeat the boss of dungeon 3. So now you know it's 15 at that point.
Just make it so the page condition for the variable is 15. Then, put in some new dialogue.

(EDIT: Also, SRDude is a great guy. Talked to him a few times. However, he has committed the cardinal sin of teaching Variables and Switches without teaching Conditional Branches.
Variables and Switches are super duper simple, and super useless and worthless without conditions. There's no point in teaching them unless you hammer Conditions into someone's head.)
Actually, there is a much, much easier way.

Create an event at the position you want the NPC to be when you enter the room after he has moved away.
When the player leaves through the now unblocked entrance, the Grant Access Event is now set to 3, correct?

So make it so then when it's set to 3, the event where you want him to be is now visible. (Make the Page's Variable condition Grant Access 3 or above)

Now, when you come back, the old NPC is gone and the new NPC that's in the right spot is there.

As for updated dialogue, you just make it so that a variable, perhaps named Story Progression, is set higher and higher as you go through the game.

Then, for NPCs, make new pages and set the Variable condition for that page to be aligned with the Story Progression. Maybe story progression is 15 when you defeat the boss of dungeon 3. So now you know it's 15 at that point.
Just make it so the page condition for the variable is 15. Then, put in some new dialogue.

(EDIT: Also, SRDude is a great guy. Talked to him a few times. However, he has committed the cardinal sin of teaching Variables and Switches without teaching Conditional Branches.
Variables and Switches are super duper simple, and super useless and worthless without conditions. There's no point in teaching them unless you hammer Conditions into someone's head.)

Oh, that sounds pretty good. With this way, you're completely removing an NPC/event after a variable is active and actually replacing it with a whole new event that just looks the same and has new dialogue, right? I sort of thought it was surprising that you can transfer the player position through events but not change the position of an event.

I'll try out your way.

I've watched most of SRDude's vids and a few of yours now. Did watch the video where you were talking yourself up about being good with events lol, so I'm definitely looking forward to learning from those vids and learning the ins and outs of events myself.

EDIT: tested out using a Story Progression variable suggestion for NPCs. Works awesome!
I'm surprised RPG Maker hasn't built in a dynamic way to change the starting location of events when entering a map. Well, there's a few features Degica hasn't added to their engine that other companies have.

Anyways, you seem to understand my suggestion. Just change which event is visible at different times.

If you wanted to make your life easier, just run all linear parts of your game's progression on a single variable.

My tutorials are alright. I only recently started writing out scripts to help improve the quality of my tutorials. I want to make something like SRDude's vids. Mine are very technical, his are more goal oriented. I've become surprisingly busy over the last two weeks, so release vids hasn't been as practical as I would have liked.

Original thread: https://forums.rpgmakerweb.com/threads/two-questions-about-variables-and-switches-for-two-different-scenarios.89949/