Prefab-like behaviour for collection of nodes?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ModestFacialHair
Posts: 13
Joined: Thu Sep 19, 2024 1:17 pm

Prefab-like behaviour for collection of nodes?

Post by ModestFacialHair »

I've got a skill system working in my prototype - thanks Tony for the very helpful tutorial on this.

A basic skill check looks like it will generally need at least four nodes (response choice with roll, spacer node to leave a gap for evaluation, success and failure) with suitable Lua function calls. This is fine but will be a bit of error-prone effort to set up manually each time - and to change if I need to change the approach.

Is there any prefab-like behaviour in the DS that I can use to manage similar blocks of similar nodes? Or any common approach people usually take to automate this?

thanking you
ModestFacialHair
Posts: 13
Joined: Thu Sep 19, 2024 1:17 pm

Re: Prefab-like behaviour for collection of nodes?

Post by ModestFacialHair »

Okay, I've just found Templates! but I don't think I can add a set of templated nodes to an existing conversation? just use it to create a brand new conversation with pre-specified nodes?
User avatar
Tony Li
Posts: 23254
Joined: Thu Jul 18, 2013 1:27 pm

Re: Prefab-like behaviour for collection of nodes?

Post by Tony Li »

Hi,

To apply the template to a specific dialogue entry (e.g., if you've added fields to the template after writing a conversation), expand the dialogue entry's All Fields foldout and click Template.

To apply the template to everything in the database, on the Templates tab select Menu > Apply Template To Assets.
ModestFacialHair
Posts: 13
Joined: Thu Sep 19, 2024 1:17 pm

Re: Prefab-like behaviour for collection of nodes?

Post by ModestFacialHair »

Thanks Tony - that'll be useful.

But is there anything for adding the same template (or template-like structure) multiple times to an existing conversation?

I mean: if I have an existing conversation and I want to add a skill check on several different branches, then that's several different times I need to add a set of four nodes and then update some of the details.

I can just copy-paste things between conversations of course. But in an ideal world, it would be nice to drag a prefab of multiple nodes into the conversation, or have an 'add node template' that I can put in several different places in the same conversation.

It sounds like there isn't anything like that - is there any approach you'd suggest or anything similar people have done?
User avatar
Tony Li
Posts: 23254
Joined: Thu Jul 18, 2013 1:27 pm

Re: Prefab-like behaviour for collection of nodes?

Post by Tony Li »

Hi,

There's something close that might work: You can save a conversation as a template and then create a new conversation from it. (See Conversation Templates video)

I'll try to get an addition into the next update to add an instance of a conversation template as a child of a specified dialogue entry node, rather than as an entirely new conversation.
ModestFacialHair
Posts: 13
Joined: Thu Sep 19, 2024 1:17 pm

Re: Prefab-like behaviour for collection of nodes?

Post by ModestFacialHair »

Much appreciated, thank you!
Post Reply