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
- 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.
- 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."