I want to make NPC come into my house

H I am new in this game.

I want to ask a question. How to make a NPC from other map come into my house like the sims game and interact with them. If I go out from my house, the NPC will leave too and they should be invited again.
I have moved this thread from RPG Maker MV Tutorials to RPG Maker MV Support.
@RallyGo
The most important thing to learn is that you have absolutely no NPCs.

What you have is events pretending to be NPCs, nothing else.


Now, events themselves cannot leave any map, they are always only on the map they were placed on.

But what you can do is to use different events on different maps to pretend to be the same NPC.
Which means you need to have one event on the outside map following you until you get to the transfer event to your home, and then a different event on your home map pretending to be that NPC that has supposedly followed you despite never being outside that home map.

the rest is preprogrammed behaviour with switches and variables telling the engine what is supposed to be what and where - because the events on other maps do not exist, only the current map's events are processed at all.
The first thing to bear in mind is that when you really drill down to it, the engine doesn't have "NPCs". There are characters, but the graphic they have isn't limited to people, nor do they have to act like people. Nor *can* they act like people, really, because they don't know what that means.

The second thing is that characters are still events, and outside of common events an event only exists on one map. It has no sense of permanence between areas; an event representing a character on one map and an event representing the same character on a different map are different events with no concept of the other's existence, regardless of what dialogue or function you put in the events themselves.

However, what you *can* do is use move routes, switches and variables to make it *look* like the NPC is moving around between areas. That has its own set of pitfalls, as leaving the map before their move route is done means they'll be back at their starting point when you return, so you'll have to look into ways to keep track of where an NPC is on the map and save its location for returning.
You can use an event spawner to spawn them in at the doorway under certain conditions.

Original thread: https://forums.rpgmakerweb.com/threads/i-want-to-make-npc-come-into-my-house.162058/