ParadoxGameConverters / Vic2ToHoI4

Converts Victoria 2 saves into Hearts of Iron 4 mods.
MIT License
28 stars 21 forks source link

Military access is reversed #1553

Open cetvrtak opened 2 years ago

cetvrtak commented 2 years ago

Vic2 military_access = yes relations entry for a country means the country has military access in target country, while HoI4 only has give_military_access = yes command.

We need to reverse this, Vic2 military access TARGET needs to have give_military_access = yes in HoI4 country history file, instead of source country.

vedant-jad99 commented 2 years ago

Hi, can I take this issue, please?

Idhrendur commented 2 years ago

Please do! Ask any question you need, and when complete create a pull request. There's some automated tools and one of the experienced team members will give a code review, then we'll merge it in.

vedant-jad99 commented 2 years ago

The message is a bit ambiguous, could please clarify the context? I understood from the code that give_military_access = yes is present OutHoi4Country.cpp but I am a bit confused as to what exactly needs to be changed.

Idhrendur commented 2 years ago

It'll need to be elsewhere, and looks to be a little more complex than I had first assumed.

The function HoI4::Country::convertRelations() is where we convert Vic2 relationship-related stuff to HoI4 relationship-related stuff by instantiating a new HoI4::Relations. You'll need to remove the part of the HoI4::Relations that transfers military access.

You'll need to add a setter to HoI4::Relations for military access. Then add a function to HoI4::World that loops over all Vic2 countries, gets their relations, and sees if they contain military access. If they do, translate the Vic2 tags to HoI4 tags, look up the relevant HoI4 country, and update its relationships with the military access.

It's a lot of steps, so if that's too complex a first task for the converter, feel free to drop it.