Hands-On Usage
create_equipment_variant is commonly used when national focuses or events trigger to automatically generate equipment variants with preset modules and upgrades for player/AI nations, eliminating the need for manual design—for example, in historical mods, allowing the USA to automatically obtain an "Essex Class" carrier design in a specific year. It can also be used in startup initialization scripts to batch-generate historically accurate tank and aircraft variants for all nations.
focus = {
id = USA_build_essex
...
completion_reward = {
create_equipment_variant = {
name = "Essex Class"
type = ship_hull_carrier_2
allow_without_tech = yes
mark_older_equipment_obsolete = yes
modules = {
fixed_ship_flight_deck_slot = ship_flight_deck_2
fixed_ship_engine_slot = carrier_ship_engine_2
}
upgrades = {
ship_deckspace_upgrade = 2
}
}
}
}
Synergy
[has_completed_focus](/wiki/trigger/has_completed_focus): Check in the trigger block whether a focus has been completed, ensuring variant creation only triggers at appropriate research stages and preventing premature generation of advanced equipment.
[add_equipment_to_stockpile](/wiki/effect/add_equipment_to_stockpile): Immediately add the created variant to stockpile after creation, allowing units to equip the new design directly; the two work together to achieve a "research-to-delivery" narrative effect.
[can_research](/wiki/trigger/can_research): Determine in the condition block whether the nation has unlocked the relevant technology; combined with the allow_without_tech = no (default) logic, this decides whether advance protection checks via this trigger are needed.
[add_tech_bonus](/wiki/effect/add_tech_bonus): Usually grant technology bonuses simultaneously in the same focus reward, enabling the nation to research matching chassis faster and bringing the new variant into practical use sooner.
Common Pitfalls
type must specify a concrete variant, not an archetype: Beginners often mistakenly write type = ship_hull_carrier (archetype), causing script errors or silent failures; you must use a concrete variant with numeric suffix like ship_hull_carrier_1, which can be looked up in common/units/equipment/.
- Forgetting to handle the case where technology is not yet researched: The default
allow_without_tech = no means if the target nation hasn't researched the corresponding hull technology, the variant won't be created immediately but will take effect only after the tech completes. This causes the variant to appear "missing" in startup initialization scripts—if immediate availability is required, explicitly add allow_without_tech = yes.