[Solved] Yarn - A single interaction breaking?

Hello! I’m having another issue with yarn, not too surprising at this point.

I’ve been peacefully working on my game assignment, and I’m nearly finished with my Monster Girl visual novel demo. I’ve been putting in the script for the last character, and I’ve run into an odd problem. I went to go test out my finished dialogue path, to make sure the text fits in the boxes and all, right?

Well, all of a sudden, my interactions break when I try to select the path that I finished. I went back and tested pretty much all of the other interactions, including her unfinished path and all the paths for the other girls. They all operated just fine. But when I select the second interaction in the first option path given, it breaks? It doesn’t do anything, then when you hit the Z key again, the options dialogue completely disappears and you can’t proceed.

Screenshots of my events and Gemini’s yarn dialogue below!


[Events Cont]

[Gemini’s Dialogue]

[Issue Here?]

The Experience choice is the one that keeps breaking.
Any insight would be appreciated!

Hi! Nice to see a Yarn user.
Can I ask what “selection” does? It seems to be only accessible with the mouse, is the only event for Gemini, so I assume it’s a “select who you want to talk to”, but just making sure.
If not that, it might be in the Experience dialogue branch itself, which has 2 options but the dialogue in that branch not fully shown in here. Maybe you didn’t properly link it in that?

Thanks for replying!
Yes, the selection variable is for a beginning event to choose which character you want to chat with. It was the only way I could make a selection without it breaking my Yarn, too.

This is the contents of the Experience dialogue branch:

It’s formatted the same as I’ve formatted the other girls’ dialogue past the first choice. I can’t tell why it’s messing up now, as I’ve tested the other girls’ dialogues while they were in similar states of completion and they didn’t break.

I have very little idea on what’s wrong there. Will try making a branch-that-leads-to-another-branch around tomorrow in my RPG and see what I can get (it’s 12AM here, so that’ll be around 12-ish hours to make that).

The only suggestions I can give is:
removing the apostrophe in “We’re boring” choice,
changing the square brackets in the beginning of Experience,
re-typing/copypasting the content (though I’d recommend retyping a shorter version with one text line and the two choices, for testing - a particular invisible character or something may be crashing it) the three relevant branches into test branches called Experience2, Boring2, etc (for testing, if it’s really something wrong when the branches was being created.
Also try seeing what happens when you start the scene directly from Experience instead!
Maybe try adding a “Dialogue is running” condition to “The dialogue line is = “options””?
And… since you didn’t expand the conditions for the other two characters, I’m thinking some of the code is occuring two times, more than it should. Although that’s 99.99% not the problem, just mentioning.

That’s a lot. But another thing that would be great is, bring up the Chrome Inspector using Ctrl+Shift+I, go to Console, and see what exactly the crash message is (it’s sometimes helpful, other than the bunch of crash-line errors in bondage.js - something more useful to the devs). Post it here too!

Thanks for reading/trying all that, and good luck!

Here’s a “branch within a branch” (what do I call it…?) I made just now. The choices and the branches they linked to were typed out in there, and it didn’t crash. Most likely with your JSON file at that point, or an event that’s particular to that .
Here’s an overview of my dialogue tree file (excuse the placeholder writing):

It starts from NPC0, then goes to either Yeah, Nah, or NPCNameStart. Nah branches into three branches.

Here’s NPC0


To add to my previous post above, when exactly does the dialogue line crash, when entering, during the dialogue, or when choices are presented? Thanks.

I’ll be trying some of the tips you gave me here in a second, but figured I would clarify what exactly is happening with the weird break.

The game itself starts up just fine, and Gemini’s selection doesn’t have any errors. Her dialogue goes through fine, up until her prompting line of “what brings you to a monster school?” then it should bring up the options dialogue. If I select the “Money Problems” option, it goes into her unfinished branch for that option without issue. But if I select “The Experience”, it doesn’t do anything. It allows me to move my option selection again, but if I select either option again after I select The Experience once, the options dialogue randomly disappears and doesn’t let me continue. I’ll have to restart the game to make it continue dialogue again with anything else.

I’ll be trying some of the fixes you listed now, and I’ll reply again if any of them work!

Uh oh, something I did while testing these options has gemini’s dialogue not working at ALL anymore.

Taking out the ’ in we’re didn’t work, i’ve tried changing brackets to no avail, i’ve retyped and even removed the nodes and re-added them. I also tried adding the condition and it didn’t seem to do anything.

Here’s all 3 girls’ code, btw. It’s all the same minus the variable and the art asset it shows.

I’m also using the program, not the chrome version. So the chrome inspector wont assist me there, sadly.

I also checked the other girls’ dialogues, and they still function perfectly fine. Something I did absolutely broke gemini’s. I’m considering just copying all her dialogue into a notepad file and completely remaking her .json to see if that’s the issue? Because I feel like that’s the only option at this point, with her entire dialogue breaking when I made attempts to fix the one path.

Thanks for the feedback, though! It was all really good suggestions I hadn’t thought of trying yet!

With all I know so far, copying the dialogue into notepad and into another node seems a plausible option. No idea what could cause the dialogue file to fail entirely other than a really messed up JSON file - but you’d want to do the copy-paste thing into a new one first, then if the new one works and the old one doesn’t, you might want blurymind to look into it through their email. (not pinging them yet)

in the meantime, no, really, just hit Ctrl+Shift+I in preview window when you launch the game, and chrome inspector will appear - it’ll look like this.
There’s nothing much in the screenshot because it hasn’t crashed yet, so Yarn doesn’t tell us anything.

Especially look and tell the Console tab - that’s the informative part in this case!

I tried opening the console first thing, and it didn’t really do much of anything. The game doesn’t necessarily crash when the error happens - it just… Stops, and wont do anything else until I manually close it.
This is what it looked like when I tried to run her dialogue, and it wouldn’t go past the initial starting key.

The other girls operate just fine, so I know it’s not an issue with my text feature events - just gemini gets awkward when I try to run it.

I went ahead and made a new Json file and copied her current scripting into it and she worked without an issue. Something must be wrong with her original Json file, then. I question how it could’ve gotten corrupted or anything, but that’s out of my hands at this point. Yarn is still in beta for GDev, so it’s probably just another bug they need to work out.

Thanks for all the amazing suggestions, though. I’ll keep them all in mind if I run into a similar roadblock in the future!

1 Like

You’re very welcome!

But, for the screenshot, you’re opening the Chrome Inspector in the editor itself, not the running preview window. Here’s a reference on what I mean:

Still, it’s great that you managed to fix your issue - opening the inspector in the Preview window is just for the next time the game stops responding again.

1 Like

Aaah, that definitely makes more sense. I’ll keep that in mind for the future!

Great that you got it working!
If you still have the corrupted json, it could be useful for the devs. Could you post it on pastebin or anything?

And thanks to @reina for the troubleshooting :+1:


It looks like the parser is choking on a character. Can you please send me the corrupt json file. I might be able to add a sanitizer that cleans up characters that trip the parser

Just a quick note on tripping the bondagejs parser - please avoid copying blocks of text from the web and pasting it into yarn. If your clipboard picks up a weird character, it might crash the parser. Fortunately gdevelop’s interpreter does everything possible to avoid that and in recent versions I have added some fixes to it to make it stronger.

If that happens,please always share the corrupt data with the developers (us), so we can replicate the bug and fix it.

Also when you add options, avoid putting several on the same line. If the game freezes upon selecting a choice, there is something wrong with the choice in yarn.

dont do:
[[hey|goHey]] [[may|goMey]]

dont insert spaces on the right side like this
[[I have spaces but its ok|I have spaces bad bad]]
do this
[[I have spaces but its ok|noSpacesHere]]

If a choice leads to a node that doesn’t exist for example- thats another thing that might trip it into a frozen state. I think I fixed those things, but saying in case someone else stumbles on this

Any javascript monkeys interested in fixing corner cases, please go to bondagejs’s git tracker and have a go :slight_smile: I would patch them up myself if I had more time


That’s really god advice! Thank you, I’ll keep all this bookmarked for my next projects.

Also, I went ahead and put the .json file in my drive - it’s right here if you still need it.
Thank you for all the advice and checking up on my error! :blush:


I think Its your choices line, as I guessed:

[[Answer:test node|test node]]

Do you get the crash when selecting test node in your game?

Please avoid naming nodes with spaces in them (the name on the right of the | )

I think I wrote about that in the documentation. I think I added a validator to yarn’s node title field that warns you when inserting spaces there

1 Like

Can you post a link to the bondagejs repo?
Perhaps there needs to be a gui builder added that is always valid…

( is this the right link? GitHub - hylyh/bondage.js: Javascript-based parser for the Yarn dialogue tree markup language )

1 Like

yes it is the right repo. I have already made a few commits to it in the past so understand some of the code :slight_smile:
It has some tests and even an online parser.
The issue with spaces in node titles could already be filed at its repo

Last commit to master : Latest commit283cf37on Jun 5, 2019

Do you have any confidence that changes and updates can get merged in a timely fashion as well as getting imported into GDevelop?

I believe the version of bondagejs included in gdevelop is already the latest. I havent worked on it for a while now, but might get back to it at some point. My recent fixes are to the wrapper I wrote for it in gdevelop.

If you understand jison it would be great to have more people on bondagejs fixing the small nibbling corner case issues with parsing