Ink Integration - Save/Load Issues

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
jumpovertheage
Posts: 11
Joined: Fri May 08, 2020 10:42 am

Ink Integration - Save/Load Issues

Post by jumpovertheage »

Hi,

I'm having some issues with the ink integration. When I run my scene normally Ink works great, I can run and interact with conversations in the dialogue UI. But when I start at my menu scene, and call load save from slot, and load into the scene then the ink features no longer work. The system isn't giving me any error codes, but it seems to no longer be able to access the ink file for some reason. Other variables are loading fine, but starting an ink conversation just brings up a blank UI.

"Include in Save Data" is ticked in the Ink Integration, and I am using the Binary Data Serializer and saving raw data from the dialogue system.

Do you know what the issue might be?
User avatar
Tony Li
Posts: 22037
Joined: Thu Jul 18, 2013 1:27 pm

Re: Ink Integration - Save/Load Issues

Post by Tony Li »

Hi,

I'll assume your fully-configured Dialogue Manager GameObject is in your gameplay scene. Drag this GameObject into the Project view to create a prefab. If you're asked whether you want to create a Prefab Variant or New Prefab, either is fine. A Prefab Variant keeps it linked to the original Dialogue Manager prefab. This allows it to receive changes if the original Dialogue Manager prefab changes (e.g., if it changes in an updated version of the Dialogue System).

Then add that Dialogue Manager prefab to your menu scene, removing any old Dialogue Manager GameObject (if present) in the menu scene first.

By default, the Dialogue Manager survives scene changes at runtime and supplants any Dialogue Managers in subsequently-loaded scenes. If the Dialogue Manager in the menu scene isn't configured with the Ink integration components, then it will carry across to the gameplay scene, and the Ink features will not work.

The GameObject containing the Save System component also behaves the same way. The Save System component may be on the Dialogue Manager GameObject or its own separate GameObject.
jumpovertheage
Posts: 11
Joined: Fri May 08, 2020 10:42 am

Re: Ink Integration - Save/Load Issues

Post by jumpovertheage »

Hi Tony,

I did already have it set up that way, with a prefab Dialogue Manager which is in both scenes. But it seems I need to have completely deleted (not just deactivated) the dialogue manager in the gameplay scene I am loading into to get the correct outcome.

Thanks for your help!
User avatar
Tony Li
Posts: 22037
Joined: Thu Jul 18, 2013 1:27 pm

Re: Ink Integration - Save/Load Issues

Post by Tony Li »

It should have ignored the inactive Dialogue Manager, and if Don't Destroy On Load and Allow Only Once Instance are ticked it should also replace it. But if it works now, great!
jumpovertheage
Posts: 11
Joined: Fri May 08, 2020 10:42 am

Re: Ink Integration - Save/Load Issues

Post by jumpovertheage »

Hi Tony,

I'm having a different issue now, hope you don't mind if I add it here.

I'm looking to use the dialogue systems save/load system on Nintendo Switch, but can't find any existing documentation on this. As far as I am aware Switch does not support player prefs, so I imagine a custom save game data storer would be the necessary component here? Have you previously worked on making the save system compatible, any help would be much appreciated.

Thanks!
User avatar
Tony Li
Posts: 22037
Joined: Thu Jul 18, 2013 1:27 pm

Re: Ink Integration - Save/Load Issues

Post by Tony Li »

Hi,

Due to NDA requirements, I can't disclose code for most consoles, including Switch. However, I can provide guidance.

For a quick interim solution, you can download the PlayerPrefsSwitch package from the Nintendo Developer forum. This will allow you to use PlayerPrefsSavedGameDataStorer while you're developing your game.

The nice thing about the Dialogue System's Save System is that you can swap out the SavedGameDataStorer component for a different one without having to change anything else.

In the longer term, you'll want to make a new subclass of SavedGameDataStorer that uses Nintendo's fs API. Override StoreSavedGameDataAsync so you can kick off the save in the background without freezing gameplay (which is a requirement for cert).

I recommend adding platform conditions to handle saving on different platforms. For example:

Code: Select all

public override SavedGameData RetrieveSavedGameData(int slotNumber)
{
#if UNITY_SWITCH && !UNITY_EDITOR
    // Your Switch code here
#elif UNITY_XBOXONE && !UNITY_EDITOR
    // Your Xbox code here
#else
    // Your other code here, etc.
#endif
}
jumpovertheage
Posts: 11
Joined: Fri May 08, 2020 10:42 am

Re: Ink Integration - Save/Load Issues

Post by jumpovertheage »

Hi Tony,

Thanks for this, as we are moving into NDA territory I have sent you an email so we can chat further.

Appreciate the great support!
Post Reply