Page 1 of 1

Upgrading from Version 1.x

Posted: Fri Sep 11, 2020 4:27 pm
by bluebuttongames
Hi there!

So, I'm looking to upgrade Dialogue System to 2x from 1.9, the guide says this:

"
Delete the entire Dialogue System folder. (If you're using Unity 5.x, do not do this until you've switched to Force Text serialization.)
If you've moved any Third Party Support folders out of the Dialogue System folder, delete them, too.
Make sure your project still compiles. If you have additional scripts that depend on the Dialogue System, you may need to temporarily export them to a unitypackage, delete them, and then reimport them after completing the upgrade."

I've tried this, and the result was extremely destructive, I end up with a circular list of dependencies, any script that referred to DM is removed, then any script that referred to that script now throws an error, etc etc.

Is this the way it absolutely has to be, that it must compile before you do the upgrade? It's going to be extremely painful to pick through.

Re: Upgrading from Version 1.x

Posted: Fri Sep 11, 2020 4:53 pm
by Tony Li
Hi,

Let's take it from the top. When you deleted the Dialogue System folder and imported version 2, what compiler errors were there?

(Note: It's OK at this point for scenes and prefabs to have 'missing script' warnings. They'll disappear when you run the 1x to 2x Updater menu item.)

You may not need to delete anything other than the Dialogue System folder and any Dialogue System third party integration folders. Then import version 2 and any third party integrations that you had deleted.

Once you've done that, there should hopefully be only a few, if any, compile errors. They'll probably have to do with a few small API changes in version 2, although I took as much care as possible to keep API changes to an absolute minimum. Once you update your scripts to handle those API changes, the project should compile. If it doesn't, please let me know what compile errors there are.

Re: Upgrading from Version 1.x

Posted: Fri Sep 11, 2020 5:06 pm
by bluebuttongames
So the order of events is:

-Project is fine
-Delete the Dialogue System Folder
-Now over 50 errors for various scripts that refer to Dialogue System
-You export those 50 scripts to an external package and remove them
-Now you have 100 more errors referring to those scripts

The instructions say the project needs to compile successfully before I do the upgrade, is that not the case?

Re: Upgrading from Version 1.x

Posted: Fri Sep 11, 2020 5:38 pm
by Tony Li
Yes, it must compile successfully. Let's try NOT exporting and deleting the scripts that have compile errors.

Try this order of events:
  • Project is fine
  • Close your current scene. (Use File > New Scene)
  • Make a note of which, if any, third party integrations you've imported from Dialogue System/Third Party Support (e.g., UFPS Support or whatever)
  • Delete the Dialogue System folder
  • Delete the Third Party Support integrations
  • Import Dialogue System 2.2.9.
  • Import third party integrations from Plugins/Pixel Crushers/Dialogue System/Third Party Support
  • Fix any of your own scripts that report compile errors. If you have any questions about how to resolve a compile error, please let me know
  • *** If you get to this point, the project should no longer have any compile errors.
    Select menu item Tools > Pixel Crushers > Dialogue System > Tools > 1x to 2x Updater

Re: Upgrading from Version 1.x

Posted: Sat Sep 12, 2020 3:24 am
by bluebuttongames
Ok, good advice.

So here's where I'm at.

A bunch of things were referring to PixelCrushers.DialogueSystem.NGUI which needed to change to PixelCrushers.DialogueSystem.NGUISupport.

Now the errors I'm left with relate to scripts that no longer exist:

LocalizeLabel.cs
LocalizeManager.cs
LocalizeToString.cs

Which previously lived in: Dialogue System\Scripts\Supplemental\Utility

It's possible I actually wrote these scripts and have forgotten, do you know if they ever existed?

Re: Upgrading from Version 1.x

Posted: Sat Sep 12, 2020 8:37 am
by Tony Li
Hi,

No, those must have been your own scripts.

Re: Upgrading from Version 1.x

Posted: Sat Sep 12, 2020 12:47 pm
by bluebuttongames
Ok, I've got it successfully upgraded and compiling, thanks for the help!

A lot of it works, but it looks like localisation changed quite a bit, there's probably a few things I need to change, starting with:

DialogueManager.DisplaySettings.localizationSettings.localizedText;

I was referring to this before, but now it seems the localizationSettings only has a textTable, not a localizedTextTable which I can't use containsField with?

Re: Upgrading from Version 1.x

Posted: Sat Sep 12, 2020 3:09 pm
by Tony Li
Localized Text Tables were deprecated in favor of the improved Text Table. If you inspect your Localized Text Table, you can click "Save As Text Table..." to save it as a new Text Table asset.

Text Tables have their own manual in Plugins / Pixel Crushers / Common / Documentation / Text_Table_Manual.pdf.

See also: Dialogue System Localization

API reference: TextTable

Instead of LocalizedTextTable,ContainsField(), use TextTable.HasField().

Re: Upgrading from Version 1.x

Posted: Sun Sep 13, 2020 9:00 am
by bluebuttongames
Success! Thanks.

I managed to get up to latest for the Dialogue system and to Unity 2019 but this line of code now returns blank:

string lineToSay = FormattedText.ParseCode(subtitle.dialogueEntry.currentLocalizedDialogueText);

It works in Unity 5x, but not in 2019. Any ideas?

Re: Upgrading from Version 1.x

Posted: Sun Sep 13, 2020 9:36 am
by Tony Li
Hi,

Check the value of subtitle.dialogueEntry.currentLocalizedDialogueText. I'm fairly certain it will be blank.

Inspect the Dialogue Manager GameObject, and click the Localization Settings > Clear PlayerPrefs Key button. This will reset PlayerPrefs back to the default language. Then check again, and also check the value of Localization.language.