Author Topic: [1] Fork mod compatiblity reporting  (Read 237 times)

Offline Yankes

  • Global Moderator
  • Commander
  • ***
  • Posts: 3347
    • View Profile
[1] Fork mod compatiblity reporting
« on: November 16, 2024, 01:37:25 am »
As some forks can dramatically change behaviors how engine works is good to allow mods that expect given behavior.
Because of this I added in main OXC code base code that is used to recognize what mod is compatible with engine.

In file ModInfo.cpp there is table:
Code: [Select]
/**
 * List of engines that current version support.
 */
const EngineData supportedEngines[] = {
{ OPENXCOM_VERSION_ENGINE, { OPENXCOM_VERSION_NUMBER }},
{ "", { 0, 0, 0, 0 } }, // assume that every engine support mods from base game, remove if its not true.
};

Each mod should change `OPENXCOM_VERSION_ENGINE` macro to report current name of engine that mods can test against.

Example:
Code: [Select]
const EngineData supportedEngines[] = {
{ "EngineX", { 1, 2, 0, 0 }},
{ "EngineY", { 1, 4, 0, 0 }},
};

This will make mod main file metadata.yml:
Code: [Select]
name: "Some Mod"
version: 5.0
reservedSpace: 1
requiredMasterModVersion: 1.2
requiredExtendedEngine: EngineX
Will be allowed to be loaded by engine because it require supported version EngineX.
« Last Edit: November 16, 2024, 12:38:00 pm by Yankes »