Is there a way to mod a single focus without replacing the whole focustree?

  • 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.

GSP Jr

Colonel
15 Badges
Apr 27, 2017
1.159
983
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: La Resistance
  • Battle for Bosporus
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Semper Fi
It is possible.
Depending on what focus, and what you want to modify, of course.
 

Rikai

Second Lieutenant
25 Badges
Oct 20, 2018
108
114
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: No Step Back
  • Battle for Bosporus
  • Stellaris: Federations
  • Hearts of Iron IV: La Resistance
  • Stellaris: Lithoids
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Megacorp
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Hearts of Iron IV: Expansion Pass
  • Age of Wonders
  • Surviving Mars
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Magicka 2
  • Cities: Skylines
  • War of the Roses
  • Europa Universalis IV
  • Crusader Kings II
  • Magicka
  • Lead and Gold
I wanna modify Italy's Triumph in Africa and USA's The Giant Wakes.

But as far as I know, the focuses are entirely defined by the .txt file of their focustree. So, you claim to have a solution. Please state it.
 
Last edited:

GSP Jr

Colonel
15 Badges
Apr 27, 2017
1.159
983
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: La Resistance
  • Battle for Bosporus
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Semper Fi
Obviously, you must override the games files C:\Program Files (x86)\Steam\steamapps\common\Hearts of Iron IV\common\national_focus\italy.txt and C:\Program Files (x86)\Steam\steamapps\common\Hearts of Iron IV\common\national_focus\usa.txt. with the modifications you want to make. The modified files would need to be in your mos folder in Documents, something like C:\Users\MPS\Documents\Paradox Interactive\Hearts of Iron IV\mod\gsp_pbu\common\national_focus\usa.txt.

Again, depending on exactly what you want, it may be very simple to add, might be a nightmare.
 
  • 1Like
Reactions:

Shaka of Carthage

General
12 Badges
Sep 7, 2017
2.095
1.742
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Hearts of Iron IV: Expansion Pass
  • Imperator: Rome Sign Up
  • Hearts of Iron IV: La Resistance
  • Battle for Bosporus
  • Crusader Kings II
Obviously, you must override the games files C:\Program Files (x86)\Steam\steamapps\common\Hearts of Iron IV\common\national_focus\italy.txt and C:\Program Files (x86)\Steam\steamapps\common\Hearts of Iron IV\common\national_focus\usa.txt. with the modifications you want to make. The modified files would need to be in your mos folder in Documents, something like C:\Users\MPS\Documents\Paradox Interactive\Hearts of Iron IV\mod\gsp_pbu\common\national_focus\usa.txt.

So in effect, you are overlaying the focus tree box with your own?
 

Anaraxes

Lt. General
51 Badges
Jun 22, 2012
1.407
1.429
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Jade Dragon
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Natural Disasters
  • Europa Universalis IV: Third Rome
  • Hearts of Iron IV: Death or Dishonor
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: La Resistance
  • Crusader Kings III
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Victoria 2
  • Europa Universalis IV
  • Age of Wonders III
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Res Publica
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines - After Dark
For mods, the game reads all of the original files, then the contents of files the mods folder, replacing the specific things (data structures, constants, etc) in the original files with the values in the mod files. The mods override whatever was in the original source, and leave everything not mentioned unchanged.

For the focus trees, I expect the name of a "specific thing" in question is the focus_id field of a focus structure.
Code:
    focus = {
        id = USA_the_giant_wakes
        icon = GFX_goal_generic_construct_civ_factory
        prerequisite = { focus = USA_arsenal_of_democracy }
        available = {
            OR = {
                has_war = yes
                has_war_support > 0.3
            }
            democratic > 0.95
        }
        continue_if_invalid = yes
...
So, you should be able to put just one focus structure in your USA focus mod file with this ID, and whatever contents make the focus do what you want to do. You'll have to replace all of the values needed in that record (maybe just copy the original into your mod file to start), not just one line of the whole record. (Possibly you can overwrite individual fields of the record, but be prepared to copy the whole structure.)

If you want to insert entirely new focuses into the tree, I expect you're going to have to track down the other focus records for the items before and after and change their "prerequisite" fields to link the new focus into the tree where you want it.

(Caveat: I'm not a modder, so have no practical experience trying to rebuild parts of focus trees. The mods forum is probably the best place to get into the details of how to implement your mods.)
 
Last edited:

GSP Jr

Colonel
15 Badges
Apr 27, 2017
1.159
983
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: La Resistance
  • Battle for Bosporus
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Semper Fi
So in effect, you are overlaying the focus tree box with your own?
That's about right. But doing it the simple way could cause issues with other mods that also do it that way.
You could try having JUST the Giant Wakes focus in a file named differently, like my_usa.txt to replace just that focus, not sure, have to try it out.
 

bitmode

1st Reverse Engineer Battalion
Nov 10, 2016
3.824
7.024
Title says all
No, you need to copy the entire focus tree file. The definition of a focus tree and its NFs is completely contained within one file.
For mods, the game reads all of the original files, then the contents of files the mods folder, replacing the specific things (data structures, constants, etc) in the original files with the values in the mod files.
The files in a mod shadow the ones of the same name in the game directory (they effectively form a union file system). The original file does not get read in this case. Even with files of different names, the Clausewitz txt format is usually not able to modify data after the fact, only add data. Lua files don't have this restriction, which is why mods can change individual defines.
 
  • 1Like
  • 1
  • 1Love
Reactions: