Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
Sign in to follow this  
rabbidpillow

Time sensitive NPCs

Question

at the moment i have a switch for when it turns night and thats all fine and dandy, but how would i make them stay until the player moves out of sight of them or until he goes indoors, obviously i don't want randomly vanishing NPCs. thanks in advance :)

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

I guess there are several ways to accomplish this. You could use a pathfinding-script that'll automatically guide the NPCs to their homes for example, when the Switch is activated. But it isn't an easy task, you'd also have to check if the NPCs already arrived at their homes and so on.

 

Otherwise you could "freeze" the time, while the player explores the village but I think that isn't what you're looking for exactly ;)

Edited by stardust

Share this post


Link to post
Share on other sites
  • 0

I guess there are several ways to accomplish this. You could use a pathfinding-script that'll automatically guide the NPCs to their homes for example, when the Switch is activated. But it isn't an easy task, you'd also have to check if the NPCs already arrived at their homes and so on.

 

Otherwise you could "freeze" the time, while the player explores the village but I think that isn't what you're looking for exactly ;)

thanks :) decided to go with freezing time in places like villages etc, i was having a lot of other problems too relating to the time in villages so this is probably the best way to sort it all out :P tah.

Share this post


Link to post
Share on other sites
  • 0

I don't quite understand what your problem was but it seems as thought you've solved it?

Share this post


Link to post
Share on other sites
  • 0

I don't quite understand what your problem was but it seems as thought you've solved it?

 

He wanted some NPC to be there at night and some to be on during the day. However he didn't want them to just randomly disappear when you standing next to a NPC while the game transitions from day to night, but instead when it turns dark the NPC should still be there until the player walks away from the NPC until he's off the screen. Once off the screen he should be in that spot anymore but in his/her house. I'm not good at eventing yet or scripting dealing with time, so I wouldn't be able to help.

 

Think of Zelda

Edited by bigace

Share this post


Link to post
Share on other sites
  • 0

Oh boy this could get fun...so I'll try to explain this the best I can. Remember to turn switches on and back off between cycles. (This is just a theory is majorly untested and could potentially be very confusing).

1st. You will need two switches one for the day time and one for the night time. For the day time you can leave the NPC outside which is what I'm assuming so you wont need to do anything there.

2nd. When it turns night time you will need to set his graphic already there. Next you will have to set two variables for the NPC position. Now the player can see 10 north, 10 east, 10 south, and 10 west. You will need to set conditional branches for this area of sight. For example if the NPC is at the grid spot 10,10; you will need to set it to 21X,21Y for two conditional branches right next to each other. Then another pair for -1X,-1Y. Set the first pair to equal or more and the second pair to equal or less than.

3rd. Then set an else case under these that turns on a switch like Player Sees NPC.

4th Okay quick recap 1st page switch day time is on. 2nd page switch night time is on and the events on parallel process. 3rd page night time is on and player sees NPC is on then you want the graphic of the event and the same commands as the 1st page.

Okay there is the solution to your problem, however now there is another major problem. You will now need a way so if the player is off the screen for any period of time and does not see the NPC during the transition or after the 1st time so it doesn't happen or keep happening when it shouldn't. Okay so here is what I suggest.

1st. Set a conditional branch that if the player is off screen that when the switch night time is on that it sets a switch that so the player wont run into the event.

2nd. After the 1st time it happens when the player goes off screen that it also turns on a self switch, so it don't do it again.

So I hope this correct it is just a theory. I'm kinda confusing myself in it. Just do the best you can if you plan to use it and I should be able to help or if anyone wants something similar done.

Share this post


Link to post
Share on other sites
  • 0

I'm not sure if I got your idea the right way, Dragon324. But I think you wan't to "hide" the NPCs when they're off screen, not visible to the player, right? I think this would be achievable, but it's very inconvenient, since you'd have to keep track with any NPCs to check their positions and so on. And I think it wouldn't look very nice, because the NPCs still disappear very "abrupt". The only difference is, that you wouldn't see them disappear.

 

I hope I could explain this somehow imaginable xD Otherwise it seems that rabbidpillow solved the problem by freezing the time in town. An idea I've got from the old SNES - Harvest Moon ^^ (aww, good old times ;D)

Edited by stardust

Share this post


Link to post
Share on other sites
  • 0

I'm not sure if I got your idea the right way, Dragon324. But I think you wan't to "hide" the NPCs when they're off screen, not visible to the player, right? I think this would be achievable, but it's very inconvenient, since you'd have to keep track with any NPCs to check their positions and so on. And I think it wouldn't look very nice, because the NPCs still disappear very "abrupt". The only difference is, that you wouldn't see them disappear.

 

I hope I could explain this somehow imaginable xD Otherwise it seems that rabbidpillow solved the problem by freezing the time in town. An idea I've got from the old SNES - Harvest Moon ^^ (aww, good old times ;D)

 

Or Zelda as I've already explained.

Edited by bigace

Share this post


Link to post
Share on other sites
  • 0

I'm not sure if I got your idea the right way, Dragon324. But I think you wan't to "hide" the NPCs when they're off screen, not visible to the player, right? I think this would be achievable, but it's very inconvenient, since you'd have to keep track with any NPCs to check their positions and so on. And I think it wouldn't look very nice, because the NPCs still disappear very "abrupt". The only difference is, that you wouldn't see them disappear.

 

I hope I could explain this somehow imaginable xD Otherwise it seems that rabbidpillow solved the problem by freezing the time in town. An idea I've got from the old SNES - Harvest Moon ^^ (aww, good old times ;D)

This is so true :P and ur right it is very inconvenient, I was just mostly giving my two cents cuz I was bored lol. The only true way to do it is have them set at certain locations when it turns a certain time and create a move route from their point to their house :D. So you would have to have exact timing and multiple switches and variables in order to get the full "real look". So I would just stick where you are with the time freezing. However like mentioned if you use random movement this would be a major problem.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...