home / skills / trotsky1997 / my-claude-agent-skills / victoria3-mod-dev

victoria3-mod-dev skill

/victoria3-mod-dev

This skill helps you create, modify, and debug Victoria 3 mods by guiding folder structure, syntax, and localization workflows.

npx playbooks add skill trotsky1997/my-claude-agent-skills --skill victoria3-mod-dev

Review the files below or copy the command above to add this skill to your agents.

Files (12)
SKILL.md
4.8 KB
---

name: victoria3-mod-dev

description: Comprehensive Victoria 3 modding skill for creating, modifying, and debugging mods. Use when working with Victoria 3 mods for (1) Creating new mods from scratch, (2) Adding or modifying game content (decisions, events, buildings, laws, technologies, etc.), (3) Understanding mod file structure and syntax, (4) Debugging mod errors, (5) Creating localization files, (6) Working with .mod descriptor files, or any other Victoria 3 modding tasks.
metadata:
  short-description: Create mod for the game victoria3

---

# Victoria 3 Mod Development

Guide for creating and modifying Victoria 3 mods using Paradox's scripting language.

## Quick Start

### Mod Structure

Every Victoria 3 mod requires:

- `.mod` descriptor file in `Documents/Paradox Interactive/Victoria 3/mod/`
- Mod folder with content in subdirectories:
  - `common/` - Game logic (decisions, buildings, laws, technologies, etc.)
  - `events/` - Event files
  - `localization/` - Localization files (YAML format)
  - `gfx/` - Graphics assets
  - `gui/` - GUI modifications

### Basic .mod File Format

```plaintext
version="1.0.0"
tags={
	"Gameplay"
}
name="My Mod"
supported_version="*"
path="mod/MyMod"
remote_file_id=""
```

## Common Modding Tasks

### Creating Decisions

Decisions go in `common/decisions/`. Format:

```plaintext
my_decision = {
	is_shown = {
		# Conditions for decision to appear
		is_ai = no
	}
	possible = {
		# Conditions for decision to be available
		bureaucracy > 100
	}
	when_taken = {
		# Effects when decision is taken
		add_modifier = {
			name = my_modifier
			days = 365
		}
	}
	ai_chance = {
		base = 0
	}
}
```

### Creating Events

Events go in `events/`. Format:

```plaintext
namespace = mymod

mymod.1 = {
	type = country_event
	
	title = mymod.1.t
	desc = mymod.1.desc
	
	option = {
		name = mymod.1.a
		# Option effects
	}
}
```

### Localization

Localization files go in `localization/<language>/` as YAML:

```yaml
l_english:
 mymod.1.t:0 "Event Title"
 mymod.1.desc:0 "Event description."
 mymod.1.a:0 "OK"
```

### Common File Types

- **Decisions**: `common/decisions/*.txt`
- **Events**: `events/*.txt`
- **Buildings**: `common/buildings/*.txt`
- **Laws**: `common/laws/*.txt` - See [Creating Laws](references/creating-laws.md) for detailed guide
- **Law Groups**: `common/law_groups/*.txt` - Required for laws
- **Technologies**: `common/technology/*.txt`
- **Cultures**: `common/cultures/*.txt`
- **Countries**: `common/country_definitions/*.txt`
- **Modifiers**: `common/static_modifiers/*.txt`
- **Scripted Effects**: `common/scripted_effects/*.txt`
- **Scripted Triggers**: `common/scripted_triggers/*.txt`

### Creating Laws

Quick example:

```plaintext
# 1. Create law group (common/law_groups/my_group.txt)
my_law_group = {
    law_group_category = economy
}

# 2. Create law (common/laws/my_law.txt)
my_custom_law = {
    group = my_law_group
    icon = "gfx/interface/icons/law_icons/my_law.dds"
    progressiveness = 50
    modifier = {
        country_construction_efficiency_add = 0.1
    }
}

# 3. Add localization (localization/english/my_law_l_english.yml)
# my_custom_law:0 "My Custom Law"
```

See [Creating Laws](references/creating-laws.md) for complete guide.

## Syntax Guidelines

### Scope Operators

- `ROOT` - Original scope
- `THIS` - Current scope
- `FROM` - Previous scope
- `PREV` - Previous scope in chain

### Common Conditions

- `is_ai = yes/no` - Check if AI controlled
- `has_modifier = <name>` - Check for modifier
- `has_technology_researched = <tech>` - Check technology
- `bureaucracy > <value>` - Numeric comparisons
- `owns_entire_state_region = <state>` - State ownership

### Common Effects

- `add_modifier = { name = <name> days = <days> }`
- `set_variable = { name = <name> value = <value> }`
- `add_technology_researched = <tech>`
- `trigger_event = { id = <event_id> }`

## Reference Files

For detailed information on specific modding areas, see:

- [File Structure](references/file-structure.md) - Complete directory structure
- [Syntax Reference](references/syntax-reference.md) - Detailed syntax guide
- [Common Patterns](references/common-patterns.md) - Common modding patterns
- [Examples](references/examples.md) - Real-world examples
- [Glossary](references/glossary.md) - Comprehensive terminology dictionary
- [CWTools Guide](references/cwtools-guide.md) - Using CWTools for validation and auto-completion
- [Creating Laws](references/creating-laws.md) - Complete guide for creating new laws

## Debugging

Common issues:

1. **Syntax errors**: Check brackets, quotes, and indentation
2. **Missing localization**: Ensure all keys exist in localization files
3. **Scope errors**: Verify scope operators are correct
4. **File paths**: Ensure files are in correct directories

Use game's error log to identify issues. Check `Documents/Paradox Interactive/Victoria 3/logs/` for error messages.

Overview

This skill provides a comprehensive Victoria 3 modding assistant for creating, modifying, and debugging mods. It covers mod structure, common file types, scripting syntax, localization, and practical examples for decisions, events, laws, buildings, and technologies. Use it to speed development and avoid common errors when working with Victoria 3 content.

How this skill works

The skill inspects mod folder layout, .mod descriptor files, and Paradox script files to validate structure and point out likely syntax or scope errors. It explains where to place content (common/, events/, localization/, gfx/, gui/) and offers concrete code snippets and templates for decisions, events, laws, and more. It also guides debugging by mapping log messages to probable causes and fixes.

When to use it

  • Starting a new Victoria 3 mod or scaffold mod folders and .mod descriptor.
  • Adding or modifying game content: decisions, events, laws, buildings, techs, cultures, or countries.
  • Writing or validating localization YAML files for multiple languages.
  • Debugging syntax errors, scope/operator issues, missing localization keys, or broken file paths.
  • Preparing a mod for compatibility by checking supported_version and descriptor fields.

Best practices

  • Follow the canonical folder layout: common/, events/, localization/, gfx/, gui/ and match file names to content types.
  • Keep localization keys consistent and present for every event/decision option to avoid missing-text warnings.
  • Use scope operators (ROOT, THIS, FROM, PREV) deliberately; test triggers/effects in small increments.
  • Validate .mod descriptor: correct path, supported_version, and tags to ensure proper loading.
  • Use CWTools or in-editor validation for autocompletion and early detection of syntax issues.

Example use cases

  • Create a new decision in common/decisions/ that adds a temporary modifier when taken and ensure AI conditions.
  • Author a country event with namespace and localization entries in localization/english/*.yml.
  • Implement a new law: add a law_group, create the law file, link the modifier, and add localization entries.
  • Debug a failing mod load by reading Victoria 3 logs and tracing missing or malformed entries back to file and line.
  • Set up a .mod descriptor and folder structure to share a mod with others or to upload to a workshop.

FAQ

Where do localization files go?

Place YAML localization files under localization/<language>/ with l_english: or the appropriate language header and include all keys used by your mod.

How do I fix syntax errors?

Check brackets, braces, quotes, and indentation; validate scope operators and run a tool like CWTools or inspect the game's log in Documents/Paradox Interactive/Victoria 3/logs/ for exact error lines.