trigger · has_dlc
Definition
- Supported scope:
any - Supported target:
none
Description
Checks if player has a DLC.
Example: has_dlc = "name of the dlc"
has_dlcanynoneChecks if player has a DLC.
Example: has_dlc = "name of the dlc"
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.
has_dlc is commonly used in mods to provide compatibility protection for DLC-specific features. For example, it displays certain decisions or national focus options only when the player owns a particular DLC, preventing script errors or malfunctions due to missing DLC. It's also frequently used within allowed / available blocks to dynamically enable or disable UI elements, implementing an "enhanced with DLC, fallback without DLC" experience branch.
# Only allow execution of a decision if player owns Man the Guns DLC
available = {
has_dlc = "Man the Guns"
is_historical_focus_on = no
}
[or](/wiki/trigger/or): Pair with or to check multiple DLCs simultaneously; the condition is satisfied if the player owns any one of them. Ideal for providing a unified compatibility entry point for multiple DLCs with similar functionality.[has_game_rule](/wiki/trigger/has_game_rule): Often used alongside has_game_rule in sequence—first verify DLC existence, then further check whether the corresponding game rule is enabled, creating a "DLC + rule" dual-gate mechanism.[custom_trigger_tooltip](/wiki/trigger/custom_trigger_tooltip): Wrap has_dlc inside custom_trigger_tooltip to replace the default DLC detection prompt with custom localization text, making it clearer to players what conditions apply.[if](/wiki/effect/if) (effect side) and [if](/wiki/trigger/if) (trigger side): Embed has_dlc within the limit clause of an if block to implement conditional branching—"execute logic A with DLC, logic B without DLC"."Man the Guns" not "Man The Guns"). Even a single character case mismatch will cause the trigger to always return false, and the game provides no error message, making it extremely difficult to debug.has_dlc only checks whether the player owns the DLC; it does not reflect whether related game rules have been manually disabled. If mod functionality depends on DLC rules being enabled, you must additionally pair it with has_game_rule for verification. Otherwise, in campaigns where the DLC rule is disabled, the condition will still incorrectly evaluate as available.