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

Offline Yankes

  • Global Moderator
  • Commander
  • ***
  • Posts: 3396
    • 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 »

Offline Whispers

  • Sergeant
  • **
  • Posts: 46
    • View Profile
Re: [1] Fork mod compatiblity reporting
« Reply #1 on: November 22, 2024, 01:53:05 pm »
I love this idea!

Offline ashugg

  • Sergeant
  • **
  • Posts: 11
    • View Profile
Re: [1] Fork mod compatiblity reporting
« Reply #2 on: December 05, 2024, 11:04:12 am »
Excellent notion!

Offline Flaubert

  • Captain
  • ***
  • Posts: 52
    • View Profile
Re: [1] Fork mod compatiblity reporting
« Reply #3 on: December 06, 2024, 03:20:09 pm »
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.

One clarification, please. I have OPENXCOM_VERSION_ENGINE changed to "myForkEngine", and myForkEngine is derived from "Extended" engine . If I intend to use MODS targeted to "Extended" which -I think- should be compatible with "myForkEngine", shoud I need to include an entry:
    { "Extended", { <x>, <y>, <z>, <a>}},
at ModInfo.cpp?

Thanks in advance.

Offline Yankes

  • Global Moderator
  • Commander
  • ***
  • Posts: 3396
    • View Profile
Re: [1] Fork mod compatiblity reporting
« Reply #4 on: December 06, 2024, 10:02:24 pm »
Yes