Wiki

effect · custom_effect_tooltip

Definition

  • Supported scope:any
  • Supported target:none

Description

Append an extra tooltip to the effect. The tooltip is a [bindable localization](script_concept_documentation.md#bindable-localization).

### Examples

custom_effect_tooltip = MY_TOOLTIP # Simple loc key tooltip

custom_effect_tooltip = { localization_key = MY_TOOLTIP # Root look key IMPORTANT_QUESTION = { # ID IMPORTANT_QUESTION in MY_TOOLTIP will get value: localization_key = MEANING_OF_LIFE # Root loc key in IMPORTANT_QUESTION ANSWER = "42" # ID ANSWER in IMPORTANT_QUESTION will get value 42 } JUST_AS_IMPORTANT = OR_NOT # ID JUST_AS_IMPORTANT in MY_TOOLTIP will get value OR_NOT }

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

custom_effect_tooltip is commonly used when multiple actual operations are executed within hidden_effect, but you need to display custom, more readable explanation text to the player; it is also frequently used in meta_effect or conditional branches, when the description of actual changes lacks clarity and requires additional context hints. For example, silently modifying a variable after a national focus completes while providing a user-friendly tooltip:

complete_national_focus = {
    hidden_effect = {
        set_variable = { var = my_mod_score value = 10 }
    }
    custom_effect_tooltip = MY_MOD_SCORE_CHANGED_TT
}

Synergy

  • [hidden_effect](/wiki/effect/hidden_effect): The quintessential companion — conceal the actual execution logic within hidden_effect to hide messy automatic tooltips, then use custom_effect_tooltip to add a clean explanation, achieving "separation of display and execution."
  • [effect_tooltip](/wiki/effect/effect_tooltip): The two are complementary in purpose; effect_tooltip is used to "pretend to execute an effect in order to display its tooltip," while custom_effect_tooltip displays completely custom localized text. Both can be used simultaneously to compose rich layers of hints.
  • [meta_effect](/wiki/effect/meta_effect): The dynamic scripts generated by meta_effect often struggle to produce readable tooltips. Paired with custom_effect_tooltip, you can supplement human-friendly descriptions.
  • [if](/wiki/effect/if): In if/else branches where different conditions take different paths, use custom_effect_tooltip to provide corresponding hint text for each branch, preventing players from seeing confusing blanks or incorrect descriptions.

Common Pitfalls

  1. No error when localization key doesn't exist, instead displays garbled text: If the loc key you provide has no corresponding entry in the .yml file, the game will not crash, but the interface will directly display the raw key name. Beginners often mistakenly assume the script is wrong and repeatedly debug the effect itself, when the actual problem is a missing localization file or incorrect language directory.
  2. Mistaking it as a way to "hide tooltips": custom_effect_tooltip appends hints and does not replace or suppress automatically generated tooltips from other effects in the same block. To hide automatic tooltips, you must pair it with hidden_effect to wrap the actual logic; using custom_effect_tooltip alone cannot achieve the effect of "only show my text."