Wiki

effect · create_equipment_variant

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Creates a new equipment variant.
Example:
create_equipment_variant = {
	name = "Yorktown Class" # Optional.
	name_group = USA_CV_HISTORICAL # Optional. If not set, parent's name group will be inherited.
	type = ship_hull_carrier_1 # Must be a type and not an archetype.
	allow_without_tech = yes # Optional. Default no. If yes, create the variant even if the type hasn't been unlocked yet. Otherwise created the variant once the type research completes.
	parent_version = 3 # Default 0. If not found the default variant will be used (or created).
	obsolete = yes # Optional. Default no.
	mark_older_equipment_obsolete = yes # Optional. Default no. Marks all older (non-chassis) equipment variants as obsolete as long as the following matches: Archetype, niche, mission set (for planes).
	role_icon_index = 3 # Optional. Default 'auto', leverage AI design logic.
	upgrades = { # Optional. The level on each upgrade is inherited from the parent.
		ship_deckspace_upgrade = 1
		carrier_armor_upgrade = 2
	}
	modules = { # Optional. The module installed in each slot is inherit from the parent.
		fixed_ship_engine_slot = carrier_ship_engine_2
		fixed_ship_secondaries_slot = empty # Clears the slot if the parent has any module installed.
	}
	model = "GER_light_armor_2_entity" # Optional.
	icon = "gfx/interface/technologies/ger_basic_light_tank.dds" # Optional. GFX names are also supported e.g. "GFX_GER_basic_light_tank_medium".
    design_team = mio:my_mio_token # Optional. accepts mio:token, variable or keyword
}

Hands-On Notes

Hands-on notes are AI-generated and checked against the vanilla command vocabulary — treat them as a starting point, not authoritative reference. The definition above is the game's own documentation.

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

  1. 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/.
  2. 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.