Yarn 2 <<jump>> doesn't set "visited" on last node

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
MaxJ
Posts: 2
Joined: Sun Sep 03, 2023 4:51 am

Yarn 2 <<jump>> doesn't set "visited" on last node

Post by MaxJ »

Hi!

I am using Yarn 2 together with the dialogue system, and I'm trying to create a workflow for adding dialogue to our RPG.
Am trying to structure each character's start node to basically handle the branching depending on where in the story one is at the time of starting the conversation, like so.. :

Code: Select all

title: Test1_NodeStart
tags: starting_point, dev, test
position: 51,-247
---
<<if not visited("Test1_Node1")>>
    <<jump Test1_Node1>>
<<elseif not visited("Test1_Node2")>>
    <<jump Test1_Node2>>
<<endif>>
===
title: Test1_Node1
tags: dev, test
position: -75,-95
---
NPC: What's this?
PC: This is some test dialogue!
NPC: Seems really cool!
NPC: And I can say stuff twice in a row!
PC: Just because you can, doesn't mean you should..
NPC: Rude!
===
title: Test1_Node2
tags: dev, test
position: 225,-104
---
NPC: So what's with this place anyway?
PC: This is a sandbox
....
The problem I am however facing, is that the dialogue system marks the initial node as visited, rather than the one I jumped to, meaning that we're stuck reading Test1_Node1 here (because it sets "Test1_NodeStart" to visited, not Test1_Node1).

Looked into overriding the OnConversationEnd() method but the default visited node uses the LastConversationStarted,

Code: Select all

var conversationName = DialogueManager.instance.LastConversationStarted;
but neither this nor LastConversationEnded relates to the node I jumped to.

Am still in the testing phase, and am looking into how to structure the project, (and maybe I'm thinking about this all wrong), but would ideally like to control which dialogue to run from within the yarn file if possible.

Thanks for an awesome tool.

/MaxJ
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Yarn 2 <<jump>> doesn't set "visited" on last node

Post by Tony Li »

Hi,

Good catch. Please try this patch:

DS_YarnPatch_2023-09-03.unitypackage

It now records/increments the visit count in OnConversationStart and OnLinkedConversationStart.
MaxJ
Posts: 2
Joined: Sun Sep 03, 2023 4:51 am

Re: Yarn 2 <<jump>> doesn't set "visited" on last node

Post by MaxJ »

Thanks for the quick reply and fix, this works!

/MaxJ
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: Yarn 2 <<jump>> doesn't set "visited" on last node

Post by Tony Li »

Glad to help!
Post Reply