OpenXcom Forum
OpenXcom Forks => More Forks => Topic started 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:
/**
* 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:
const EngineData supportedEngines[] = {
{ "EngineX", { 1, 2, 0, 0 }},
{ "EngineY", { 1, 4, 0, 0 }},
};
This will make mod main file metadata.yml:
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.
-
I love this idea!
-
Excellent notion!
-
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:
/**
* 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:
const EngineData supportedEngines[] = {
{ "EngineX", { 1, 2, 0, 0 }},
{ "EngineY", { 1, 4, 0, 0 }},
};
This will make mod main file metadata.yml:
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.
-
Yes