[SOLVED] Dialogue Tree - Display branch only once

How do I make a dialog tree branch show only once? I made a dialogue tree which starts from branch1. I talk to an NPC, branch1 shows, then branch2 and so on, and after I am done talking I talk to that NPC one more time and I want to skip branch1 and go straight to branch2. How do I do this?

Hi I don’t know how to skip a branch, but I can tell what I do is to create a second dialogue so the second time I talk to the same NPC i load the second dialogue.
I use this in a shop NPC dialogue the first time my player talk he introduce himself to the NPC and the second time he just says “Hi do you want to buy something”

I control this with an Object variable in the NPC Sprite so the first time is like NPC variable = dialogue_1, for the next time NPC variable = 2.

So in the event check if NPC variable is 1 load dialogue1.json or NPC variable is 2 load dialogue2.json
Hope this helps.

1 Like

Hi, that method actually sounds helpful but how do I load a differend dialogue when I visit the NPC second time? Could you possibly show me how it looks?

Well I use Storage to save game data so the very first time the player talks to the NPC saves that Object var in Storage and set to 1.

Load the two dialogues so depending on the stored data if npc_dialogue_1 run dialogue1.json if 2,3,n

I’m pretty sure there is a better way to do this but hey it works for me so I didn’t touch it.

You can see a working sample here
The first time in the town you talk to any NPC they introduce and tells the player what kind of items they sell, the second time just “Buy something?”

Okay, thank you! I will try this method.

So yeah, I figured out something different but it works. I created and NPC variable and called it “NPC1start”. When I talk to an NPC first time the variable is set to “NPC1start”. I read all the dialogue tree, I accept the quest and then the NPC says “let me know when you are done” (the branch of that text is called “NPC41”). So the thing is, when I reach that branch, the NPC variable is set to “NPCquest”, so when I finish talking and talk again, the dialogue starts from branch “NPC41” and not from the beginning. Maybe it’s not the best way to do it but I will post it anyway, maybe it will be helpful for someone.

1 Like