Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

procgen.promote

Makes a part a node. A part is a .procGraph that graphs call by its path (g["~/fx/Rim"]({ ... })); a node is a .procNode, found by procgen.searchNodes and called by name.

The node promote writes declares the part's inputs as its own (with their types, defaults, ranges, options and descriptions), calls the part with them and gives the part's outputs. The part keeps its code and every graph calling it, and the node stays the part's: editing the part changes what the node makes.

  • name is the node's name (default: the part's), into the folder it goes in (default: the one holding the part). With both defaults the node and the part share a name in one folder, so each is called by its name with its suffix: call is then ~/fx/Rim.procNode, and the node calls ~/fx/Rim.procGraph.
  • A promote that fails writes nothing: the node folder it began is removed.
  • description and tags are what search finds it by (default: the part's own .metadata; a part whose .metadata carries no description needs one given).
tools.use("procgen", "promote", { graph = "/source/fx/Rim.procGraph", name = "RimRocks", description = "A rim of rocks around a disc." })

procRef:promote(opts) on a .procGraph ref is the same call. Part of procgen.toolbox, called as tools.use("procgen", "promote", ...) (zero procgen promote in the engine shell). Returns { node, call, part, inputs, outputs }.