code wiki / _hdl_build / nx_story_vm.nx

nx_story_vm.nx

buildroot/runtime/_hdl_build/nx_story_vm.nx

1715 B34 linesdepth 2pulls 2 transitivereach 7 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_story_vm.nx -- S-R1: the sovereign DATA-DRIVEN STORY-GRAPH VM (P4 story pillar foundation). A story is DATA, not control flow: nodes with up to SV_NCH choices; each choice has a target node, an optional REQUIRED flag (gate the branch) and an optional SET flag (effect). State = current node + an i64 flag bitmask. This is the engine for dialogue trees, quests, and branching narrative; later rungs slot LLM-authored text into nodes (P5). Pure integer logic, 100% sovereign. license_tier: ORIGINAL

dependencies 1 imports · 5 importers

nx_syscalls.nx nx_story_vm.nx nx_coc_engine.nx nx_minigame_capstone_gate.nx nx_plotgen.nx nx_story_quest_gate.nx nx_story_vm_gate.nx

imports: nx_syscalls.nx

imported by: nx_coc_engine.nxnx_minigame_capstone_gate.nxnx_plotgen.nxnx_story_quest_gate.nxnx_story_vm_gate.nx

structs

none

consts

8const SV_NCH: i64 = 4 // max choices per node

functions

12func sv_choose(ch_target: *i64, ch_req: *i64, ch_set: *i64, cur: i64, choice: i64, flags: *i64) -> i64
26func sv_is_end(node_is_end: *i64, node: i64) -> i64
31func sv_has_flag(flags: *i64, bit: i64) -> i64
called by 2: mainmain