OpenXcom Forum

OpenXcom Forks => More Forks => Topic started by: Yankes on November 16, 2024, 01:37:25 am

Title: [1] Fork mod compatiblity reporting
Post by: Yankes 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.
Title: Re: [1] Fork mod compatiblity reporting
Post by: Whispers on November 22, 2024, 01:53:05 pm
I love this idea!
Title: Re: [1] Fork mod compatiblity reporting
Post by: ashugg on December 05, 2024, 11:04:12 am
Excellent notion!
Title: Re: [1] Fork mod compatiblity reporting
Post by: Flaubert 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.
Title: Re: [1] Fork mod compatiblity reporting
Post by: Yankes on December 06, 2024, 10:02:24 pm
Yes