Hello Meridian! I implemented code that allows to define custom base sets and (if related option is enabled) to select them in a new game menu. I was pretty much inspired by this XPZ submod:
https://openxcom.org/forum/index.php?topic=12172.0 - then went to the chat, asked people about it and everybody pretty much welcomed this idea.
You can find relevant dedicated (atomic) commit here:
https://github.com/WarStalkeR/OpenXcomExMore/commit/5fbd227d415efa55b399618acec030460b1c5172This is how it looks right now:
Code-wise it requires modders to define in rule file something like this:
startingBaseSets:
- name: STR_INIT_BASE_NAME
baseDefault:
...base code here...And it follow
exactly same code structure as in '
startingBase', so everything is well known.
Beside '
baseDefault' there is also '
baseBeginner', '
baseExperienced', '
baseVeteran', '
baseGenius' and '
baseSuperhuman' for each difficulty, just like with original '
startingBase' and '
startingBaseDIFF'. Localization-wise, for every base set name (i.e.
STR_INIT_BASE_NAME), you also need to add '_DESC' variant with description (i.e.
STR_INIT_BASE_NAME_DESC) and base set is good to go.
You might see me using '
YAML::Clone()' in code a lot - but that's because not I wanted, but because sometimes when variables were reset via empty '
YAML::Node()' actual mod data was lost.
As always, if anything else needs to be improved, please tell me so and I will work on it. Thankfully, a lot of similar code already exists, so I didn't had many changes to screw everything up in a very horrible, horrible manner.
And if everything is good to go, give me a green light and I will create dedicated OXCE commit and pull request.