Adding nodes at runtime

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
Kole90
Posts: 43
Joined: Wed Nov 08, 2017 4:51 am

Adding nodes at runtime

Post by Kole90 »

Hello. I was wondering what is the easiest way to add a nodes to a conversation at runtime? Just to clarify my attentions I want to build a "focus point" system just like in the game "Subsurface Circular", so when I choose one node answer I get the focus point, if I click on it a new node appears in my conversation with NPC. Hope you understood what I'm trying to accomplish, thanks for your help.
User avatar
Tony Li
Posts: 22655
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adding nodes at runtime

Post by Tony Li »

Hi,

Subsurface Circular just runs regular branching conversations, which is exactly what the Dialogue System is designed for. (It's made in Unity. For all I know, it uses the Dialogue System. Many conversation-heavy games do.)

The important part is to make the UI look the way you want. The Dialogue System is UI independent, and it gives you a lot of flexibility in designing your UI, at the cost of a little more complexity. You can find some good starting points on the Dialogue System Extras page under the UIs section. Under the Conversation Log Dialogue UI button, there's a link to a Texting Log UI which works kind of similarly. There's also the game template called Textline in the Frameworks, Demos, and Example Scenes section. While Textline is for a fairly specific type of game, some of the techniques used in it are similar to Subsurface Circular's dialogue UI style.

If you want to focus the camera, you'll use sequencer commands such as Camera() -- or CinemachinePriority() if you want use Unity's new Cinemachine feature.

To determine which nodes to show, you'll use variables and conditions.
User avatar
Kole90
Posts: 43
Joined: Wed Nov 08, 2017 4:51 am

Re: Adding nodes at runtime

Post by Kole90 »

Thanks for the response Tony! If I have some more questions should I keep posting them in here or should I make a new one for every future question?

So the way I did the "focus points" is that I added a variable called FocusPoint and made it Boolean = false at the start and added one node that is only available if that bool is true, after you chose a specific answer in your dialogue with the NPC that bool becomes true and I update responses so that the node I wanted becomes active.

Code: Select all

public void StartSeconddFocusPontConv(){
	DialogueLua.SetVariable ("FocusPoint", true);
	DialogueManager.UpdateResponses ();
}
User avatar
Tony Li
Posts: 22655
Joined: Thu Jul 18, 2013 1:27 pm

Re: Adding nodes at runtime

Post by Tony Li »

Kole90 wrote: Thu Nov 09, 2017 2:06 am Thanks for the response Tony! If I have some more questions should I keep posting them in here or should I make a new one for every future question?
Whatever's most convenient for you. But it may be better to make new posts in case you want to search through old answers some time in the future. It'll make it easier to find what you're looking for without having to scroll through unrelated material.
Kole90 wrote: Thu Nov 09, 2017 2:06 amSo the way I did the "focus points" is that I added a variable called FocusPoint and made it Boolean = false at the start and added one node that is only available if that bool is true, after you chose a specific answer in your dialogue with the NPC that bool becomes true and I update responses so that the node I wanted becomes active.

Code: Select all

public void StartSeconddFocusPontConv(){
	DialogueLua.SetVariable ("FocusPoint", true);
	DialogueManager.UpdateResponses ();
}
That's a good solution. Sorry, I went off on a tangent in my previous reply and totally forgot to address focus points. :-)
Post Reply