-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yarn file spec: add file header object for storing file metadata, which encompasses all nodes #183
Comments
of course the header data can be top level and all yarn nodes can be somehow nested under nodes or something, but a change such as this would require changing the parsers- ideally with keeping backwards compatibility |
Given that we removed JSON support from the language in Yarn Spinner v1.0, should this project file be in JSON?
|
Bondagejs uses json files and so does gdevelop and ctjs because of that. We
need to keep it for those and other html5 engines
…On Mon, May 18, 2020, 11:19 PM Jon Manning ***@***.***> wrote:
Given that we removed JSON support from the language in Yarn Spinner v1.0,
should this project file be in JSON?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://github.com/YarnSpinnerTool/YarnEditor/issues/183#issuecomment-630465791>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRRWVNYJ5UWRF2Z4NXRDWLRSGYAVANCNFSM4NEL5PGA>
.
|
Regarding the JSON file: adding the header as a node with different structure is dangerous. Loaders that are not prepared will try to read it as a normal node and they will explode trying to access members that don't exist. We could use a meta-node, identified by the "title" and put all metadata inside the body. That way loaders that don't know about the metadata will load an additional "messy" unconnected (and unreachable) node, but won't explode loading the file. On the editor we can recognize the meta-node, read and hide it. Regarding the YARN file: safely modifying this format is a challenge. If this file already supports comments we could put all the meta as comments or put the meta inside the body. Long term proposal:
YARN
JSON
|
Json is the parsing standard for html5/javascript game engines. Why did you decide to drop it :) That could be a problem for swapping out bondagejs for yarnSpinner on gdevelop if yarnspinner can one day run in a js app |
We’re approaching a point where we need to have a conversation about the structure of the Yarn project structure, and how this editor relates to the other Yarn Spinner project structures. @blurymind and @daviddq, we should probably have a chat to make sure that we don’t accidentally misalign the projects soon - what’s the best place to talk, Twitter, Slack, etc? |
Slack, Discord, Hangouts, IRC, ... 🤷 |
Probably the best way would be for you both to join the Yarn Spinner slack? (It’s currently 1AM for me so right now‘s not the best time, but it’s a great place to start the conversation from!) https://lab.to/narrativegamedev |
I'm in the UK and can join after work (18:00 uk time) |
Additionally to the solution proposals I provided before, we can have additional files that hold the meta data (user/workspace/project related metadata) |
A simple text file format that encodes key-value pairs, and doesn’t introduce any package dependencies (either in Yarn Editor, bondage, or Yarn Spinner) would be ideal. Something easy to parse like ini files, maybe. I’d suggest that this be opened as an issue in the Yarn Spinner repo, as a proposal to enhance the format. |
I added a v2 yarn JSON file type, which looks as follows: old type (note how the root is an array - huge problem for expand ability):
new type (root is an object - suddenly a much more flexible file):
type is detected by the root being an array (OLD) or an object (NEW) I am not sure how to do this for ordinary yarn text file, since that has no nesting like json and xml do - the stucture we save in it will have to be flat, but if we can agree on one - I would be eager to implement it. |
@desplesda @hylyh @daviddq This has been bothering me for a while, but I was wondering if we can add an extra object to yarn files where we can give the file a bit more information about its identity and capabilities:
tagStyle: "html" | "bbcode"
(used to automatically detect the tag style of the document)textColourPalette: Array<hexString>
(used to store the colour picker's accumulated coloursin the palette) - it will allow us to keep its palette history in the fileuserVariables: Array<string>
(used to store all variables that are used in the file, we can use it for autocompletion and better debugging when playtesting)userCommands
- same as userVariables but for commandsRight now a yarn json file looks like this:
a Yarn text file:
My proposal is to add a header to the file, maybe something like this:
a Yarn text file (not sure where to put the metadata yet):
The text was updated successfully, but these errors were encountered: