Skip to content

fix: pass the Scripts root to Caprica so Fallout 4 namespaces resolve - #13

Open
aradix85 wants to merge 1 commit into
libxse:mainfrom
aradix85:fix/papyrus-namespace-root
Open

aradix85 wants to merge 1 commit into
libxse:mainfrom
aradix85:fix/papyrus-namespace-root

Conversation

@aradix85

Copy link
Copy Markdown

commonlib.papyrus hands Caprica the temp directory above Scripts as its input. Caprica derives a script's expected namespace from its path relative to the input directory, so with --game=fallout4 a namespaced script fails:

Fatal Error: Scripts\FO4A\Proef.psc: The script namespace 'FO4A' does not match the expected namespace 'Scripts:FO4A'.

With --game=skyrim the same input compiles, and there the extra level is what puts the output under Scripts/.

This passes rootdir (the Scripts directory) as the input instead, and writes to <targetdir>/Scripts, so the output keeps the Scripts/... layout that the archive and install hooks pick up through scriptdir/(**).

Tested with Caprica v0.3.0 (the latest release), xmake 3.0.9, Windows 11:

  • Fallout 4, through commonlibf4.papyrus in a project (imports given explicitly, skip_default_imports = true): before this change, the error above; after it, build/papyrus/Scripts/FO4A/Proef.pex.
  • Skyrim, calling Caprica with the arguments the rule builds, not through a Skyrim project: the output path stays Scripts/ProefSky.pex. Compared field by field, the pex is identical apart from the compilation time in the header, which also differs between two runs of the current rule.

The archive and install hooks were not exercised; their paths are unchanged by construction.

Based on 29fbdb0.


Disclosure: I am a blind developer and I prepared this with AI assistance.

Caprica derives a script's expected namespace from its path relative to
the input directory. The rule passed the temp directory above `Scripts`,
so every Fallout 4 script failed with "expected namespace 'Scripts:...'".
Pass `Scripts` itself and write to `<targetdir>/Scripts`, which keeps the
output layout the archive and install hooks rely on.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant