Error when trying to implement Dialogue UI in 2D Unity 5 project

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
scratchyback
Posts: 8
Joined: Sun Apr 05, 2015 12:28 pm

Error when trying to implement Dialogue UI in 2D Unity 5 project

Post by scratchyback »

Hello,



I have just recently purchased your asset and I am now trying to wrap my head around it's workings. I am working on a 2D project and I managed to get the dialogue working (I didnt import -all- the files in the package to not clutter my project with examples I will not use. I only imported the dll's, the scripts and the ui prefabs I used).



However I now want to implement the new UI system instead of the legacy GUI. For this I tried to follow this manual: http://www.pixelcrushers.com/dialogue_s ... e_u_i.html



Before I start making my own design for the UI I thought to first get the example working.



I unpacked the files of the 'UI Support' package

In my dialoguemanager in the scene, under Dialogue UI, I replaced AssetsDialogue SystemPrefabsUnity Dialogue UIsDefaultDefault Unity GUI Quest Log Window.prefab with this prefab AssetsDialogue SystemScriptsSupplementalUIPrefabsDialogue UISF Unity UI Dialogue UI

I then ticked 'Disable internal sequencer' in the dialogue manager.

In the Player 'Selector' script, I removed the entry 'GUI skin'.



Now however when I run my scene I get the warnings:

Can't find any built-in sequencer command named None() or a sequencer command component named SequencerCommandNone() followed by



Dialogue System: Sequencer: Camera angle 'Closeup' wasn't found.



I do not see the dialogue lines anymore. What am I doing wrong?



Really hope you can help me. Thanks in advance!







---



Edit: I realise now that the warning about the sequencer camera is unrelated to whatever makes the dialogue not show for me because I get the mentioned errors as well when I go back to the original legacy GUI.














User avatar
Tony Li
Posts: 21033
Joined: Thu Jul 18, 2013 1:27 pm

Error when trying to implement Dialogue UI in 2D Unity 5 project

Post by Tony Li »

Hi,



First, untick Disable internal sequencer commands. Only in rare cases should this ever be ticked, and in those cases you must provide your own implementations of sequencer commands such as None(), Delay(), and Camera(). In the next version of the Dialogue System, this checkbox will be hidden in the inspector and only available to scripts.







The Dialogue System has several different UIs:



Dialogue UI: Conversations, QTEs, and gameplay alerts.

Bark UI: Barks (usually above NPCs' heads).

Quest Log Window: Window for viewing active and completed quests.

Quest Tracker HUD: Gameplay HUD showing current state of active quests.

Selector: Shows player's current selection target.



The UIs work independently, so you can mix and match GUI systems. For example, you can use legacy Unity GUI for the Selector and the new Unity UI for the Quest Log Window. I only mention this to let you know that you can convert them from Unity GUI to Unity UI gradually. You don't need to convert them in one big effort.







Any UI that uses the new Unity UI has three requirements:



It must be located under a Canvas.

The scene must have an EventSystem.

For quest log windows and dialogue UIs, it must be a scene instance, not a reference to a prefab.



The first two requirements apply to anything that uses Unity UI, not just the Dialogue System. The third requirement is because otherwise the Dialogue System wouldn't know which canvas to child the prefab instance to if your scene has multiple canvases.







For the Dialogue UI:



Add a Canvas to the scene, and make it a child of the Dialogue Manager.

Make sure the scene has an EventSystem.

Add an instance of SF Unity UI Dialogue UI as a child of the Canvas (i.e., just drag it from the Project view onto the Canvas in the Hierarchy view).

Assign this instance to the Dialogue Manager's Display Settings > Dialogue UI field.







For the Quest Log Window:



Delete the old Unity GUI Quest Log Window GameObject.

Add a Canvas to the scene, and make it a child of the Dialogue Manager. You can use the same canvas as the one above if you want.

Add an instance of SF Unity UI Quest Log Window to the Canvas.

Assign it to the Feature Demo script's Quest Log Window field.







For the Selector, you can switch to Unity UI by adding a Unity UI Selector Display to the player.







For examples of all of these, see the example scene in Scripts/Supplemental/UI/Example.


scratchyback
Posts: 8
Joined: Sun Apr 05, 2015 12:28 pm

Error when trying to implement Dialogue UI in 2D Unity 5 project

Post by scratchyback »

This helped a lot. I got the UI to work now and I am closer to the desired 'wrapping my head around it'. Thanks!
User avatar
Tony Li
Posts: 21033
Joined: Thu Jul 18, 2013 1:27 pm

Error when trying to implement Dialogue UI in 2D Unity 5 project

Post by Tony Li »

Happy to help! I'm working on a video tutorial for Unity UI, but you'll probably have mastered it all by the time the video's done.
Post Reply