Hey everybody,
I just implemented an evented day/night system into my game that changes daytime after a specific amount of frames. Upon changing from evening to night or morning to day, the screen fades out for two seconds and plays a ME to not have an abrupt change of events on the map.
However now I noticed the one big problem: When you stand on a spot at daytime that's filled by an NPC at night, you'll be stuck in the NPCs spot as soon as daytime changes.
Do you guys have any tips on how to solve this issue? What did you do in your projects?
Please show screenshots of your events - we need to see how you made them to identify your mistake, because usually nothing can change the passability for the player in the way you describe (unless you've some scripts that change the engine)
I'm not sure what exactly you want to see, maybe you can elaborate.
For example an NPC that's only present at night (it stands in one spot and the page has condition "switch:night is on") will block me when I decide to keep standing there at daytime. As soon as the time changes and the night-switch flips, the NPC will appear on the spot I'm standing on and I can't move away.
edit: maybe I should add that it's an evented system. no script involved
Show us the event page. We won't know what you did wrong from listening to you describing how your event is supposed to work.
Saves us time imagining what could have gone wrong with your event as well.
Yes, you stated that it is an evented system before - that's why I asked for screenshots of the event pages.
We need to see all event pages that control and calculate the time, and the event pages of an example of an event that would block the player.
And we need the screenshots because in simple descriptions like you gave until now most people forget to describe half of the options or structure, not to mention that there have been several cases where errors in the description (describing something that wasn't the same in the event) have hidden the bug.
So... you don't want NPCs to appear 'under' the player when the day cycle changes? This isn't an issue with your Day/Night event, it's an event placement issue? There's a lot of ways to approach this... You could simply move your character during the screen-fade to ensure that they're not standing atop any events. That's one the most direct approaches I can think of.
Yeah its not a technical issue but simply one of game design. I have thought about the approach of moving the player, however it would have to move the player differently for every single event (to ensure youre not landing on an unwalkable tile again or so you dont end up on a region youre not supposed to go to (yet) (for example when a guard is blocking your way)) so I dont know if this is the most practical approach.
I would love to hear how other people designed their time-systems. I have thought about time-change upon switching maps but I'm not sure if I like that. Another way would be to have infinite day and night that only change as soon as you go to bed and choose "sleep until until night / next day" but this makes the time les dynamic and makes evening and morning obsolete.
This is one of the reasons I decided to start studying ruby programming. What I had in mind was using a script call within a conditional branch, something that's safe to copy/paste and make changes where needed.
$game_map.events[@event_id].x == $game_player.x && $game_map.events[@event_id].y == $game_player.yShould check if the player is standing atop the current event. From there, you use a player transfer or move route to nudge the player out of the way. Sure you'd need this for every NPC affected by the day cycle, but it does minimize the work load.
My approach to this potential issue was to have events autopath if the player is around when the cycle changed, otherwise, they're just teleported or switched on/off.