Builtin Library
README.md
procgen.toolbox shared
Cross-tool helpers for the procgen toolbox, required by its tools as
require(".shared") (and from elsewhere as
@builtin::systems.procgen.procgen.shared). Tools return their raw values (the
tool.assetType wrapper packages them into the system ZmToolResult
envelope, { ok, value | error }) and raise via error(message) on failure.
What it holds, by the tools that share it:
- Graphs and nodes:
resolveGraph(a graph by VFS path, asset name or graph object),graphName,resolveTarget(a target string, defaulting to the first declared output, else the outputshown),shownRefs(the value eachio.outputcall of a graph holds) andgraphFor(the graph to evaluate for a target: a graph that declares no output also declaresshown, the value its firstio.outputshows),sourceFolderandwriteCode(the folder of the code an edit tool changes, and writing it once it builds, with whatproc.validatesays of it),nodeEntriesandplaceOf(every node a graph can call, with its family and the name a graph calls it by), andcookCheck(a call-form graph's first frame cooked in a cache of its own, answering what the cook refused and the nodes that run on the CPU every frame). - Pictures of values:
previewNameandrenderValue(a value visualized, captured and cleaned up), andrenderGenerated(an output pictured as a temporary generator draws it at the graph's still). - Live generators:
resolveEntity,generatorProxyandsubject(an entity carrying aGenerator, refused when it carries none),pictureOptions(the picture options checked by name),pictureAtandpicturesPlayedTo(a picture of the frame a generator presents for a graph time),pictureOfPresentandholdPresent(what aprocgen.onPresentprobe runs on a hit),clockStateandrestoreClock(the clock a picture moves, put back), and the present waits under them.