Fix mod loading: PBO prefix file + $profile path

Two issues prevented the mod from running on the live server:

- Add $PBOPREFIX$.txt (=YAInteraction) matching the toolchain convention so
  the packer mounts scripts at YAInteraction/... where config.cpp defs expect
  them. Without it the script modules were silently never compiled.
- Replace GetGame().GetProfileFolder() (undefined function in this engine build,
  caused a World module compile error) with the "$profile:" virtual path, the
  portable idiom used by ZenRepairWells / TerjeMods.

Verified on the live server: modules compile, MissionServer.OnInit runs, and
settings.json + interactables.json are generated under profiles/YAInteraction/.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
smthspec 2026-06-18 22:29:07 +03:00
parent c1cd01f224
commit 1f63096cdb
2 changed files with 7 additions and 2 deletions

1
$PBOPREFIX$.txt Normal file
View file

@ -0,0 +1 @@
YAInteraction

View file

@ -33,8 +33,12 @@ class YAInteractionConfigLoader
// ------------------------------------------------------------------
static void Init()
{
string folder = GetGame().GetProfileFolder() + DIR_NAME + "/"; // GetProfileFolder() has trailing slash
MakeDirectory(folder); // no-op / harmless if it already exists
// "$profile:" is the engine-mounted virtual path to the server profiles
// folder. (DayZGame has no GetProfileFolder() in this build; $profile: is
// the portable idiom used by e.g. ZenRepairWells / TerjeMods.)
string folder = "$profile:\\" + DIR_NAME + "\\";
if (!FileExist(folder))
MakeDirectory(folder);
string settingsPath = folder + SETTINGS_FILE;
string dataPath = folder + DATA_FILE;