HoI 4 - Italy focus Regional Development does not add factory to Ethiopia sometimes

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Masterbobli

Second Lieutenant
11 Badges
Feb 20, 2020
144
141
  • Cities: Skylines
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Hearts of Iron IV: Expansion Pass
  • Battle for Bosporus
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: La Resistance
Description of issue
Italy focus Regional Development does not add factory to Ethiopia sometimes

What platform do you play on?
Steam

Game Version
1.12.6

Enabled DLC


Do you have mods enabled?

No

Description
It's possible to create a scenario where no factory is built in Ethiopia when it should be. There are two requirements for this issue to happen.
1. Ethiopia owns all their core states and is a subject of Italy (which is possible if Ethiopia takes the fascist path)
2. Another colonial development focus besides develop Ethiopia is completed, and that region is controlled by Italy directly

According to the game code to add the first factory to Ethiopia, the game will first check whether any state controlled by Italy has its infrastructure improved through a previous focus. If not, the game will then check whether any puppets have a state that satisfies this condition.
Code:
        if = {
                limit = {
                    has_completed_focus = ITA_develop_ethiopia
                }
                if = {
                    limit = {
                        any_controlled_state = {
                            is_fully_controlled_by = ROOT
                            has_state_flag = ITA_improved_infrastructure_in_state_flag
                        }
                    }
                    (some add factory effect)
                }
                else_if = {
                    limit = {
                        any_subject_country = {
                            any_controlled_state = {
                                is_fully_controlled_by = PREV
                                has_state_flag = ITA_improved_infrastructure_in_state_flag
                            }
                        }
                    }
                    (another add factory effect)
                }
                (add second factory effect)
            }
In this scenario, the first condition is met because another state controlled by Italy has its infrastructure developed through the other colonial development focus.

Then, the game will try to add factories in the state that is controlled by Italy and is a core of Ethiopia.
Code:
                    random_controlled_state = {
                        limit = {
                            has_state_flag = ITA_improved_infrastructure_in_state_flag
                            is_core_of = ETH
                        }
                        (add factory)
                    }
This is when the issue come. Since all Ethiopian core states are owned by Ethiopia, no state will satisfy this condition and thus no factory will be added.

The code to add the second factory is just a direct copy from the first one, but without the check that attempts to verify whether it is owned by a subject. As a result, the second factory will not be added as well.

Similar issues may appear in other regions as the code also seem to have the same issue, but I haven't tested them yet

Steps to Reproduce
1. Start a game, and make sure Ethiopia takes the fascist path
2. Make sure Ethiopia wins the civil war
3. Complete focus Develop Ethiopia and another one (e.g. Develop Somalia)
4. Check the tooltip of the Regional Development focus
5. See Error (no factories are added to Ethiopia)

Upload Attachment
File(s) attached
 

Attachments

  • 截屏2022-11-27 07.04.58.png
    截屏2022-11-27 07.04.58.png
    2,8 MB · Views: 0
Last edited:
  • 1
  • 1Like
Reactions:
Upvote 0