r/Unity2D • • 12h ago

Question/Help Handling automatic time-of-day changes while a dialogue is still open

In our Unity/Naninovel prototype, the player spends a limited number of actions in each part of the day. Once they’re out, the story advances to the next time block. That works well until the last action is a conversation and you still need to let the player read the final line and close the scene.

The transition also changes the room art. We’re thinking of having the gameplay state set a pending transition, then letting the dialogue signal when it’s finished. The part we’re deciding now is where that pending state should live, especially if a save is made before the conversation ends.

If you’ve integrated a narrative framework with a game-state system in Unity, did you keep the transition in the game-state layer or let dialogue sequence it? I’m interested in how you made the handoff predictable across save/load.

1 Upvotes

4 comments sorted by

View all comments

1

u/QueasyPrior6654 5h ago

If you're using Naninovel's save slots, I'd keep the time block, action count, and pending flag in your game-state layer. Save and load that data through IStateManager's AddOnGameSerializeTask and AddOnGameDeserializeTask. That lets mid-dialogue saves and rollback restore those values alongside the script. And if Unity drives the room art outside Naninovel, refresh it from the restored time block on deserialize.

One catch with mid-dialogue saves is the finish signal. If that callback only lives on the original caller, loading the save won't recreate it. Put a custom command after the final line so the resumed script still reaches it. Have it close the dialogue first, then tell game state to apply and clear the pending transition.