Darkest Hour - Dev Diary #14 - Modding with Darkest Hour Part 4

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

^_AC_^

Field Marshal
86 Badges
Feb 24, 2009
5.725
396
  • Victoria 2: A House Divided
  • Sengoku
  • Semper Fi
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Magicka
  • Leviathan: Warships
  • Knights of Pen and Paper +1 Edition
  • Victoria 2: Heart of Darkness
  • War of the Roses
  • Hearts of Iron IV Sign-up
  • Europa Universalis III Complete
  • The Showdown Effect
  • Warlock 2: The Exiled
  • Crusader Kings II: Conclave
  • 500k Club
  • Stellaris
  • Europa Universalis IV: El Dorado
  • Imperator: Rome Deluxe Edition
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Imperator: Rome
  • Europa Universalis IV: Common Sense
  • Stellaris: Ancient Relics
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Cossacks
  • Hearts of Iron IV: Cadet
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Cities: Skylines - Green Cities
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Dharma
  • Stellaris Sign-up
  • Stellaris: Megacorp
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Golden Century
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Holy Fury




First of all, today we're going to talk a bit more about syntax and rules for decisions, as many fans expressed their interest in this subject.

As we've already discussed in Dev Diary 12, on the left side of the screen we introduced a new list which contains the available decisions that the player can evaluate and eventually take. From the point of view of the code, a decision is a normal event with two new sections:
- decision = { ... insert normal triggers here ... } : if these triggers are fulfilled the decision appears in the decision list for the human player;
- decision_trigger = { ... insert normal triggers here ... } : if these triggers are fulfilled the decision can be taken by the human player;
When the decision is taken, it fires as a normal event and can always be canceled. In the latter case the event isn't registered as fired and the decision remains active in the decision list and can be taken again at a later date (if the conditions in the decision_trigger section remain fulfilled). Please beware that for AI nations decisions are treated as events, this means that only the usual trigger = { ... } section is checked! This means that all three sections (decision = {...}, decision_trigger = {...} and trigger = {...} ) must be correctly compiled to make the decision work. Moreover, the decisions appear and can be taken only during the chosen date-deathdate interval, so that part of the code must always be compiled too!

Here are more technical informations on decisions:
- there is a new modifier in misc.txt (“mod” section) to enable or disable decisions: #Enable decisions for players. 0 - Disabled, 1 – Enabled ;
- decisions are hidden until all triggers in decision = { } section are fulfilled;
- decisions become available for selection when all triggers in decision_trigger = { } section are fulfilled;
- once selected, the decision fires as regular events via standard event window with all the usual information and actions on it plus the possibility to cancel the decision;
- decisions are logged in event history as regular events;
- the decisions list is populated on game start and updated daily;
- usually the tooltip on the decision displays the description of the event, but optionally it is possible to insert a specific text: decision_desc = "....";
- a new kind of pictures is introduced, to be used in the decision list: decision_picture = "picture_name.bmp" (if none if chosen, a generic picture is loaded by default - gfx\event_pics\decisions_empty.bmp);

Another important change introduced by Darkest Hour is the export of the effects of policy slider to a new file, db\policy_effects.csv.
This file allows complete control over the effect of policy sliders and is a very powerful tool. Here's a list of the possible effects that are associated to slider position:
Code:
CAN_ALLY_WHILE_AT_PEACE
CAN_ADD_CLAIMS_TO_NEUTRALS
CAN_DEMAND_CLAIMS
CAN_BREAK_NAP
CAN_GUARANTEE
MODIFIER_ORG
MODIFIER_GEARING_BONUS
MODIFIER_CG_DEMAND
MODIFIER_DISSENT_SPEED
MODIFIER_UPGRADE_COST
MODIFIER_UPGRADE_TIME
MODIFIER_TECH_TEAM_SALARIES
MODIFIER_RESEARCH_TIME
MODIFIER_PARTISAN_RISK
MODIFIER_DOW_DISSENT_COST
MODIFIER_TOTAL_IC
MODIFIER_CG_TO_MONEY
MODIFIER_RESOURCE_PROD
MODIFIER_PRODUCTION_TIME
MODIFIER_PRODUCTION_COST
MODIFIER_NATIONAL_DISSENT
MODIFIER_OCCUPIED_DISSENT
MODIFIER_COUNTER_INTEL - used for units detection
MODIFIER_MP_EXPERIENCE
MODIFIER_MP_GROWTH
MODIFIER_DIPLO_COST
MODIFIER_INTEL_COST
MODIFIER_INTEL_MAINTENANCE
MODIFIER_REL_NORMALIZATION: applied each 6th day
MODIFIER_STOCKPILES
MODIFIER_USE_BELLIGERENCE_FOR_DOW
MODIFIER_BELLIGERENCE_DOW
MODIFIER_RELATIONSHIPS_DOW
MODIFIER_COUNTERINTELLIGENCE - added to home intell
MODIFIER_INTELLIGENCE - used as extra spy level in distance calcs
This allows the modders to customize the policy slider. We might talk about what we've done to one on these slider in another Diary. ;)

To close this DD, let's review other changes related to modding that we introduced:
- Enabled unlimited unit models (was fixed to 10). To use just add a new model = {….} entry in the respective txt file in “units” folder. As a bonus this change will decrease loading time and memory usage for unit types that use less then 10 models.
– Added new (optional) parameter for units: max allowed brigades. This overrides default hard-coded values. Add to division files in “\db\units\divisions”. Format: max_allowed_brigades = X. Currently it is allowed to have up to 5 brigades for naval units and up to 1 brigade for land and air units.
- new country IC modifier - wartime_ic_mod. Works like peacetime_ic_mod, but when at war;
- new adjustable reaction of puppets when not-allied master is at war: puppets with neutrality 150+ (set in misc.txt ) that are not allied to their master will not join automatically master’s wars anymore
Code:
* Puppets should join Master's war if AI Neutrality is equal or greater then THIS. Note: this works only if puppet is not part of
Master's alliance! 0 = always join Master's wars 150 #0
- new modifiers in misc.txt (“mod” section) to handle the spawning of rebel units:
Code:
* Rebels army composition - chance for infantry over militia. 0 - only militia, 100 - only infantry, 50 - 50%/50% and so on.
* Rebels army tech level (based on the available model in the country that controls the province). -1 - Only model 1, 0 - Only
the Latest model, else random model in the range from (latest model - THIS) to (latest model).
– Allowed (optional) unique province capital/city icons. Gfx\map\city_PROVID.bmp (city_55.bmp for Paris and so on).
– Added optional fonts support for each language. Fonts are expected to be found in \gfx\fonts\X folder where X is the language set in settings.cfg (0 – ENG … 5- Polish). If not found in numbered folder fonts are read from fonts default location (\gfx\fonts\).
- All minister modifiers are moved to a moddable file (db\ministers\minister_personalities.txt). Moddable effects:
Code:
* Leader skill
* Research time – per tech or for all
* Research cost – per tech or for all
* Resource production bonuses – oil, energy, metal, rare materials, money
* Production bonuses – foreign IC, national IC, reinforce, upgrade, consumer goods, supplies
* Units – build time, build cost, attack bonus, defense bonus, morale (org. regain), organization
* Brigades - build time, build cost, attack bonus, defense bonus, morale (org. regain), organization
* Land unit speed
* Belligerence – required for DoW, wartime and peacetime 
* Transport capacity modifier
* Provincial buildings (IC, coastal and land forts, flak, infrastructure, air and naval bases, radar stations, nuclear
reactors and rocket test sites) time and cost 
* Detection – naval, land and convoy
* Dissent
* Manpower growth – total and non-national
* Supply consumption
* Spying networks bonus – intelligence (home) and counterintelligence (foreign). Limited up to 5% each!
* Intelligence reports accuracy – land/air units, navy/convoys and production/research. Values from -10 to 10
* Diplomatic action chances – trade (used also for trade agreements), alliance (offer, join and bring), non-aggression pact, demand territory, ask for military access, sue for peace (insist on demands, white and beg for peace), assume military
control and influence
* Diplomatic action chances extra modifiers – weak target (Total IC is less then ½), same alignment, opposite alignment,
democracies, dictatorships, close government type (difference +/- 2)
* Diplomatic action cost for each action. The final value can be no less then 0.0
* Diplomatic action cost extra modifiers – weak target (Total IC is less then ½), same alignment, opposite alignment, democracies, dictatorships, close government type (difference +/- 2), national (actions against us: cost modifier = 1 +  Sender’s modifier + Target’s modifier).
* Convoy transports and escorts build time and cost (using transport ships and destroyers modifiers)
* Intelligence mission cost for each mission – 2 modifiers: for sender and for target (Final cost modifier for a mission = 1 +
Sender’s cost modifier + Target’s defense cost modifier). The final value can be no less then 0.0
* Intelligence funding and maintenance cost modifiers
* Intelligence mission chances for each mission – 2 modifiers: for sender and for target (Summary chance for a mission = Sender’s modifier + Target’s defense modifier)
* Stockpile - modifiers on stockpiles limit: which = industry / supplies (used for oil too) / all (default); when = war / peace / all (default); value = x.xxxx

See you next week! :)

 
Last edited by a moderator:
– Added new (optional) parameter for units: max allowed brigades. This overrides default hard-coded values. Add to division files in “\db\units\divisions”. Format: max_allowed_brigades = X. Currently it is allowed to have up to 5 brigades for naval units and up to 1 brigade for land and air units.

Hund-freu.jpg

no words :):):):):)
 
More modding ability is always fun, sure, but are you guys sure you're not actually focusing too much on it instead of adding new features to the game and improving old ones? For a long time now, diary after diary, it only talks about moddability..
 
More modding ability is always fun, sure, but are you guys sure you're not actually focusing too much on it instead of adding new features to the game and improving old ones? For a long time now, diary after diary, it only talks about moddability..
It's supposedly a game that will be updated and improved for years to come, so I wouldn't worry too much about that. However, I hope that we will hear more about the actual Vanilla gameplay in future DDs.
 
It's supposedly a game that will be updated and improved for years to come, so I wouldn't worry too much about that. However, I hope that we will hear more about the actual Vanilla gameplay in future DDs.

Yes, DD 16 will deal with our innovative mobilization/manpower system for instance. :)
These are just an introduction to how to mod DH and how we actually "modded" it in "DH Full".
 
Yes, DD 16 will deal with our innovative mobilization/manpower system for instance. :)
These are just an introduction to how to mod DH and how we actually "modded" it in "DH Full".

Good.

When are we learning more about the production tab and the sliders, though?
 
this has nothing to do with the dd, but how did you get those nice colors in notepad++?
I created my own syntax for HOI2 files (one for events and one for CSVs like ministers and tech teams). I've attached it to this post if you need it.
 

Attachments

  • userDefineLang.zip
    3,1 KB · Views: 228
  • 1
Reactions:
– Added new (optional) parameter for units: max allowed brigades. This overrides default hard-coded values. Add to division files in “\db\units\divisions”. Format: max_allowed_brigades = X. Currently it is allowed to have up to 5 brigades for naval units and up to 1 brigade for land and air units.

LOVELY!!!
thanks for adding my wish :)
 
To close this DD, let's review other changes related to modding that we introduced:
- Enabled unlimited unit models (was fixed to 10). To use just add a new model = {….} entry in the respective txt file in “units” folder. As a bonus this change will decrease loading time and memory usage for unit types that use less then 10 models.
– Added new (optional) parameter for units: max allowed brigades. This overrides default hard-coded values. Add to division files in “\db\units\divisions”. Format: max_allowed_brigades = X. Currently it is allowed to have up to 5 brigades for naval units and up to 1 brigade for land and air units.

I must be dreaming. This is gonna be the most awesome hoi-game.
Btw, is it possible to make some kind of hoi3 brigade constructor since there is max allowed brigades?
 
This is like a foreign language to me, but im not a modder. Im guessing it must be awesome.
 
I must be dreaming. This is gonna be the most awesome hoi-game.
Btw, is it possible to make some kind of hoi3 brigade constructor since there is max allowed brigades?
Yeah, I thought about the same thing. This could somehow emulate HoI3 division composition and provide awesome possibilities/historical accuracy :)
Is it going to be possible adding twice the same brigade to division ?