So when making my game, I decided to include a day/night system to add more immersion. And I figured there wasn't much point of a day/night system if NPCs stood around in the same area all day, so I added a "Nighttime" variable that updates on a certain hour. At this time, most NPCs outside will disappear and instead appear inside their homes.
Currently, if you wander around outside and it turns to night, there's a brief fade to black. This acts as a "transition" to night, but really it's my way of trying to cover how awkwardly NPCs disappear when night arrives.
I'm thinking "Wouldn't it be better if the NPCs actually walked over to their houses and then went inside?" The problem is how to implement it. With Galv's Move Route Extras script, I can easily have the NPCs simply make their way to their homes, regardless of where they are, the problem is setting the right switches to make it function properly. I've thought of two potential methods, but both have a glaring problem.
Method 1: Have the NPC's move route take them home when "Nighttime" is on.
Problem: This might work when it first turns to night, but say you visit the NPC in their home. When you go outside, you will see the NPC repeating their move route to head inside. That isn't right.
Method 2: Have the NPC's move route occur during a certain hour. So say we have an NPC who is outside from hour 8-18. At hour 18, NPC starts a move route to their house. At hour 19, they should be inside and disappear outside.
Problem: But what happens if something slows the NPC down? Or you come outside at 18:55, the NPC is on their move route home, and it turns to hour 19 before they can make it, causing them to abruptly disappear?
Does anyone have any idea how this could be handled properly? Obviously it doesn't really matter what they do if the player isn't around to see it, but if the player is around they should be seen moving to their homes until they make it to the door or the player transitions somewhere. I'm open to using scripts if necessary.
Currently, if you wander around outside and it turns to night, there's a brief fade to black. This acts as a "transition" to night, but really it's my way of trying to cover how awkwardly NPCs disappear when night arrives.
I'm thinking "Wouldn't it be better if the NPCs actually walked over to their houses and then went inside?" The problem is how to implement it. With Galv's Move Route Extras script, I can easily have the NPCs simply make their way to their homes, regardless of where they are, the problem is setting the right switches to make it function properly. I've thought of two potential methods, but both have a glaring problem.
Method 1: Have the NPC's move route take them home when "Nighttime" is on.
Problem: This might work when it first turns to night, but say you visit the NPC in their home. When you go outside, you will see the NPC repeating their move route to head inside. That isn't right.
Method 2: Have the NPC's move route occur during a certain hour. So say we have an NPC who is outside from hour 8-18. At hour 18, NPC starts a move route to their house. At hour 19, they should be inside and disappear outside.
Problem: But what happens if something slows the NPC down? Or you come outside at 18:55, the NPC is on their move route home, and it turns to hour 19 before they can make it, causing them to abruptly disappear?
Does anyone have any idea how this could be handled properly? Obviously it doesn't really matter what they do if the player isn't around to see it, but if the player is around they should be seen moving to their homes until they make it to the door or the player transitions somewhere. I'm open to using scripts if necessary.