Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mod Compatibility Fixes #291

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Mod Compatibility Fixes #291

wants to merge 2 commits into from

Conversation

BrickPi
Copy link
Contributor

@BrickPi BrickPi commented Feb 3, 2025

  • Implements a "ModManager" which loads .mod files
  • Implements replace_path when searching for files
  • Myriad changes to better reflect how V2 handles systems
  • HPM now successfully loads and runs under OpenVic

@BrickPi BrickPi added the enhancement New feature or request label Feb 3, 2025
Copy link
Contributor

@wvpm wvpm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this PR do not reflect how Victoria 2 works.
Carefully research Victoria 2 instead of trusting in mods.
Mods often just use things without realising it doesn't work.

@@ -79,6 +79,7 @@ bool ConditionManager::setup_conditions(DefinitionManager const& definition_mana
ret &= add_condition("any_greater_power", GROUP, COUNTRY, COUNTRY);
ret &= add_condition("any_neighbor_country", GROUP, COUNTRY, COUNTRY);
ret &= add_condition("any_owned_province", GROUP, COUNTRY, PROVINCE);
ret &= add_condition("any_owned", GROUP, COUNTRY, PROVINCE); // alias? not in vanilla, but used by HPM poptypes, so used by a ton of derivative mods too
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an effect scope. See https://vic2.paradoxwikis.com/List_of_scopes#any_owned
It is easily mistaken for a condition scope.

@BrickPi BrickPi requested a review from wvpm March 16, 2025 23:23
@BrickPi BrickPi force-pushed the improve-mod-loading branch from 4e23937 to 76f501e Compare March 17, 2025 00:20
@BrickPi BrickPi force-pushed the improve-mod-loading branch from 76f501e to e5a01cf Compare March 17, 2025 11:22
wvpm
wvpm previously approved these changes Mar 17, 2025
Copy link
Contributor

@wvpm wvpm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with minor comments.

@BrickPi BrickPi force-pushed the improve-mod-loading branch from 5b7386e to 558e096 Compare March 24, 2025 17:39
@BrickPi BrickPi requested a review from wvpm March 24, 2025 17:40
@BrickPi BrickPi force-pushed the improve-mod-loading branch from 558e096 to 73423c5 Compare March 24, 2025 17:43
@@ -218,6 +234,7 @@ int main(int argc, char const* argv[]) {

char const* program_name = StringUtils::get_filename(argc > 0 ? argv[0] : nullptr, "<program>");
fs::path root;
std::vector<std::string> mods;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::vector<std::string> mods;
std::vector<std::string> mods;
mods.reserve(argc);

Copy link
Member

@Spartan322 Spartan322 Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically we could have std::vector<std::string_view> here, but vector of string_views is not convertible to vector of strings so everything need to support vector of string_views instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants