InfiniteAmmoInc / Yarn

932 stars 92 forks source link

electron: Add option to disable auto-creation of nodes #90

Open rdominick opened 5 years ago

rdominick commented 5 years ago

My yarn interpreter has support for function calls instead of node names when making a choice -- i.e., [[Fight!|!e_go]]. Every time I edit a node with this feature in it, a node is created for the function and any choice that calls this function is linked to it, and it kind of makes this version of Yarn unusable for me. It'd be nice to be able to turn it off like the other auto-complete options.

blurymind commented 5 years ago

Are you using yarn spinner or bondage.js? Your function call syntax is very odd. We use <<call>> for calls usually.

I am planning to add support for yarn to write a config file where the exectuable is. Then with that config file be able to disable things like automatic node creation for corner cases like yours - all corner cases will be relegated to a config file, so as to avoid cluttering the ui too much. But that is not high on priorities at the moment, you are probably the only person in the universe who uses node connection syntax to call functions.

Alternatively I can add a rule to yarn to not auto-create a new node if in its name has a <<call>> pattern, but that would also mean that you have to change your interpreter and all the strange calls to be [[Fight!|<<!e_go>>]] Will you be ok with that?

In any case, you can submit a pull request if you want to add the option to disable it :)

I can look into this once I finish I few pulls on gdevelop

rdominick commented 5 years ago

I'm using a Yarn interpreter that I implemented in Godot. It has the ability to load multiple yarn files at once and call nodes in any of them. I have an 'os' yarn that holds base functionality -- but even if I created an "os_e_go" node there, the editor would create an empty node in any yarn that called it.

I'd be more than willing to use the call syntax -- it's clearer, in any case, and I can just use a temporary interpreter node to run it.

One of the great points of yarn, from a toolkit standpoint, is that it leaves the disposition of output and choices to the calling program. An assumption that the target of a link has to be a node is a bit limiting.

In any case, thanks for looking at this.

rdominick commented 5 years ago

Oh, yeah, and trust me -- as a total Javascript newbie, you wouldn't want any pull requests from me!

blurymind commented 5 years ago

Can you link us to your interpreter, I plan to add links to other interpreters for yarn files in different game engines. We need to stop giving unity complete monopoly over this :)

Please when you write and share plugins to interpret yarn files, follow the syntax rules. I quickly learned that we need to follow them, especially to be compatible with bondage.js and yarnspinner. The more consistent we are across the board, the better for the file standard

rdominick commented 5 years ago

Oh, dangit, I came here to post about how it's not ready for use and it's not going to support dialog shortcuts anyhow, and then I thought of a nifty dumb way to get them to work and grr. If I can get that to work and I can get some sort of error messaging going and tighten down the type checking for operators to a sane level, I'll open up the repository.

blurymind commented 5 years ago

sweet =) The more engines we get to work with yarn the better. In any case, I will try to update the main page a bit to invite for other devs to submit to us their interpreters. It would be good to get Yarn to work on other game engines. Unity should be just one of many options - it will help us spread its adoption

blurymind commented 5 years ago

@rdominick I added this now via: https://github.com/InfiniteAmmoInc/Yarn/commit/35b1663042bb3b7349274849d5ab00d3386a1d66

Download and build the latest from the electron branch, then extract this to your windows home folder: C:\Users\YOU .yarn-story-editor.ini.zip and set it to false

rdominick commented 5 years ago

This works well, too. I've even added another option in my local copy: to turn off the preview mode altogether. I just want to see the code I've written as it is.

Thanks for this.

blurymind commented 5 years ago

Please do a pull request and will see to merge it :)

blurymind commented 5 years ago

ok scrap that for now, I am going to replace the ini file with a json one - to make it easier to maintain

rdominick commented 5 years ago

I'll hold off until I see that as a commit, then.

blurymind commented 5 years ago

@rdominick give it a try now :) The json file should be automatically be created after starting and closing yarn for the first time. In it you will find the same variable which can be used to disable automatic node creation