Hearts of Iron IV is a grand strategy computer wargame with a large modding community.
HoI4 flag maker is a tool to generate tga files from a png file for use in mods.
HoI4 requires 3 tga files for each flag added to the game. A large, medium, and small saved in your mod like so:
- YOURMOD/gfx/flags/flag.tga
- YOURMOD/gfx/flags/medium/flag.tga
- YOURMOD/gfx/flags/small/flag.tga
The tga file format for all is 32-bits and uncompressed
Large size: 82x52 pixel
Medium size: 41x26 pixel
Small size: 10x7 pixel
# clone this repo
git clone https://github.com/atthematyo/hoi4_flag_maker.git
cd hoi4_flag_maker
# Run script
python flags.py
# Run GUI
python gui.py
The first time you run flags.py it will make an input directory for you. This is where you will put all the png files you want to convert to tga files. Once you have png files to convert, the script will make an output directory where it will store your png files. You can then drag the contents of output to your mod's gfx/flags directory.
There is also a simple tkinter GUI.
In the GUI you pick any directory as input and any as output.
There is also a binary exe of the GUI you can you use if you don't want to figure out Python or the dependencies. This is made with pyinstaller.
Download the zip here
Unzip where ever you want to install it then run the exe to run the GUI.
You have a cool flag that you want to use in your mod. The Grand Union Flag would make a good neutral USA flag.
Start by downloading the png and putting it in the input directory with the correct name for what you are using it for. In this case USA_neutrality so that it shows up only for the USA when it is neutral.
Next either run the flags script or use the GUI.
Now that we have run it we have this in the output directory.
Drag all of that to YOURMOD/gfx/flags
Running the mod we see