Get the PAPER headers
PAPER publishes provider API 2.0 from its own repository: the headers are in PAPER's include/PAPER/ folder. Take them from PAPER's repository at the release tag you target; the release archive holds only the player's files. There is nothing to link. The headers include only the C++ standard library, need a 64-bit consumer and compile as C++20.
CMake
Point a cache variable at PAPER's include/ folder and add it to your plugin:
set(PAPER_INCLUDE_DIR "" CACHE PATH "PAPER include directory (the folder that contains PAPER/)")
if(NOT EXISTS "${PAPER_INCLUDE_DIR}/PAPER/Client.h")
message(FATAL_ERROR "Set PAPER_INCLUDE_DIR to PAPER's include directory")
endif()
target_include_directories(MyPlugin PRIVATE "${PAPER_INCLUDE_DIR}")
Set the path for your machine in your own, uncommitted CMakeUserPresets.json. Include <PAPER/Client.h> and the headers of the interfaces you use, such as <PAPER/PhysicalReload.h>. Do not copy the headers into your project or include anything from PAPER's src/.
Use the headers of the PAPER version you ship against. Records carry their own size and version, and PAPER rejects a record whose size or version does not match its own; rebuild when you move to a newer PAPER.
Runtime requirements
- Fallout 4 VR 1.2.72 with F4SE VR, and ROCK with its requirements. PAPER consumes ROCK's provider API 2.0.
PAPER.dllloaded. Resolve it at runtime withGetModuleHandleW(L"PAPER.dll"); if it is absent, or discovery fails, leave your PAPER features off and keep running.
Your plugin owns its own F4SE Query/Load, its runtime version check, logging, game-data lifecycle and shutdown order. Owner registration starts only after PAPER reports isReady.
Provider API 2.0 is released with PAPER 2.0. PAPER 1.2 and earlier served the pre-2.0 API.
Mods built for the pre-2.0 API
The pre-2.0 headers (PAPERApi.h and the PAPERPhysicalReload* headers) describe the earlier API. PAPER 2.0 keeps their exports only to refuse them: each returns null and logs the calling DLL in PAPER.log; the game keeps running. See where things moved.
Next: first consumer.