Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>HOI4 Mod KitNew to Visual Studio Code? Get it now.
HOI4 Mod Kit

HOI4 Mod Kit

HOI4 Mod Kit Dev

|
19 installs
| (0) | Free
Visual toolkit for Hearts of Iron IV modding: visual state editor, map viewer, mod picker, diff and validation.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

HOI4 Mod Kit

A visual toolkit for Hearts of Iron IV modding. Edit state files with a node-based editor, preview maps, diff original vs generated code, and validate at scale — all inside VS Code.

Highlights

  • Launcher panel: HOI4: Launch Mod Editor
  • Visual State Editor
    • Drag-and-drop nodes for state properties, history, resources, buildings, and dated events
    • Auto-connections with strict rules (e.g., buildings/provincial under a buildings_block; dated content under date_block)
    • Smart column layout, snap-to-grid, and parent/child placement rules
    • Live code generation with comment retention and original-order preservation
    • One-click Compare (diff) and safe Save back to your mod
  • Map Viewer
    • Provinces, States, and Countries views with pan/zoom and water tint toggle
    • Tooltip with owner, buildings, VP, strategic region, units (when available)
  • Mod Picker & Utilities
    • List local/Steam mods, open in Explorer/VS Code, duplicate/rename, set icon
    • Read-only guard for Steam mods; duplicate to edit safely

Quick Start

  1. Install the extension and open VS Code.
  2. Run HOI4: Launch Mod Editor.
  3. Pick your mod from the Mod List (or configure folders in Settings).
  4. Shift+Click a state on the map to open the Visual State Editor.
  5. Drag nodes, edit values, review generated code, and click "Save Changes".
  6. Use "Show Diff" to compare Original vs Generated at any time.

Visual State Editor – Key Rules

  • Columns and placement
    • Column 0: basic state properties
    • Column 1: history_block and resources_block
    • Column 2: children of history/resources; Column 3: dated children
    • Parents get outputs on the right; children inputs on the left (input hidden in first column)
  • Buildings scoping
    • buildings and provincial nodes must attach to a buildings_block immediately to the left
    • In dated scope: history → date_block → buildings_block → building/provincial
    • Province-only types (naval_base, coastal_bunker, bunker, fort, dam) never emit as top-level buildings
  • Ordering & comments
    • Preserves original order of owner/core/buildings/victory_points
    • Keeps inline VP comments and provincial header comments
    • Reorders root sections (resources/state_category/history/provinces/local_supplies) to match the original where possible

Commands

  • HOI4: Launch Mod Editor – open the launcher and map/editor
  • HOI4: Compare Current States – show diff of Original vs Generated for the active editor session
  • HOI4: Validate All States – parse and compare every state (game + mod overrides)
  • HOI4: Dump Normalized States (Debug) – output normalized originals and generated for diagnostics

Mouse & Keyboard

  • Pan: drag on the canvas
  • Zoom: mouse wheel (cursor-centered)
  • Fit: double-click
  • Tooltip: hover
  • Open state editor: Shift+Click a state

Requirements

  • Hearts of Iron IV installed
  • Your mod folder (local or Steam); the launcher will prompt if not set

Privacy & Telemetry

  • No telemetry. File paths are used only locally to locate HOI4 and mod assets.

Troubleshooting

  • Steam mods are read-only. Use Duplicate to a local folder to enable saving.
  • If the compare banner appears but no visible diff, we normalize code to reduce noise; the banner will auto-clear once fully matched.

License

MIT – see LICENSE.md for details.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft