Hearts of Iron IV

Hearts of Iron IV

Not enough ratings
How to create a Submod for Intelligence Agency Upgrade Alert
By Sakul805
For modders who want to create a Submod for my mod Intelligence Agency Upgrade Alert
   
Award
Favorite
Favorited
Unfavorite
Introduction
There are two types of mods that require a submod for this:
1. Mods that change the UI
2. Mods that modify Intelligence Agency upgrades

Due to the way HOI4 works, the latter is more complicated because detecting whether agency upgrades are available or in progress involves a rather convoluted method.
Submod for a new UI
Example of a Graphics Submod: Hearts of Minecraft Submod
icon
The Icon for the Alert is located at gfx/interface/scripted_gui_graphics/intelligence_agency_alert.dds
you will need to create your own icon or adjust the one i used, here are the foreground and background:

intelligence_agency_alert.gui
to position the Alert there is the file intelligence_agency_alert.gui

you will need to copy and adjust it so that the Alert is at an appropriate position
(by adjusting the x/y coordinates at the top)
if your new alert has a different size than the vanilla ones, you also need to change the size below the coordinates
Submod for new Upgrades
Example of a New-Upgrade Submod: Road to 56 Submod
intelligence_agency_upgrades.txt
To create a Submod for a mod that changes the Intelligence Agency Upgrades, you will first need to copy the file common/intelligence_agency_upgrades/intelligence_agency_upgrades.txt from that mod.

in that file there are upgrades with levels and modifiers that will look like this:


all upgrades (modifiers_during_progress and level) will need to be changed like this:


they need
hidden_modifier = { int_agency_upgrade_modifier = 1 }
as modifier during progress
and
complete_effect = { intelligence_alert_clear_flag_effect = yes }
for every level

if there already is a complete_effect, you just need to add the custom one to it.


intelligence_alert_scripted_trigger.txt
The second step is adjusting/rewriting the scripted trigger in common/scripted_triggers/intelligence_alert_scripted_trigger.txt

It triggers the display of the Alert
simplified it would look like this:

often you can simply copy the
available = {}
block from the intelligence_agency_upgrades.txt and if there is none, you just need a
NOT = { has_done_agency_upgrade = upgrade_name }

this is how it looks like in the basegame mod
Final Remarks
Thanks for reading my Guide,
if you have any additional questions regarding creating a submod please tell me in the comments.

Once you have created the submod, you can tell me and i will include it in the description of my mod.