Hearts of Iron IV

Hearts of Iron IV

Not enough ratings
Mod Priority Handbook for Paradox Games
By fedcba
Reduce your mod (and your work amount!) to the strict minimum while keeping all its features, and control what happens if your nasty subscribers actually start playing their most favored mods together[/b]
   
Award
Favorite
Favorited
Unfavorite
Mod Priority Handbook for Paradox Games
I have seen that many compatibility issues between mods, that's why I would like to recap the mod priority rules here.
Basically, a Paradox Game gives priority to mods over base game, and loads the mod files in alphabetic order, like if you click on " name " in your file manager: #, a, z, etc.

For your information, a file (.txt, .yml etc.) contains several classes (like the infantry_equipment archetype, infantry_equipment0, 1 or 2 etc.). Every class has several properties (like upgrades, soft_attack etc.).

Let's say you have a mod A (adding extra upgrades) that should be compatible with a mod B (adding extra modern equipment types), but both modify the common/units/equipment/infantry.txt file.You have to place yourself in the folder where the file is first defined in base game (Documents\Paradox Interactive\Hearts of Iron IV\mod\modA\common\units\equipment\ here)
If you want to add or modify classes without priority
If you want to add or modify classes (the infantry_equipment archetype here) in base game while giving over priority to the b_infantry.txt file from mod B
  • Create a file (like #infantry.txt) whose name comes before b_infantry.txt (in alphabetic order)
  • Copy in this file all and only the classes (like the infantry_equipment archetype) to be modified (and create those to create). You shouldn't copy any other class (like infantry_equipment0,1 or 2).
  • Add, modify or delete all the properties you want (I add an extra upgrade).
    All the base game classes you redefine (the infantry_equipment archetype here) will be overwritten.
    If b_infantry.txt defines infantry_equipment too, it will be overwritten by your infantry_equipment from z_infantry.txt (which comes later in alphabetic order).
If you want to add or modify classes and give them priority
If you want to add or modify classes[/u] (like the infantry_equipment archetype) in base game and give them priority over the b_infantry.txt file from mod B[/b]
  • Create a file (like z_infantry.txt) whose name comes after b_infantry.txt (in alphabetic order)
  • Copy in this file all and only the classes (like the infantry_equipment archetype) to be modified (and create those to create). You shouldn't copy any other class (like infantry_equipment0,1 or 2).
  • Add, modify or delete all the properties you want (I add an extra upgrade).
    The base game classes of the folder sharing the same name (the infantry_equipment archetype here) will be overwritten.
    If b_infantry.txt defines infantry_equipment too, it will be overwritten by your infantry_equipment from z_infantry.txt (the file name comes later in alphabetic order).
If and only if you have the weird idea to delete classes
If and only if you have the weird idea to delete classes (for instance, if for some reason you don't want any infantry_equipment2 any more) in base game:
  • Copy the file containing the class you want to delete. Don't modify the file name.
  • Remove, modify or add all the classes you want (like removing infantry_equipment2).
    The whole base game file (infantry.txt here) will be overwritten.
  1. If mod B has a file in the same folder which (re)defines some of your infantry.txt classes:
    -if b_infantry.txt comes earlier than infantry.txt in alphabetic order, only classes from b_infantry.txt who are not defined in infantry.txt will be taken into account ( ! moderate compatibility issue ! )
    -if b_infantry.txt comes later than infantry.txt in alphabetic order, only classes from infantry.txt who are not defined in b_infantry.txt will be taken into account ( ! moderate compatibility issue ! )
  2. If mod B has a file with the same name (infantry.txt here):
    -if the code of mod B (1089354766) comes after the code of mod A(719416488), only the file from mod B will be taken into consideration ( ! major compatibility issue ! )
    -if the code of mod A comes after the code of mod B, only the file from mod A will be taken into consideration ( ! major compatibility issue ! )
General Advice
  • As I've shown, if you want your mod to be as compatible as possible, just avoid using the third solution (apart if you really have the weird need to suppress a class! )

  • Please avoid the zzzzz and #### inflation... Just check the B mod files you want (or don't want) to overwrite and just add the minimum amount of letters to come after (or before) in alphabetic order.

  • I would like to congratulate & thank you for having read my quite technical post to the end!

  • Please and !

  • If you have any question or if you want a detail to be explained, just post a comment

The Big Picture
    Improve Any Equipment can be seen as a concept proof for the principles of this guide. I plan to implement them as well in:
  • 112 Slots Production Revolution
  • Coring New Concept
  • Continuous Focuses New Concept
  • Politics New Concept

    If you are interested, just ask me to join (even if you never modded before :))
2 Comments
fedcba  [author] 6 Aug, 2017 @ 2:35am 
this has no importance, but you should chose a title that reminds the name of your mod
Ben 5 Aug, 2017 @ 11:03am 
im trying to make a mod and im rlly new what should my directorybe