Author a VNyan node graph
vnyan_graph_writeBuilds a node graph from a spec and exports it as a JSON file for live import into VNyan, or writes directly to a graph slot when VNyan is closed.
Instructions
Builds a node graph from a friendly spec (nodes with caller-chosen ids + literal values, exec/value connections referencing those ids). By default (no 'slot') it EXPORTS the graph as a plain JSON file - import it into VNyan live via its own 'Load Graph' menu (replaces the currently active tab, VNyan stays running, no restart). Pass 'slot' instead to write directly into that graph slot (redeemsN.json + its asredeemsN.json mirror), REPLACING its contents - this REQUIRES VNyan closed (same guard as vnyan_settings_set) and backs up the slot first; use it only when VNyan is already closed for other reasons. Most action nodes have zero execOut sockets (check vnyan_node_schema) - they are terminal, not links in a serial chain. To run several actions off one event/trigger, fan its single execOut out to each action's execIn directly, rather than chaining action-to-action. Node-value file-path fields (sound/avatar files) can't be set as literals here since VNyan encrypts them - wire a SetTextParamNode/TextReplaceNode into that value socket instead, the same pattern VNyan's own Crowd Control example graph uses. VALUE SOCKETS ARE STRONGLY TYPED AT RUNTIME despite values[] always being strings in the saved JSON - wiring a raw int/text output straight into a float/bool input throws inside VNyan and silently aborts the whole call (see valueConnections.toIndex below). If writing directly to a slot, VNyan only EXECUTES slots covered by settings.json 'NodeGraphCount' - a graph placed beyond that count loads with no error but never runs; use vnyan_settings_get area:'misc' to check it first. If using the default export+Load-Graph workflow instead, note VNyan's live Load Graph updates the running graph immediately but only writes it to redeemsN.json on VNyan's own quit - vnyan_graph_read can lag behind what's actually loaded until then. Full cookbook: vnyan_guide topic:'node-authoring'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slot | No | Advanced/fallback: write directly into this slot instead of exporting a file. REQUIRES VNyan closed. | |
| nodes | Yes | Every node in the graph | |
| graphName | Yes | Display name for the graph tab | |
| connections | No | Execution-flow wiring. Most action nodes have ZERO execOut sockets (check vnyan_node_schema) - they are terminal, not links in a chain. To run several actions off one event, add one connection per action from that same event node, rather than chaining action-to-action. | |
| exportFileName | No | File name for the export (default: graphName + '.json'), written under the configured export directory | |
| valueConnections | No | Data-flow wiring between value sockets - see valueConnections.toIndex for the critical type-safety rule. |