nx_campaign.nx
buildroot/runtime/nx_campaign.nx
about
nx_campaign.nx -- WRITING arc, rung W-CAMP-1: the D&D CAMPAIGN structure model.
Operator intent 2026-08-04: generate dnd campaigns -- the campaign/GM mode the
writing-hub census lists as a GAP. A campaign script is a HEADER (setting/party/
quest) + SESSION -> ENCOUNTER blocks, each encounter a small key:value record
(kind/time/location/npcs/goal/transit). This organ counts sessions+encounters,
validates the record set, emits the per-encounter GM BRIEF the generation seat
expands + the image-prompt seed (same image-gen ingestion as manga/scene), and
makes the CAMPAIGN-CONTINUITY law MECHANICAL per
feedback-arcs-as-dnd-campaign-multiverse-continuity:
- time moves monotonically forward (cg_time_check counts regressions);
- a location change without a transit beat is a teleport (cg_transit_check).
The campaign TEXT is operator/lane DATA (the seam: engine structures, seat
authors). DRY: markers via nx_manga mg_line_is/mg_count; fields via the
nx_scenario whole-key parser on encounter byte sub-ranges. Pure integer,
NO syscalls, caller owns buffers (the nx_note shape).
license_tier: ORIGINAL
module: nishi-core.write.campaign
depends: nishi-core.write.manga nishi-core.write.scenario
capability: WRITE_CAMPAIGN
dependencies 2 imports · 2 importers
imports: nx_manga.nxnx_scenario.nx
imported by: nx_campaign_gate.nxnx_writer_run.nx
structs
| none |
consts
| none |
functions
| 24 | func cg_streq(a: *u8, b: *u8) -> i64 |
| 35 | func cg_header_end(buf: *u8, n: i64) -> i64 |
| 44 | func cg_count_sessions(buf: *u8, n: i64) -> i64 { return mg_count(buf, n, "SESSION\x00" as *u8) } |
| 45 | func cg_count_encounters(buf: *u8, n: i64) -> i64 { return mg_count(buf, n, "ENCOUNTER\x00" as *u8) } |
| 48 | func cg_enc_start(buf: *u8, n: i64, idx: i64) -> i64 called by 6: cg_validatecg_time_checkcg_transit_checkcg_emit_briefcg_emit_imgmain calls 2: mg_line_issc_next_line |
| 66 | func cg_enc_end(buf: *u8, n: i64, start: i64) -> i64 called by 6: cg_validatecg_time_checkcg_transit_checkcg_emit_briefcg_emit_imgmain calls 2: sc_next_linemg_line_is |
| 87 | func cg_validate(buf: *u8, n: i64) -> i64 called by 2: mainwr_do_campaign calls 5: cg_header_endsc_hascg_count_encounterscg_enc_startcg_enc_end |
| 107 | func cg_field_int(buf: *u8, n: i64, key: *u8) -> i64 |
| 130 | func cg_time_check(buf: *u8, n: i64) -> i64 |
| 152 | func cg_transit_check(buf: *u8, n: i64, sa: *u8, sb: *u8, cap: i64) -> i64 called by 2: mainwr_do_campaign calls 6: cg_count_encounterscg_enc_startcg_enc_endsc_copy_fieldcg_streqsc_has |
| 179 | func cg_emit_brief(buf: *u8, n: i64, idx: i64, out: *u8, cap: i64) -> i64 |
| 200 | func cg_emit_img(buf: *u8, n: i64, idx: i64, out: *u8, cap: i64) -> i64 |