Back to the video games page

Script to easily alter some units/equipment parameters
in Hearts of Iron IV gamefiles

General informations

_modify_equipment.txt

This is a Python 3 script I wrote to more easily alter some units/equipment parameters in Hearts of Iron IV gamefiles, mostly build cost, training time, and combat width. The script is made according to my own needs, but feel free to use it if you think it could save you some time.

How to use the script

This is a Python 3 script meaning to use it, one must have Python 3 installed (not Python 2).
Copy paste the content of the file below into a .txt file on your computer, and change the extension of your text file to ".py" (python extension).

_modify_equipment.txt

The script (the .py file) must be positionned in "Hearts of Iron IV/common", and will affect files in the "units" folder. So do this in the frame of a mod to avoid unwillingly damaging your official gamefiles, or if you don't at the very least make a backup of the "units" folder.

To run the file, double-click the .py file, provided you have Python 3 installed.

At the beginning of the script there's a list of values you can change (keep the quotes):



When ran, the script will change the corresponding values in the txt files located in common/units.


KEEP IN MIND: The script changes the values across the whole file, without regards for specific unit types. For example, when you change the build cost of a single engine airplane, the modification will affect ALL single engines airplanes: carrier planes, naval bombers, fighters, etc.

The script

I've already linked it above, but here it is again:
_modify_equipment.txt
As stated above, copy paste the content of the file into a .txt file on your computer, and change the extension of your text file to ".py" (python extension).
Also, I'm no programmer and I'm sure it could've been written far more elegantly. But to modify txt files, it does the job.