30. Headers, includes and shared state
The only language header is language 1.0. PCA Script does not have C-style header files, #include, textual macros or an import statement that pastes another file into this one. A leading #include would be a comment.
function run()
let library = include_script("utility_pca")
let total = call_script(library, "add_points", [10, 5])
set_included_variable(library, "last_total", total)
return get_included_variable(library, "last_total", 0)
endWith one argument, include_script() checks that a script ID exists and returns that ID. It does not run the other script’s top-level code or import its functions into your local scope. With additional arguments it uses the same call route as call_script().
function add_points(base: integer, bonus: integer): integer
return base + bonus
endfunction run()
return add_points(10, 5)
endPut the second example in a separate PCA Script called utility_pca. The included-variable helpers use a router-owned dictionary keyed by script ID and variable name. They do not read the other script’s local let declarations. This store is session/cache state, not a saved-game variable system.
A header can describe a public function’s parameters in comments, but its executable definition still belongs in a script record. Use the shared router for libraries and the Variable Designer for saved story state.
