Link to a START entry with RandomizeNextEntry

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
ds2497
Posts: 55
Joined: Wed Jun 14, 2023 2:13 am

Link to a START entry with RandomizeNextEntry

Post by ds2497 »

Hello, Tony!

I’d like the NPC to say a random goodbye line at the end of a conversation. To achieve this, I created a conversation called "Goodbye," where the START dialogue entry connects to N different goodbye entries. I’ve used RandomizeNextEntry() in the Sequence of the START dialogue entry of this Goodbye conversation, and I have the last dialogue entry of each of the A, B, and C conversations linked to the START entry of the Goodbye conversation.

However, during testing, this setup consistently displays only the first goodbye line instead of randomizing. I’ve tried adding an intermediary dialogue entry and experimenting with Continue() and other commands, but these approaches haven’t worked. Currently, the only workaround I see is to add N links from the last entry in each initial conversation to each goodbye entry, but this approach is quite time-consuming. Could you kindly advise on a more efficient way to set up the Conversation for this purpose? Thanks!
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Link to a START entry with RandomizeNextEntry

Post by Tony Li »

Hi,

The <START> node doesn't run sequences. (Hence the yellow warning and the requirement to click an Accept button before you can edit it.) However, it does run Script fields. You can move RandomizeNextEntry() to the <START> node's Script field. Or you can make a group node between <START> and the random nodes, and make your cross-conversation link to that group node.

You may also want this patch:

DS_ModelPatch_2024-10-24.unitypackage

It fixes an issue where a group node with RandomizeNextEntry() in the Script field links to exactly two nodes. This fix will also be in 2.2.50.
User avatar
ds2497
Posts: 55
Joined: Wed Jun 14, 2023 2:13 am

Re: Link to a START entry with RandomizeNextEntry

Post by ds2497 »

Hi, I've tried placing RandomizeNextEntry() in the script section of the <START> node, but it’s not working—it still only displays the first dialogue entry. Additionally, could you explain a bit more about group nodes?
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Link to a START entry with RandomizeNextEntry

Post by Tony Li »

Here's an example scene:

DS_TestLinkToRandom_2024-10-25.unitypackage

Here's info about group nodes: Group Nodes

(The Dialogue System uses the same data format as Chat Mapper, so I linked to the Chat Mapper manual.)
User avatar
ds2497
Posts: 55
Joined: Wed Jun 14, 2023 2:13 am

Re: Link to a START entry with RandomizeNextEntry

Post by ds2497 »

After carefully reviewing the example, I discovered that I had "Stop Evaluation At First Valid" checked, which was causing things to not work as expected.

Thank you very much for the help!
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Link to a START entry with RandomizeNextEntry

Post by Tony Li »

Glad to help!
Post Reply