I was thinking that if I make one city in one layout and trying to avoid NPCs from going anywhere, I would just set roofs in houses to opacity 0, and that if the player goes in, the roof's opacity becomes invisible or something. But of course, it does not apply to NPC since they wont need it. And if the town is big enough, then probably NPCs going outside of that map may be needed no longer.
And if they do, I'd just make some kind of counter that:
If NPC1 goes out of map1, then NPC1Outsideoftown=1 indicating that NPC1 is no longer in map1 and but in Map2.
If Map2 is loaded, it checks which NPC has a value of 1 in the NPC1outsideoftown variable. Maybe I could make it a private variable. But I think that would be time consuming.