Division modding

From Hearts of Iron 4 Wiki
Jump to navigation Jump to search

Units are the foundations of Hearts of Iron, and can be broken down into Air Wings, Divisions and Naval Task Forces.

What is an OOB?

An OOB, or Order of Battle, is what the game uses in order to load units and create starting production. It can be found in /Hearts of Iron IV/history/units. In order for the game to load the oob, you must add oob = "" to your countries history file found in /Hearts of Iron IV/history/countries. The quote must be the same as the file name, so for example oob = "ENG_1936" would load the UK's 1936 units. The set_naval_oob = "" effect is used to set the naval oob, so set_naval_oob = "ENG_1936_Naval" would load the Britsh Man the Guns navy.

Creating an OOB for Divisions

Division Templates

division_template = {
    name = "Infantry Division"
    divisions_name_group = BHU_INF_01

    regiments = {
        infantry = { x = 0 y = 0 }
        infantry = { x = 0 y = 1 }
    }

    support = {
        engineer = { x = 0 y = 0 }
    }
}
  • Division Template is the command to create a new division template.
  • Divisions Name Group sets a name group. More on Namelist wiki article.
  • Name sets the template name, as seen in the Recruit and Deploy menu.
  • Regiments is what the division comprises of.
  • Support is the support companies the unit comes with.

Divisions

units = {
    division = {
        division_name = {
            is_name_ordered = yes
            name_order = 1
        }

        location = 10980
        division_template = "Infantry Division"
        start_experience_factor = 0.1
        start_equipment_factor = 0.5
    }
}
  • Units is the command that allows you to create navies and divisions.
  • Division is the command that creates a new division.
  • Division Name Can either be named in this file, or use the name list. To set the name in the file do name = "Division Name Here".
  • Location is the province where the division spawns.
  • Division Template is the command that sets what template the division uses.
  • Start Experience Factor is the command that sets how experienced a division is when it is spawned. Optional.
  • Start Equipment Factor is the command that sets how much equipment a division has when it is spawned. Optional.

Adding Air Wings

air_wings = {
    500 = {
        fighter_equipment_0 = {
            owner = "BRA"
            amount = 10
        }
    }
}
  • Air Wings is the command that creates the air wing.
  • 500 is the state where the air wing spawns. The state should have an air base set there.
  • fighter_equipment_0 is the type of aircraft that is in the air wing.
  • Owner is who created the type of aircraft. Does not need to be the country you are making the file for.
  • Amount is how many of that type of equipment is in that air wing.

Adding Navies

Man the Guns

units = {
    fleet = {
        name = "Fleet De Custom" # Name 1
        naval_base = 10980
        task_force = {
            name = "Fleet De Custom" # Name 2
            location = 10980
            ship = {
                name = "NRB Minas Gerasis" # Name 3
                pride_of_the_fleet = yes
                definition = battleship
                equipment = { 
                    ship_hull_heavy_1 = {
                        amount = 1
                        owner = BRA
                        version_name = "Minas Geras Class"
                    }
                }
            }
        }

        task_force = {
            name = "Fleet De Submarine" # Name 1
            location = 10980
            ship = {
                name = "NRB Humayta" # Name 2
                definition = submarine
                equipment = {
                    ship_hull_submarine_2 = {
                        amount = 1
                        owner = BRA
                        version_name = "Humayta Class"
                    }
                }
            }
        }
    }
}
  • Fleet begins a new fleet which can comprise of multiple task forces.
  • Name 1 is the name of the fleet.
  • Naval Base is the location of where the fleet is headquartered.
  • Name 2 is the name of the task force.
  • Location is where the task force spawns.
  • Ship creates a new ship within the task force.
  • Pride Of The Fleet designates a ship as the pride of the fleet. Only one ship can be the Pride Of The Fleet at a time. Optional.
  • Definition sets what type of ship it is.
  • Equipment sets what level of equipment the ship uses.
  • Amount is how much of that equipment the ship uses. Should be kept at one.
  • Owner is who created the equipment the ship uses.
  • Version Name is for custom classes of ship. Optional


Non-Man The Guns

The only main difference between this section and the Man The Guns section is the equipment.

units = {
    fleet = {
        name = "Armada Argentina"
        naval_base = 12364
        task_force = {
            name = "Armada Argentina"
            location = 12364
            ship = {
                name = "ARA Rivadavia"
                definition = battleship
                equipment = {
                    battleship_1 = {
                        amount = 1
                        owner = ARG
                        version_name = "Rivadavia Class"
                    }
                }
            }
        }
    }
}
  • Fleet begins a new fleet which can comprise of multiple task forces.
  • Name 1 is the name of the fleet.
  • Naval Base is the location of where the fleet is headquartered.
  • Name 2 is the name of the task force.
  • Location is where the task force spawns.
  • Ship creates a new ship within the task force.
  • Definition sets what type of ship it is.
  • Equipment sets what level of equipment the ship uses.
  • Amount is how much of that equipment the ship uses. Should be kept at one.
  • Owner is who created the equipment the ship uses.
  • Version Name is for custom classes of ship. Optional

Adding Production

instant_effect = {
    add_equipment_production = {
        equipment = {
	    type = infantry_equipment_0
	    creator = "ARG"
	}
	requested_factories = 1
	progress = 0.19
	efficiency = 100
    }
}
  • Instant Effect is a command that will instantly complete the effect when run.
  • Add Equipment Production creates a new production line.
  • Equipment is the type of equipment to be produced.
  • Creator is the creator of the equipment. Does not need to be the country you are editing.
  • Requested Factories is the amount of factories that the production line will attempt to use. If you assign more factories then your country has, it will use the most available.
  • Progress is how far into production that production line is upon loading the OOB. Number between 0 and 1.
  • Efficiency is how efficient the production line is. Number between 1 and 100.

List of Units

Regiments

infantry
cavalry
camelry
motorized
light_armor
medium_armor
heavy_armor
super_heavy_armor
modern_armor
marine
paratrooper
amphibious_armor
amphibious_mechanized
anti_tank_brigade
anti_air_brigade
armored_car
artillery_brigade
mot_artillery_brigade
rocket_artillery_brigade
mot_rocket_artillery_brigade
motorized_rocket_brigade
bicycle_battalion
mountaineers
mechanized
light_sp_anti_air_brigade
medium_sp_anti_air_brigade
heavy_sp_anti_air_brigade
super_heavy_sp_anti_air_brigade
modern_sp_anti_air_brigade
light_sp_artillery_brigade
medium_sp_artillery_brigade
heavy_sp_artillery_brigade
super_heavy_sp_artillery_brigade
modern_sp_artillery_brigade
light_tank_destroyer_brigade
medium_tank_destroyer_brigade
heavy_tank_destroyer_brigade
super_heavy_tank_destroyer_brigade
modern_tank_destroyer_brigade

Support Companies

anti_air
anti_tank
armored_car_recon
artillery
engineer
field_hospital
logistics_company
maintenance_company
military_police
mot_recon
recon
rocket_artillery
signal_company

Aircraft

CV references the carrier variant of the aircraft. All aircraft have a carrier variant unless otherwise specified.

fighter_equipment_0
cv_fighter_equipment_0
fighter_equipment_1
fighter_equipment_2
fighter_equipment_3
jet_fighter_equipment_1
jet_fighter_equipment_2

CAS_equipment_1
cv_CAS_equipment_1
CAS_equipment_2
CAS_equipment_3

nav_bomber_equipment_1
cv_nav_bomber_equipment_1
nav_bomber_equipment_2
nav_bomber_equipment_3

tac_bomber_equipment_0

heavy_fighter_equipment_1
heavy_fighter_equipment_2
heavy_fighter_equipment_3

scout_plane_equipment_1
scout_plane_equipment_2

tac_bomber_equipment_1
tac_bomber_equipment_2
tac_bomber_equipment_3

jet_tac_bomber_equipment_1
jet_tac_bomber_equipment_2

strat_bomber_equipment_1
strat_bomber_equipment_2
strat_bomber_equipment_3

jet_strat_bomber_equipment_1

rocket_suicide_equipment_1

Ship Categories

battleship
carrier
destroyer
battle_cruiser
heavy_cruiser
light_cruiser
submarine

MTG Ship Equipment

ship_hull_carrier_1
ship_hull_carrier_2
ship_hull_carrier_3

ship_hull_carrier_conversion_bb
ship_hull_carrier_conversion_ca

ship_hull_cruiser_1
ship_hull_cruiser_2
ship_hull_cruiser_3
ship_hull_cruiser_4

ship_hull_pre_dreadnought
ship_hull_heavy_1
ship_hull_heavy_2
ship_hull_heavy_3
ship_hull_heavy_4

ship_hull_super_heavy_1

ship_hull_light_1
ship_hull_light_2
ship_hull_light_3
ship_hull_light_4

ship_hull_submarine_1
ship_hull_submarine_2
ship_hull_submarine_3
ship_hull_submarine_4

ship_hull_cruiser_submarine

torpedo_cruiser
ship_hull_torpedo_cruiser
ship_hull_cruiser_panzerschiff

ship_hull_cruiser_coastal_defense_ship

SH_battleship_1
SH_battleship_2

Non-MTG Ship Equipment

carrier_1
carrier_2
carrier_3
carrier_4

light_cruiser_1
light_cruiser_2
light_cruiser_3
light_cruiser_4

heavy_cruiser_1
heavy_cruiser_2
heavy_cruiser_3
heavy_cruiser_4

battleship_1
battleship_2
battleship_3
battleship_4

battle_cruiser_1
battle_cruiser_2

destroyer_1
destroyer_2
destroyer_3
destroyer_4

submarine_1
submarine_2
submarine_3
submarine_4