So in theory I should be able to type up my dialogue in VS code with the yarn extension and then save it as a json file. And then when I’m in gdevelop and I choose a file to load, I choose my json file. Except when I do that it just loads a blank file.
Me choosing the file
with the first chunk being my first node. The formatting is all off and it looks like way more coding than I’m wanting to do. I like using the in-editor yarn extension, the underlying issue is that i can’t access any of my nodes once I submit them because I can’t scroll/pan the area when I try to reopen and edit it. So I thought I’d try typing it up with the yarn extension in vs code, save as json, and then import it into the engine but that doesnt work either. This was the back up choice, if I can figure out how to fix the scrolling issue I’d much rather continue to use the editor in-engine since that’s about as much code as I’m wanting to write lol
It’s a separate library used to adapt the Yarn dialogue format to Javascript, basically a port (and then separate project) from the original Yarnspinner.
That said, it looks like whatever add-in your using is exporting it into a format specific to VScode or that addin. (JSON is just a method of storing data, not a defined file format/structure) However, you can just import the direct yarn file.
Here’s how you can do that:
Open the dialogue editor in GDevelop. This will need to be the Create with yarn, you will not just be able to browse to your exported yarn file.
Click the File menu on the upper left.
Click Open
Browse for your Yarn file. Make sure it’s exported as pure Yarn syntax and not json. Even just copying/pasting from the VSCode window should be fine.
(here’s an example of what this yarn file looks like)
Select the Yarn file to import.
Click OK. The data in the file will be loaded and override whatever is currently in the editor.
You can now save the file and it’ll be stored in a json
Edit: That said, if you’re not able to scroll the yarn editor, and you’re on version .150, you might need to investigate more, i’ve now tested on tablet (old Win 8), my laptop (Win 11), and my desktop (win 10), all with different mice/inputs and I"m able to move around. If for some reason Alt+Click isn’t working for you, you should also just try Middle-mouse button (click in the mouse wheel) and drag instead.
Oooh, I thought json was a format/structure, thank you for clearing that up!
I followed these step sand that worked perfectly, thank you!
I’m in version 0.4.116 . I did some testing and it seems to be some kind of bug. It works when I create a yarn file, but once I click save and apply, if I try to go back in to edit, it no longer works. However, if i double click into a node, and then while in that node, go to the search and hover over the name of another node, the view port will snap to that node and that seems to jumpstart the functionality again? So if I exit out of the node i originally went into I can pan/scroll again. But I have to do that every time I go into edit a node. (Also the mousewheel doesn’t work either, that was one of the first things I tried. It doesnt work to click and drag , unless I do this hack, and it doesnt scroll in or out properly, it will only zoom out my lines attaching the nodes but not the nodes themselves, unless I do this hack lol.)
it’s kind of a silly bug but i’m glad I found a relatively simply (if annoying) work around for it. I’m also glad I can now just edit my yarn file in vs code if needed, so thank you again for that help!