Very basic primer on creating your own UI

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
rey
Posts: 14
Joined: Wed Feb 21, 2024 7:14 am

Very basic primer on creating your own UI

Post by rey »

Hi, I am exploring the DS plugin for Unity and so far very impressed with the wide range of options.

However, it is likely due to these extensive options that I struggle to get started with DS. As an intermediate scripter I am looking for a way to use DS purely as a way to create, manage and localize dialogues. I do not want to use any of the UI features.

Which brings me to my question: I am really struggling to get started just writing even the most basic script that will start a dialogue, fetch the next node of the dialogue tree, and present it in the debugger, so I am looking at a beginners primer for just getting the data out of the DialogueManager/conversationManager, or whatever it is we need to address to get the information from a node in a dialogue.

I can only assume I am missing some big part of the documentation somewhere, I've been looking in the wrong place, or perhaps this part of the documentation is just really subpar. I've worked with both INK's unity plugin and VIDE dialogue manager before without any issues. Both are very straightforward in how to create basic calls to the manager, get options, move to the next stage of a conversation etc.

None of the demo examples helped in this regard - all of them appear to focus more on managing the pre-made UI's more so than just providing a VERY SIMPLE PRIMER to expand on and are very hard to read, a lot of it obfuscated by the various UI handlers and many scripts and functions managing all the extra functionality.

I've read the documentation on:
https://www.pixelcrushers.com/dialogue_ ... ptMessages and it appears to be missing basic functions (or obscures them) for calling the next node of a dialogue tree.

chatGPT is no help either at the moment, as it insists on getting updates via subscribing to the DialogueSystem.OnDialogueLine which appears to be unavailable?

Can anyone point me in the right direction or perhaps even provide a VERY SIMPLE sample script of starting a conversation, getting the next node(s), and moving the conversation to the next stage of the conversation without using any of the DS UI features (just Debug.Logs).

Thanks in advance,
Rey
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Very basic primer on creating your own UI

Post by Tony Li »

Hi Rey,

If you don't want to use the Dialogue System's dialogue UI stuff, use these steps instead:

1. Duplicate the file Plugins / Pixel Crushers / Dialogue System / Templates / Scripts / TemplateDialogueUI,cs. Rename your copy and move it into your own scripts folder.

2. Edit the script and add your code where the comments indicate.

3. Add the script to your own dialogue UI. Then assign that dialogue UI to the Dialogue Manager GameObject's Display Settings > Dialogue UI.
rey
Posts: 14
Joined: Wed Feb 21, 2024 7:14 am

Re: Very basic primer on creating your own UI

Post by rey »

Hey Tony,

Thank you for the quick response.

This isn't quite what I am looking for.

What I want is the entry level documentation on how to navigate the Dialogue nodes. The template only abstracts this further as far as I can tell.

I just want to recall the raw data of the Dialogue. The current state, the next states, the localized text, the conditions. Just the data. I'll build my own UI and logic on top of that later, for now I just want to know where I can find such basic information of 'moving the conversation to a next node'.

Like how would I find the next node of a conversation to pass to the DialogueManager.conversationController.GotoState()? This is all really confusing at the moment, and the documentation is not much help here unfortunately. If you could point me in the right direction that'd help a lot.

Also, even though I deleted all the UI assets from the DialogueManager, it keeps pushing out a UI element into the scene, where do I disable this?
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Very basic primer on creating your own UI

Post by Tony Li »

Hi,

In that case please see: How To: Manually Process Conversation UIs. (Use #2.)

To get rid of the instantiated UI, inspect your Dialogue Manager GameObject/prefab variant, and remove or disable the Instantiate Prefabs component, or clear its Prefabs list.
rey
Posts: 14
Joined: Wed Feb 21, 2024 7:14 am

Re: Very basic primer on creating your own UI

Post by rey »

Awesome, this was exactly what I was looking for.

Thank you!
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Very basic primer on creating your own UI

Post by Tony Li »

Glad to help!
rey
Posts: 14
Joined: Wed Feb 21, 2024 7:14 am

Re: Very basic primer on creating your own UI

Post by rey »

Unfortunately, even with the Instantiate Prefabs disabled or removed, it keeps pushing a UI element into the scene.

It appears some editor only UI overlay?

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

Re: Very basic primer on creating your own UI

Post by Tony Li »

That's the fallback UI if you run the full conversation process without providing a dialogue UI -- that is, allowing the Dialogue System to handle the Model, View (i.e., dialogue UI), and Controller of its MVC architecture.

If I understand you correctly, you don't want to run the full conversation process. Instead, you just want to create a Model and manually advance it and pull text from it. In this case, don't start a conversation (e.g., don't use a Dialogue System Trigger -> Actions > Start Conversation).

If you do want to run the full MVC conversation process but you want to handle the UI part entirely on your own, then please refer to my first reply in this thread.
rey
Posts: 14
Joined: Wed Feb 21, 2024 7:14 am

Re: Very basic primer on creating your own UI

Post by rey »

Excellent, that was it.

Thanks again.
Post Reply