HOI4 Dev Diary - Getting started with modding

  • 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.
Would it be possible to see some more of the modding hope crusher.

I myself am primarily concerned about my own thingy (remove units by event) but I'm certain other people would like to know too whether their request is impossible or
may-happen-in-the-future-but-no-guarantees
 
  • 2
  • 1
Reactions:
Is this diary about "fix all bugs with you own hands" ?
I suggest you actually understand what you are talking about before you offer up something that isn't even close to reality.
 
  • 11
Reactions:
I myself am primarily concerned about my own thingy (remove units by event) but I'm certain other people would like to know too whether their request is impossible or
may-happen-in-the-future-but-no-guarantees
I & I know a few other modders really want this & to change a division's template by event.
 
  • 3
Reactions:
Is this diary about "fix all bugs with you own hands" ?

welcome to the forums, neeeh, i believe the hearts of iron team are currently all hands on deck to improve game and fix bugs pointed out by the community if you check a couple of dev diary back.
 
Last edited:
How do I start the game in -debug?

In steam right click on hearts of iron 4 and go to properties. Click on set launch options and enter -debug into the box.
 
  • 1
Reactions:
OOh nice to see ability to create and use flags to help trigger events, one of the great things we had back in the old engine days.
 
  • 3
Reactions:
Hi everyone,
As @podcat mentioned in last weeks diary he would attempt to trick into writing a little something about modding. It didn’t work, I wanted to do it all along, hah! This week I will talk a bit about how to get into modding and how we work with requests from modders. Next week I will go into some of the new stuff modders can expect in 1.3.3.

Getting into modding can seem like a pretty daunting task and we’ve received some questions about how to get started. A good first step is going to the User Mods forum and take a look at the Useful threads/information for modders. and the wiki. The Hearts of Iron Modding Discussion subreddit is another good place to find resources.
Ask others in the Modding - Quick Questions thread. It’s a great place to ask specific questions once you’ve gone through some of the tutorials. If no one else can help, I might even show up to answer a few questions.

Starting the game with the -debug enabled gives you access to the console, where you can write trigger_docs. This will print a list of possible trigger and effect with some sparse (programmer made) documentation to the game.log. Sometimes you can find things here that have not yet been documented on the wiki. From there, it all depends on what you want to achieve.
Another useful launch option is start_tag=GER, which loads up the game as the specified tag, skipping launcher and country selector.

Starting in debug mode also enables the glorious error dog, who will show up and bark your mistakes at you, like a mad drill sergeant. The dog is your friend, do as it says and strive to fix all your mistakes before committing your mod to steam. Start from the top and work your way down. Here I’ve done something horribly wrong in the Centre state file, so I CTRL+ALT+Right-Click, open the file and fix my mistake.
View attachment 233058

Once you’ve gotten into it a bit you will most likely stumble across issues that cannot be solved with the current script features. This is where I come in… maybe! Go to the wishlist thread see if there is already a request for what you are trying to attempt and if there isn’t, make a post describing what you want to achieve. Most of the things in this thread end up in the document below, aptly named by @podcat. We then go over the requests with the tech lead and decide what is possible to do. A lot of the requests we have gotten are for new triggers, basic effects, which is great. Other are basically new features, major core system changes or UI rework on a scale that is not modding, but making a new game.
View attachment 233062

A request could be:
‘I need a trigger for army experience’ (I can’t believe we don’t have this.).
‘I want to set state names with an effect’
‘I want the dynamic script flags EU4 has’
Etc etc.

Some will be implemented. Some will be rejected based on technical limitations. Some may even be planned for a future feature, in which case it really is worth waiting for the proper implementation by a team of programmers instead of just me.

Some of the recent additions include:
Code:
-Added console command: set_ruling_party <ideology group> - ideology group has shortcuts d f n c for vanilla HOI groups
-Added console command: add_party_popularity <ideology group> <value> - ideology group has shortcuts d f n c for vanilla HOI groups
-Added trigger has_full_control_of_state
-Added has_army_experience has_air_experience has_navy_experience triggers
-Dynamic state, country and global flags effect. set_global_flag = test_flag_@ROOT
-Added triggers for date days and value to flags
-Added modify_global_flag modify_country_flag modify_state_flag effects. Clearing script flags now removed them completely instead of setting value to zero
-Added timed script flags.

Exampletime:
You want to make a series of events where the German scientists goes celebrating after the fall of France.
Code:
set_country_flag = { flag = GER_drunk_scientists days = 120 value = 1 }
This sets a flag with the value of 1 that disappears after 120 days.

You can then use the flag as a trigger for a national focus that gives you something like the Bob Semple, or what else your drunken scientists would come up with.
Code:
modify_country_flag = { flag = GER_drunk_scientists value = 1 }
will change the country flag to 2, which you can then use to trigger something else. You can also see how long a flag has been set for and what date it was last set or modified.

You probably want to make you own tooltip though, since flags don’t generate proper tooltips at the moment. Proper tooltips for them might be a future request =)
Code:
custom_trigger_tooltip = {
    tooltip = GER_drunk_scientists_tooltip
    has_country_flag = GER_drunk_scientists
}

Hope this gives you an idea of how to get started and encourages more people to start modding Hearts of Iron.

Next week I will talk in detail about the new modding features that will be available in 1.3.3.

@podcat : Since people are probably curious about a little update from the rest of the team, we have been working on some optimizations to speed up late game a bit. Also don't forget to tune in at 16:00CET on www.twitch.tv/paradoxinteractive today where me and Daniel will be checking out the Kaiserreich mod in our series of mod highlights in World War Wednesday!

Is it possible for you guys to separate aircraft missions from aircraft types?
 
  • 1
Reactions:
Hi everyone,
As @podcat mentioned in last weeks diary he would attempt to trick into writing a little something about modding. It didn’t work, I wanted to do it all along, hah! This week I will talk a bit about how to get into modding and how we work with requests from modders. Next week I will go into some of the new stuff modders can expect in 1.3.3.

Getting into modding can seem like a pretty daunting task and we’ve received some questions about how to get started. A good first step is going to the User Mods forum and take a look at the Useful threads/information for modders. and the wiki. The Hearts of Iron Modding Discussion subreddit is another good place to find resources.
Ask others in the Modding - Quick Questions thread. It’s a great place to ask specific questions once you’ve gone through some of the tutorials. If no one else can help, I might even show up to answer a few questions.

Starting the game with the -debug enabled gives you access to the console, where you can write trigger_docs. This will print a list of possible trigger and effect with some sparse (programmer made) documentation to the game.log. Sometimes you can find things here that have not yet been documented on the wiki. From there, it all depends on what you want to achieve.
Another useful launch option is start_tag=GER, which loads up the game as the specified tag, skipping launcher and country selector.

Starting in debug mode also enables the glorious error dog, who will show up and bark your mistakes at you, like a mad drill sergeant. The dog is your friend, do as it says and strive to fix all your mistakes before committing your mod to steam. Start from the top and work your way down. Here I’ve done something horribly wrong in the Centre state file, so I CTRL+ALT+Right-Click, open the file and fix my mistake.
View attachment 233058

Once you’ve gotten into it a bit you will most likely stumble across issues that cannot be solved with the current script features. This is where I come in… maybe! Go to the wishlist thread see if there is already a request for what you are trying to attempt and if there isn’t, make a post describing what you want to achieve. Most of the things in this thread end up in the document below, aptly named by @podcat. We then go over the requests with the tech lead and decide what is possible to do. A lot of the requests we have gotten are for new triggers, basic effects, which is great. Other are basically new features, major core system changes or UI rework on a scale that is not modding, but making a new game.
View attachment 233062

A request could be:
‘I need a trigger for army experience’ (I can’t believe we don’t have this.).
‘I want to set state names with an effect’
‘I want the dynamic script flags EU4 has’
Etc etc.

Some will be implemented. Some will be rejected based on technical limitations. Some may even be planned for a future feature, in which case it really is worth waiting for the proper implementation by a team of programmers instead of just me.

Some of the recent additions include:
Code:
-Added console command: set_ruling_party <ideology group> - ideology group has shortcuts d f n c for vanilla HOI groups
-Added console command: add_party_popularity <ideology group> <value> - ideology group has shortcuts d f n c for vanilla HOI groups
-Added trigger has_full_control_of_state
-Added has_army_experience has_air_experience has_navy_experience triggers
-Dynamic state, country and global flags effect. set_global_flag = test_flag_@ROOT
-Added triggers for date days and value to flags
-Added modify_global_flag modify_country_flag modify_state_flag effects. Clearing script flags now removed them completely instead of setting value to zero
-Added timed script flags.

Exampletime:
You want to make a series of events where the German scientists goes celebrating after the fall of France.
Code:
set_country_flag = { flag = GER_drunk_scientists days = 120 value = 1 }
This sets a flag with the value of 1 that disappears after 120 days.

You can then use the flag as a trigger for a national focus that gives you something like the Bob Semple, or what else your drunken scientists would come up with.
Code:
modify_country_flag = { flag = GER_drunk_scientists value = 1 }
will change the country flag to 2, which you can then use to trigger something else. You can also see how long a flag has been set for and what date it was last set or modified.

You probably want to make you own tooltip though, since flags don’t generate proper tooltips at the moment. Proper tooltips for them might be a future request =)
Code:
custom_trigger_tooltip = {
    tooltip = GER_drunk_scientists_tooltip
    has_country_flag = GER_drunk_scientists
}

Hope this gives you an idea of how to get started and encourages more people to start modding Hearts of Iron.

Next week I will talk in detail about the new modding features that will be available in 1.3.3.

@podcat : Since people are probably curious about a little update from the rest of the team, we have been working on some optimizations to speed up late game a bit. Also don't forget to tune in at 16:00CET on www.twitch.tv/paradoxinteractive today where me and Daniel will be checking out the Kaiserreich mod in our series of mod highlights in World War Wednesday!

Hello, the only thing I'd like to say is that in general, adding ship subcomponents and plane subcomponents is -not- a different game. It may be hard to do, but if someone pulls it off that very feature would enhance the game tremendously. The game is so great, so is HOI3, because the makers care about complexity. But for all of the field marshall system in place that is great, the same thought needs to be applied to the ships and planes. The navy and airforce are not an afterthought, and I do believe they deserved thier own field marshall like system. A part of me as well misses the chain of command system in Hoi3, though that I don't expect to come back.
The reason though I speak about the field marshall system is it is already there. Couldn't leaders be assigned to a new plane system, and navy, and thus use the code that is already there to make a new game system, in effect. On top of that, at least in Black Ice, there are all of those logistical things like support equipment tied to the field marshall system. It would just have to be converted to an air leader or naval leader.
 
Last edited:
  • 1
Reactions:
Unfortunately no. It's one of those things that seem really simple on the surface, but just isn't doable without redoing everything.
Oh well.

Thanks for the reply.