Scripted Modifiers

Create reusable conditional modifier blocks for Victoria 3 scripting.

21|8|Updated Jun 23, 2025
One-click install
npx skills add https://github.com/mattia2110/tech-and-res --skill scripted-modifiers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Scripted Modifiers
Source: https://github.com/mattia2110/tech-and-res/tree/main/.agents/skills/scripted_modifiers
Command: npx skills add https://github.com/mattia2110/tech-and-res --skill scripted-modifiers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Scripted modifiers provide a way to store conditional numeric logic that can be evaluated by a consumer, allowing reuse across multiple files instead of duplicating logic in separate modifiers or effects.

Core Features & Use Cases

  • Reusable conditional blocks: define small, focused logic blocks that are evaluated by a consumer rather than applying a persistent modifier by themselves.
  • Clear boundaries between scripting and static data: helps distinguish when to use scripted_modifiers versus static_modifiers or modifier_type_definitions.
  • Workflow guidance: outlines steps to inspect the consuming field, compare references, and inline logic when appropriate.

Quick Start

Create a small, reusable scripted modifier in common/scripted_modifiers/ that matches the consuming field's allowed payload and reference it from the target consumer file.

Frequently Asked Questions about Scripted Modifiers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reuse conditional modifier logic across multiple Victoria 3 files?

You can reuse conditional logic by creating focused blocks in common/scripted_modifiers and referencing them from your target consumer files, avoiding duplicated modifier logic across files.

What is a scripted modifier in Victoria 3 and when should I use it?

A scripted modifier stores conditional numeric logic evaluated by a consumer script. Use it for reusable conditional blocks rather than applying persistent static modifier definitions.

How do I validate a scripted modifier against a consumer field in Victoria 3?

Validate scripted modifiers by inspecting the consuming field's allowed payload, comparing against vanilla and local references, and ensuring the structure matches consumer expectations before adding.

What is the difference between scripted modifiers and static modifiers in Victoria 3?

Scripted modifiers store conditional logic evaluated dynamically by a consumer, whereas static modifiers apply persistent effects directly, making scripted modifiers better for reusable conditional blocks.

Do I need to know the allowed fields before creating a scripted modifier in Victoria 3?

Yes, creating scripted modifiers requires knowledge of the allowed fields, payloads, and structure, and expects you to validate the consumer pattern against vanilla and local references.

When should I inline scripted modifier logic instead of reusing it in Victoria 3?

You should inline scripted modifier logic when the consuming field requires a specific payload structure that does not benefit from separate reusable conditional blocks across multiple files.