Page 2 of 2
Re: RPG Builder Integration Questions
Posted: Tue Dec 27, 2022 2:50 pm
by Tony Li
I don't think anything in Quest Machine is breaking the save data. I'll let you know what I find.
Re: RPG Builder Integration Questions
Posted: Tue Dec 27, 2022 8:12 pm
by Tony Li
I haven't been able to reproduce the issue. Would it be possible for you to send a
reproduction project to tony (at) pixelcrushers.com along with reproduction steps, or provide reproduction steps using the DialogueSystemDemoObjects prefab in RPG Builder's default demo scene?
Alternatively, you could try making these debug changes to the DialogueSystemRPGBuilderBridge script:
1. In the LoadDialogueSystemDataAtEndOfFrame() method, change these lines (starting on line 136):
Code: Select all
if (Character.Instance.CharacterData.CustomStringData.TryGetValue(DialogueSystemRPGBuilderSaveDataKey, out s))
{
SaveSystem.ApplySavedGameData(SaveSystem.Deserialize<SavedGameData>(s));
}
to:
Code: Select all
if (Character.Instance.CharacterData.CustomStringData.TryGetValue(DialogueSystemRPGBuilderSaveDataKey, out s))
{
Debug.Log("Loading save data: " + s);
SaveSystem.ApplySavedGameData(SaveSystem.Deserialize<SavedGameData>(s));
}
else
{
Debug.Log("No existing save data to load.");
}
2. In the OnSaveCharacterData() method, change this line (line 112):
Code: Select all
string s = SaveSystem.Serialize(SaveSystem.RecordSavedGameData());
to:
Code: Select all
string s = SaveSystem.Serialize(SaveSystem.RecordSavedGameData());
Debug.Log("Saving data: " + s);
When you play, you'll see "Saving data: ..." every few seconds.
You'll see "Loading save data: ..." when you select a character from the main menu. If it's a new character, you'll see "No existing save data to load" instead.
This might give you some idea of what's going on.
Re: RPG Builder Integration Questions
Posted: Wed Dec 28, 2022 6:37 am
by Solange
Hi Tony,
It sounds like the issue is on my end then, which is what I suspected.
Thank you for the debug code.
Here's what I get:
Loading save data: {"m_version":0,"m_sceneName":"DreamcatcherLobby","m_list":[{"key":"ds","sceneIndex":-1,"data":"Variable={Alert=\"\", MayorState=1,
followed by a whole slew of the other variables.
It looks like it's always saving into the key of "ds" for every character. I'm not sure if that is intended or not.
At any rate, I was messing around with that first variable (MayorState 0 to 1) and it looks like Dialogue Manager is in fact saving that correctly according to the character I'm on. That's good news.
So that makes me think the issue is with the Savers on the other objects in the scene.
For example, I'm using some of your Enabled Savers. I have one of them on the Battery Panel object and it looks like this:
Script: Enabled Saver
Key: ____
Append Saver Type to the Key: Checked
Save Across Scene Changes: Checked
Restore State on Start: Unchecked
Component to Watch: Battery Panel (Highlight Effect)
This is on the Battery Panel object
Perhaps I need to use the "ds" key like the save file? I'm not sure. I thought the keys had to be unique.
There's also a Position Saver on the player character, and that uses the "Player" key, which I copied manager prefab that you included in the Integration. I suspect this Position Saver is also loading the incorrect data, causing the player to spawn in another character's location
thanks for the help
Re: RPG Builder Integration Questions
Posted: Wed Dec 28, 2022 7:41 am
by Tony Li
Hi,
You don't need a PositionSaver on your player. RPG Builder should already save the position.
Also, UNtick the Save System component's "Save Current Scene" checkbox.
In fact, if possible, use the Dialogue Manager prefab that comes with the RPG Builder integration. It's already preconfigured with a bunch of settings that are necessary to work with RPG Builder.
Re: RPG Builder Integration Questions
Posted: Wed Dec 28, 2022 8:55 am
by Solange
OK, I'm not crazy.
I reproduced the issue very easily on a fresh project with nothing but RPG Builder and the Dialogue Manager integration.
I put the Dialogue Manager prefab you included w/ the integration inside RPG Builder essentials.
I then created 4 cubes as triggers with a Dialogue Manager System On Trigger effect that disables their Mesh Renderer component.
I then attached Enabled Savers to these cubes, to save their Mesh Renderere state.
If you exit back to Main Menu, and then create a new character, these cubes will still have their Mesh Renderer component disabled. The Enabled Saver is not taking into account the fact that you're on a different character.
edit: the strangest part is that sometimes it saves and sometimes it doesnt. but if you keep creating characters, exit to main menu, remake, and wipe the list occasionally, you should run into the problem
Re: RPG Builder Integration Questions
Posted: Wed Dec 28, 2022 2:47 pm
by Tony Li
Found the issue. RPG Builder doesn't provide a hook to save scene data when leaving a scene, so the integration has a script that monitors when the scene is changing and saves the scene data (e.g., EnabledSavers, etc.) before leaving the scene. This script was also saving the scene data just before returning to the main menu scene, but intermittently just
after the hook that cleared the save data in preparation for the main menu scene. In other words, it was undoing the clearing, and leaving the save system with the save data from the previous character's instance of the gameplay scene. This patch should fix it:
DS_RPGBuilderSupport_2022-12-28.unitypackage
Re: RPG Builder Integration Questions
Posted: Thu Dec 29, 2022 8:55 am
by Solange
Thanks so much!
Re: RPG Builder Integration Questions
Posted: Thu Dec 29, 2022 9:11 am
by Tony Li
Thanks for letting me know about the issue.
I'll be putting out another update this week that adds a Lua function to add crafting recipes to the player, and to add some more example DS quests to the example prefabs.