• 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.

HoI4 Dev Diary - Modding Changes

Hello, and welcome back to another Dev Diary for No Step back and 1.11 Barbarossa. Today we will be pulling back the veil a bit and show you how modders can affect and use the new features coming in 1.11.

For those of you who do not get unreasonably excited by hearing about new script commands and changes to databases, the long and short of it is this: We made some fundamental changes to the way the game handles some things, which will probably require your favorite mods to spend some time updating. On the flip side, those changes also allow for some exciting possibilities down the line. If you came here hoping for a release date, we must ask you for just a little more patience. We promise the announcement is very close - but not today.

Characters

Probably the biggest change is in how we handle people on the backend (or ponies, for that matter - we do not discriminate). In the current live version, the game has no real concept of a person as a distinct thing. It only knows about country leaders, military leaders, political and military advisors, and operatives. Cases where a country leader could also be a general had to be handled manually, leading to lots of exciting bugs when the country leader was removed but the general was forgotten about and other such cases.

We have overhauled that side of the game from the ground up with the introduction of characters. This should dramatically reduce the amount of potential zombie generals shambling around, which I am sure the non-zombie population will greatly appreciate.

Characters are defined in the common/character folder, and their definitions look like this:

Screenshot_4.png


Every character is defined as a container for different roles they can fulfill, like General (corps_commander), Advisor, country leader etc. Due to technical concerns, Operatives remain their own thing. On the character level itself, things like name and gender are handled. This also means that character names can now be localised and you can refer to a character by ID instead of by name (this helps a lot with character names that have non-english characters in them - turns out this broke some triggers and effects).

Screenshot_5.png


This also means that if a character is removed from play - say, through a purge - they are automatically removed from all roles that they could have, which makes such systems a lot easier to do script-side. It also means that if we wanted to allow Zhukov to become a country leader, we could simply add a country leader role for him in the character file, like this:


Screenshot_6.png

Or we could also add the role later on, via focus, event, decision... like we do here with Beriya:


Screenshot_7.png

That means there is a lot less confusion and duplication of effort necessary when putting a character into a new role, since stuff like portraits, name etc. are already handled. A broken portrait only needs to be fixed in one place instead of five etc.

Once defined, characters are recruited in the country history file in order to be added to the game. As you can see in the first screenshot, you can use visible triggers for unit leaders to ensure they are not shown if you don’t want them to be.

Characters that can potentially become country leaders are made into country leaders using the promote_character effect, like so:

Screenshot_8.png


This is a clear departure from the practice in the live version of the game, where you would create a new country leader in that effect. The old script with create_country_leader and other such effects should still be working, but obviously you don’t get any of the advantages of the unified character system.

So let’s talk about some more things you can do with it!

You can set and check character flags for nefarious purposes:

Screenshot_9.png


You can change the traits of advisors without having to make a whole new advisor:


Screenshot_10.png

You can check if a character is a certain type of character:

Screenshot_11.png


You can save the character as a variable to refer to them later, such as spamming debug messages in the console!


Screenshot_12.png

Tank Designer

Next, let’s talk a bit about how the tank designer works on the backend. It shares a lot of concepts with the ship designer, such as modules and module slots. It does, however, work a little differently in some other, important aspects.

While the system pretends that there are only a handful of chassis (light, medium, heavy, super-heavy, amphibious, modern), this is not technically true. Instead, the system maintains a whole host of other, dynamically created chassis. This allows us to make sure that tank designs with the tank destroyer role actually go into tank destroyer battalions etc.

However, these dynamic chassis are still generated from the base chassis, so any changes to them will carry over.

The roles are enabled and disabled on individual modules:

Screenshot_13.png



Screenshot_14.png

For the unlock of new module categories, you can then use this on a module to unlock that category:

Screenshot_15.png


Railways

Railways function a little differently from other buildings. While they are technically province buildings like forts, they are in reality closer to a building that connects two provinces. A railway line is effectively a series of two-province connections, and the lowest one in the chain determines the level of the railroad connection between two supply hubs.

To make it easier to change and maintain the historical railway setup, we have added an option to draw railways into the nudger tool, which you can access by using the nudge command in the console.
Screenshot_16.png


The railway setup is in the supply menu in the nudger, and you can easily add new railway lines to the existing setup in this way. It took me about a week and a half to do the entire 1936 setup, including tracking down reference maps (with a lot of help from some of our testers).

If you want to add railways through script, you have the build_railway effect. It gives you a lot of options, with the most basic one being to lay out the path one province at a time:

Screenshot_17.png


This is obviously a little cumbersome for longer railways, especially if you don’t really care about the exact path. For that, you have the option to define a start and an end province:

Screenshot_18.png


The game will then automatically generate a path from one end to the other using advanced neural network-based self-learning algorithms that use blockchain (read: I have no idea how it works but this sounds impressive).

If finding the province is too much work, or if you want to be somewhat dynamic, you can even use start and end states (also note that you can specify what level of connection should be built):

Screenshot_19.png


Note that you can’t mix these, so you can’t define a starting province and a target state for example.

There are also corresponding triggers like can_build_railway and has_railway_connection:

Screenshot_20.png


The first checks if a railway can be built between two locations, while the other checks if one such connection already exists.

Finally, there is has_railway_level, which checks if the specified state has a railway line in it with the specified level:

Screenshot_21.png

Miscellaneous new effects, triggers, modifiers

In addition to the things described above, we have added a number of useful things that some of you might find useful:

  • Building_cost_factor: a new modifier that affects the construction cost of buildings. This takes the buildings from the 00_buildings file, so it should work with mods that add more buildings.
  • Core_state scope list, allowing you to run effects and triggers on a country’s core states:
Screenshot_22.png


  • Add_equipment_to_stockpile effect can now take a variant name to ensure that you add the right kind of equipment.
That’s all for today, I hope you enjoyed these little insights and we are all excited about what crazy things you will do with the new tools at your disposal.
 
  • 106Like
  • 23Love
  • 23
  • 10
  • 2
Reactions:
If you play both sides of a IgoUgo, there's, "no stopping, no waiting" It's like playing Avalon Hill/SPI board games in Tennessee all over again where you have to be your own opponent.
 
  • 3
  • 2Like
Reactions:
If you play both sides of a IgoUgo, there's, "no stopping, no waiting" It's like playing Avalon Hill/SPI board games in Tennessee all over again where you have to be your own opponent.
Solo wargames for the win! Literally - the upside was that you always won. The downside is that you always lost. o_O
 
  • 4
Reactions:
If you play both sides of a IgoUgo, there's, "no stopping, no waiting" It's like playing Avalon Hill/SPI board games in Tennessee all over again where you have to be your own opponent.
I'm assuming that's like playing them in North Dakota as your own opponent... Just not as cold and without as much snow
Solo wargames for the win! Literally - the upside was that you always won. The downside is that you always lost. o_O
My imaginary friend had a horrible record, like zero wins in 1000 tries
 
  • 4Haha
  • 1Love
Reactions:
Well we already know that there will be a mechanic added to promote any general of sufficient level to the high command and make them an advisor. So I don't think there will be any characters that can only be generals. There's been no indication of going the other way, though, and I'm not convinced it would make much sense within the paradigm they've indicated; it's one thing to go from a general with an array of stats and traits to an advisor with a single trait, going the other way just doesn't make sense. Also most advisors don't have corresponding large portraits and such portraits cannot be easily generated (whereas shrinking a general-sized portrait to advisor-size is relatively easy)
Makes sense, just hope pdx can do something about these characters who were historically generals but not represented as such.
 
Hello, and welcome back to another Dev Diary for No Step back and 1.11 Barbarossa. Today we will be pulling back the veil a bit and show you how modders can affect and use the new features coming in 1.11.

For those of you who do not get unreasonably excited by hearing about new script commands and changes to databases, the long and short of it is this: We made some fundamental changes to the way the game handles some things, which will probably require your favorite mods to spend some time updating. On the flip side, those changes also allow for some exciting possibilities down the line. If you came here hoping for a release date, we must ask you for just a little more patience. We promise the announcement is very close - but not today.

Characters

Probably the biggest change is in how we handle people on the backend (or ponies, for that matter - we do not discriminate). In the current live version, the game has no real concept of a person as a distinct thing. It only knows about country leaders, military leaders, political and military advisors, and operatives. Cases where a country leader could also be a general had to be handled manually, leading to lots of exciting bugs when the country leader was removed but the general was forgotten about and other such cases.

We have overhauled that side of the game from the ground up with the introduction of characters. This should dramatically reduce the amount of potential zombie generals shambling around, which I am sure the non-zombie population will greatly appreciate.

Characters are defined in the common/character folder, and their definitions look like this:

View attachment 766436

Every character is defined as a container for different roles they can fulfill, like General (corps_commander), Advisor, country leader etc. Due to technical concerns, Operatives remain their own thing. On the character level itself, things like name and gender are handled. This also means that character names can now be localised and you can refer to a character by ID instead of by name (this helps a lot with character names that have non-english characters in them - turns out this broke some triggers and effects).

View attachment 766437

This also means that if a character is removed from play - say, through a purge - they are automatically removed from all roles that they could have, which makes such systems a lot easier to do script-side. It also means that if we wanted to allow Zhukov to become a country leader, we could simply add a country leader role for him in the character file, like this:


View attachment 766438
Or we could also add the role later on, via focus, event, decision... like we do here with Beriya:


View attachment 766439
That means there is a lot less confusion and duplication of effort necessary when putting a character into a new role, since stuff like portraits, name etc. are already handled. A broken portrait only needs to be fixed in one place instead of five etc.

Once defined, characters are recruited in the country history file in order to be added to the game. As you can see in the first screenshot, you can use visible triggers for unit leaders to ensure they are not shown if you don’t want them to be.

Characters that can potentially become country leaders are made into country leaders using the promote_character effect, like so:

View attachment 766440

This is a clear departure from the practice in the live version of the game, where you would create a new country leader in that effect. The old script with create_country_leader and other such effects should still be working, but obviously you don’t get any of the advantages of the unified character system.

So let’s talk about some more things you can do with it!

You can set and check character flags for nefarious purposes:

View attachment 766441

You can change the traits of advisors without having to make a whole new advisor:


View attachment 766442
You can check if a character is a certain type of character:

View attachment 766443

You can save the character as a variable to refer to them later, such as spamming debug messages in the console!


View attachment 766444
Tank Designer

Next, let’s talk a bit about how the tank designer works on the backend. It shares a lot of concepts with the ship designer, such as modules and module slots. It does, however, work a little differently in some other, important aspects.

While the system pretends that there are only a handful of chassis (light, medium, heavy, super-heavy, amphibious, modern), this is not technically true. Instead, the system maintains a whole host of other, dynamically created chassis. This allows us to make sure that tank designs with the tank destroyer role actually go into tank destroyer battalions etc.

However, these dynamic chassis are still generated from the base chassis, so any changes to them will carry over.

The roles are enabled and disabled on individual modules:

View attachment 766445


View attachment 766446
For the unlock of new module categories, you can then use this on a module to unlock that category:

View attachment 766447

Railways

Railways function a little differently from other buildings. While they are technically province buildings like forts, they are in reality closer to a building that connects two provinces. A railway line is effectively a series of two-province connections, and the lowest one in the chain determines the level of the railroad connection between two supply hubs.

To make it easier to change and maintain the historical railway setup, we have added an option to draw railways into the nudger tool, which you can access by using the nudge command in the console.
View attachment 766451


The railway setup is in the supply menu in the nudger, and you can easily add new railway lines to the existing setup in this way. It took me about a week and a half to do the entire 1936 setup, including tracking down reference maps (with a lot of help from some of our testers).

If you want to add railways through script, you have the build_railway effect. It gives you a lot of options, with the most basic one being to lay out the path one province at a time:

View attachment 766452

This is obviously a little cumbersome for longer railways, especially if you don’t really care about the exact path. For that, you have the option to define a start and an end province:

View attachment 766453

The game will then automatically generate a path from one end to the other using advanced neural network-based self-learning algorithms that use blockchain (read: I have no idea how it works but this sounds impressive).

If finding the province is too much work, or if you want to be somewhat dynamic, you can even use start and end states (also note that you can specify what level of connection should be built):

View attachment 766454

Note that you can’t mix these, so you can’t define a starting province and a target state for example.

There are also corresponding triggers like can_build_railway and has_railway_connection:

View attachment 766455

The first checks if a railway can be built between two locations, while the other checks if one such connection already exists.

Finally, there is has_railway_level, which checks if the specified state has a railway line in it with the specified level:

View attachment 766456
Miscellaneous new effects, triggers, modifiers

In addition to the things described above, we have added a number of useful things that some of you might find useful:

  • Building_cost_factor: a new modifier that affects the construction cost of buildings. This takes the buildings from the 00_buildings file, so it should work with mods that add more buildings.
  • Core_state scope list, allowing you to run effects and triggers on a country’s core states:
View attachment 766458

  • Add_equipment_to_stockpile effect can now take a variant name to ensure that you add the right kind of equipment.
That’s all for today, I hope you enjoyed these little insights and we are all excited about what crazy things you will do with the new tools at your disposal.
has_truce_with = TAG would be really helpful.
 
  • 1
  • 1
Reactions:
Question for any Dev that can answer: with the tank designer being an NSB feature, how will tanks be treated for those without the DLC? Will it be exactly as now, or modified with the new tech arrangements in mind?
 
  • 1Like
Reactions:
Question for any Dev that can answer: with the tank designer being an NSB feature, how will tanks be treated for those without the DLC? Will it be exactly as now, or modified with the new tech arrangements in mind?
Not a dev but iirc the ship designer works for those without MtG the same as it did before MtG came out. I imagine the tank designer working in a similar fashion.
 
  • 2
Reactions:
Not a dev but iirc the ship designer works for those without MtG the same as it did before MtG came out. I imagine the tank designer working in a similar fashion.
Thanks - yes, I know the ship designer works this way (because I have to change some ship files to tweak carrier 'plane loads), but I wanted to check that the tank situation is the same. The tank techs have changed quite noticeably (judging by the tutorial video screens), so it might be slightly tricky.
 
  • 1
Reactions:
Since the new update, I got some problems with state modding, everytime i try to add a state, which used to work fine, the game crashes at startup, saying that there is something wrong with the map (I didn't change anything on the map). Does someone know what could be the problem, or just send an updated checklist?
 
Since the new update, I got some problems with state modding, everytime i try to add a state, which used to work fine, the game crashes at startup, saying that there is something wrong with the map (I didn't change anything on the map). Does someone know what could be the problem, or just send an updated checklist?
If you add any states you will need to update the buildings for states on the map (I use the nudger, which makes it easy) - have you done that? Some states have been added to vanilla, which means that the numbering of added states has to change - have you done that? This also means that the localisation of state names has to be updated - have you done that? If you have done all of these, maybe you can give more detail about what you are trying to do?
 
  • 1
Reactions:
If you add any states you will need to update the buildings for states on the map (I use the nudger, which makes it easy) - have you done that? Some states have been added to vanilla, which means that the numbering of added states has to change - have you done that? This also means that the localisation of state names has to be updated - have you done that? If you have done all of these, maybe you can give more detail about what you are trying to do?
I used the nudge, in the new update so all these three things should have been done automatically. I tried to add a state between Finland and Karelia, just south of Saala. I added the provinces and buildings in the nudger and did stuff like manpower, history and catagory via the file. After that I copied the files from the C:/...../Documents/Paradox Interactive/Hoi4 to the steam files (I didn't use mods). And then deleted the orginal files in the C:/...../Documents/Paradox Interactive/Hoi4. So it should work but it doesn't.
 
  • 1
Reactions:
I used the nudge, in the new update so all these three things should have been done automatically. I tried to add a state between Finland and Karelia, just south of Saala. I added the provinces and buildings in the nudger and did stuff like manpower, history and catagory via the file. After that I copied the files from the C:/...../Documents/Paradox Interactive/Hoi4 to the steam files (I didn't use mods). And then deleted the orginal files in the C:/...../Documents/Paradox Interactive/Hoi4. So it should work but it doesn't.
There has been a recent update to switch to 1.11.4 (and an update of the 1.11.5 beta, if you're using that), so files in the actual Steam folder may well get overwritten; in general I would recommend using the mod folder (and setting it up as a mod) rather than making any changes in the Steam folders.
 
  • 3
Reactions:
Hello, and welcome back to another Dev Diary for No Step back and 1.11 Barbarossa. Today we will be pulling back the veil a bit and show you how modders can affect and use the new features coming in 1.11.

For those of you who do not get unreasonably excited by hearing about new script commands and changes to databases, the long and short of it is this: We made some fundamental changes to the way the game handles some things, which will probably require your favorite mods to spend some time updating. On the flip side, those changes also allow for some exciting possibilities down the line. If you came here hoping for a release date, we must ask you for just a little more patience. We promise the announcement is very close - but not today.

Characters

Probably the biggest change is in how we handle people on the backend (or ponies, for that matter - we do not discriminate). In the current live version, the game has no real concept of a person as a distinct thing. It only knows about country leaders, military leaders, political and military advisors, and operatives. Cases where a country leader could also be a general had to be handled manually, leading to lots of exciting bugs when the country leader was removed but the general was forgotten about and other such cases.

We have overhauled that side of the game from the ground up with the introduction of characters. This should dramatically reduce the amount of potential zombie generals shambling around, which I am sure the non-zombie population will greatly appreciate.

Characters are defined in the common/character folder, and their definitions look like this:

View attachment 766436

Every character is defined as a container for different roles they can fulfill, like General (corps_commander), Advisor, country leader etc. Due to technical concerns, Operatives remain their own thing. On the character level itself, things like name and gender are handled. This also means that character names can now be localised and you can refer to a character by ID instead of by name (this helps a lot with character names that have non-english characters in them - turns out this broke some triggers and effects).

View attachment 766437

This also means that if a character is removed from play - say, through a purge - they are automatically removed from all roles that they could have, which makes such systems a lot easier to do script-side. It also means that if we wanted to allow Zhukov to become a country leader, we could simply add a country leader role for him in the character file, like this:


View attachment 766438
Or we could also add the role later on, via focus, event, decision... like we do here with Beriya:


View attachment 766439
That means there is a lot less confusion and duplication of effort necessary when putting a character into a new role, since stuff like portraits, name etc. are already handled. A broken portrait only needs to be fixed in one place instead of five etc.

Once defined, characters are recruited in the country history file in order to be added to the game. As you can see in the first screenshot, you can use visible triggers for unit leaders to ensure they are not shown if you don’t want them to be.

Characters that can potentially become country leaders are made into country leaders using the promote_character effect, like so:

View attachment 766440

This is a clear departure from the practice in the live version of the game, where you would create a new country leader in that effect. The old script with create_country_leader and other such effects should still be working, but obviously you don’t get any of the advantages of the unified character system.

So let’s talk about some more things you can do with it!

You can set and check character flags for nefarious purposes:

View attachment 766441

You can change the traits of advisors without having to make a whole new advisor:


View attachment 766442
You can check if a character is a certain type of character:

View attachment 766443

You can save the character as a variable to refer to them later, such as spamming debug messages in the console!


View attachment 766444
Tank Designer

Next, let’s talk a bit about how the tank designer works on the backend. It shares a lot of concepts with the ship designer, such as modules and module slots. It does, however, work a little differently in some other, important aspects.

While the system pretends that there are only a handful of chassis (light, medium, heavy, super-heavy, amphibious, modern), this is not technically true. Instead, the system maintains a whole host of other, dynamically created chassis. This allows us to make sure that tank designs with the tank destroyer role actually go into tank destroyer battalions etc.

However, these dynamic chassis are still generated from the base chassis, so any changes to them will carry over.

The roles are enabled and disabled on individual modules:

View attachment 766445


View attachment 766446
For the unlock of new module categories, you can then use this on a module to unlock that category:

View attachment 766447

Railways

Railways function a little differently from other buildings. While they are technically province buildings like forts, they are in reality closer to a building that connects two provinces. A railway line is effectively a series of two-province connections, and the lowest one in the chain determines the level of the railroad connection between two supply hubs.

To make it easier to change and maintain the historical railway setup, we have added an option to draw railways into the nudger tool, which you can access by using the nudge command in the console.
View attachment 766451


The railway setup is in the supply menu in the nudger, and you can easily add new railway lines to the existing setup in this way. It took me about a week and a half to do the entire 1936 setup, including tracking down reference maps (with a lot of help from some of our testers).

If you want to add railways through script, you have the build_railway effect. It gives you a lot of options, with the most basic one being to lay out the path one province at a time:

View attachment 766452

This is obviously a little cumbersome for longer railways, especially if you don’t really care about the exact path. For that, you have the option to define a start and an end province:

View attachment 766453

The game will then automatically generate a path from one end to the other using advanced neural network-based self-learning algorithms that use blockchain (read: I have no idea how it works but this sounds impressive).

If finding the province is too much work, or if you want to be somewhat dynamic, you can even use start and end states (also note that you can specify what level of connection should be built):

View attachment 766454

Note that you can’t mix these, so you can’t define a starting province and a target state for example.

There are also corresponding triggers like can_build_railway and has_railway_connection:

View attachment 766455

The first checks if a railway can be built between two locations, while the other checks if one such connection already exists.

Finally, there is has_railway_level, which checks if the specified state has a railway line in it with the specified level:

View attachment 766456
Miscellaneous new effects, triggers, modifiers

In addition to the things described above, we have added a number of useful things that some of you might find useful:

  • Building_cost_factor: a new modifier that affects the construction cost of buildings. This takes the buildings from the 00_buildings file, so it should work with mods that add more buildings.
  • Core_state scope list, allowing you to run effects and triggers on a country’s core states:
View attachment 766458

  • Add_equipment_to_stockpile effect can now take a variant name to ensure that you add the right kind of equipment.
That’s all for today, I hope you enjoyed these little insights and we are all excited about what crazy things you will do with the new tools at your disposal.
Hello I need your help,
I want to add an équivalent of the actual railway to make for exemple a parallel road system or pipeline so a system who link two point on the map but actually that do the fortifications system.
Thank to answer.
 
Hello I need your help,
I want to add an équivalent of the actual railway to make for exemple a parallel road system or pipeline so a system who link two point on the map but actually that do the fortifications system.
Thank to answer.
A: You're necroing a 2.5 year old thread. Don't do that.
B: That is not possible as far as I can tell, as railways are a hardcoded mechanic.