JSON serves as the middle ground between header files and module files. It has just as much control as a module file, while being easier to read
{ "settings": { //... }, "types": { //... }, "structs": { //... }, "start": { //... } "nodes": { //... } }
The settings area contains settings about the language that can be changed, such as separator, and the main documentation link
"settings": { "doc-link": "https://link-to-documentation-root", "separator": ";\n", ... }
See the module file docs for more info on the settings
These are the building-block types, stuff like int, and bool
"types": { "bool": { "letter": "b", "icon": "circle-thin", "connect-icon": "circle", "colour": "#FF0000", "format": "%", "tag": "checkbox" }, "float": { "letter": "f", "icon": "circle-thin", "connect-icon": "circle", "colour": "#00FF00", "format": "%f", "tag": "number" }, ... }
Name of the type
The id that the editor uses to build nodes, it can be anything but I'd recommend using a letter
The Font Awesome 4 Icon to use on unconnected nubs
The Font Awesome 4 Icon to use on connected nubs
Colour that represents that type, it will influence the icon, gradients, and lines connecting nubs
The format for the input value, where % will be replaced. To make a string type you would put in "%"
Type attribute for the input tag to make values
"structs": { "Vector": { "colour": "#0000FF", "static": false, "properties": { "x": { "type": "float", "permissions": "rw", "link": "placeholder" }, "y": { "type": "float", "permissions": "rw", "link": "placeholder" }, "z": { "type": "float", "permissions": "rw", "link": "placeholder" } }, "methods": { "GetLength": { "io": { "inputs": {}, "outputs": { "": "float" } }, "link": "placeholder" } }, "link": "placeholder" } }
Name of the struct
Colour to represent the struct
If true, the editor will make a Get node for the struct's name, If false, the editor will create New and Break nodes
Array of properties, check the module file docs for more info on them
Array of methods, Check the nodes section for more info on the IO
Documentation link for the struct, to be appended to the link in the settings
The start section is the same as the Nodes section, except that each of those nodes will spawn when a new document is created.
Because there are bound to be a ton of nodes, There are many ways to write them and you can choose speed vs readability.
So, it's very free-form, you can insert things in either JSON format or module file format via string.
"nodes": { // First way: 100% JSON "If": { "type": "1", "format": "if (%0)\n{\n%o0\n}\nelse\n{\n%o1\n}\n%c2", "io": { "inputs": { "": "exec", "Condition": "bool" }, "outputs": { "True": "exec", "False": "exec", "Then": "exec" }, }, "link": "placeholder" }, // Second way: The IO can be given in the module file format "If": { "type": "1", "format": "if (%0)\n{\n%o0\n}\nelse\n{\n%o1\n}\n%c2", "io": "e.;b.Condition;o.;e.True;e.False;e.Then;", "link": "placeholder" }, // Third way: The whole node can be given in the module file format, either through a string or array "If": [ "1", "if (%0)\n{\n%o0\n}\nelse\n{\n%o1\n}\n%c2", "e.;b.Condition;o.;e.True;e.False;e.Then;", "placeholder" ], "If": "1, if (%0)\n{\n%o0\n}\nelse\n{\n%o1\n}\n%c2, e.;b.Condition;o.;e.True;e.False;e.Then;, placeholder" }
Name of the node
Number defining the type.
The output of the node, where %0 will be replaced with the first parameter, %1 with the second, and so on.
%o0 is the first output, %o1 is the second output and so on.
%c is the same as %o except it doesn't indent.
%s is the same as %c except it stops after the first node, and there's no separator
The syntax for each nub is type.name;
Type is the letter code given in the types section
o.; splits the inputs and outputs, so to create a node with one execution input and a boolean output, it would be:
e.NameOfExec; o.; b.NameOfBool;
But you can't have spaces between nubs so it would be squished together like
e.NameOfExec;o.;b.NameOfBool;
The name can be left empty, in which case it would just be type.;
Nubs can have modifiers put at the beginning to change the nub
n.e.ExecNub;
The doc-link is appended onto the main link provided in the settings section to get the full documentation link about the node
Check out the Python module as an example