Wiki

effect · custom_override_tooltip

Definition

  • Supported scope:any
  • Supported target:none

Description

Executes the provided effects but with a custom tooltip surpressing all tooltips from all other effects inside this block.
The custom tooltip is a [bindable localization](script_concept_documentation.md#bindable-localization).

### Examples

custom_override_tooltip = { tooltip = MY_TOOLTIP # Simple loc key tooltip <other effects> }

custom_override_tooltip = { 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 } <other effects> }

实战 · 配合 · 坑

实战内容由 AI 生成,并已对照 vanilla 命令词表校验 —— 请当作起点而非权威依据。上方的定义节才是游戏自带文档原文。

实战用法

custom_override_tooltip 适合在复杂效果块中将多个零散的游戏状态改动(如变量操作、标志设置、单位生成)合并为一条玩家可读的提示,避免界面被大量内部细节塞满。常见场景包括:隐藏幕后数学计算的具体步骤、用一句本地化文本概括一整段触发后的连锁效果。

custom_override_tooltip = {
    tooltip = FOCUS_REWARD_INDUSTRY_TOOLTIP
    set_variable = { var = industrial_output value = 10 }
    add_to_variable = { var = global_prestige value = 5 }
    set_global_flag = industry_modernized
}

配合关系

  • [hidden_effect](/wiki/effect/hidden_effect):将真正不需要向玩家展示的副作用嵌套在 hidden_effect 里,再把整个块套入 custom_override_tooltip,实现"展示一条友好说明、隐藏所有实现细节"的双层控制。
  • [custom_effect_tooltip](/wiki/effect/custom_effect_tooltip):当只需要在正常 tooltip 流程中追加一条额外说明(而非完全替换)时使用 custom_effect_tooltip,二者形成"完全覆盖"与"追加补充"的互补关系。
  • [effect_tooltip](/wiki/effect/effect_tooltip):用于在 custom_override_tooltip 外部选择性地模拟显示某个效果块的 tooltip,与本命令配合可精确控制哪些内容可见、哪些被压制。
  • [if](/wiki/effect/if):在 custom_override_tooltip 内部嵌套条件分支时,if 内各分支的单独 tooltip 会全部被外层统一提示覆盖,适合多条件奖励逻辑的整洁呈现。

常见坑

  1. 忘记 tooltip 字段custom_override_tooltip 块中若省略 tooltip = ...,整个块内所有效果在 UI 中将彻底无提示显示,玩家看不到任何反馈,且游戏不一定报错,极难排查。
  2. 误以为它能控制 trigger 侧的提示custom_override_tooltip 仅压制 effect 块内部的 tooltip;若想在 trigger/condition 侧实现类似效果,应改用 [custom_override_tooltip](/wiki/trigger/custom_override_tooltip),混用会导致提示行为不符合预期。

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_override_tooltip is ideal for consolidating multiple scattered game state modifications (such as variable operations, flag assignments, unit spawning) into a single player-readable tooltip within complex effect blocks, preventing the UI from being cluttered with numerous internal details. Common scenarios include: hiding the specific steps of behind-the-scenes mathematical calculations, and summarizing an entire chain of triggered consequences with a single localization string.

custom_override_tooltip = {
    tooltip = FOCUS_REWARD_INDUSTRY_TOOLTIP
    set_variable = { var = industrial_output value = 10 }
    add_to_variable = { var = global_prestige value = 5 }
    set_global_flag = industry_modernized
}

Synergy

  • [hidden_effect](/wiki/effect/hidden_effect): Nest side effects that truly don't need to be shown to the player inside hidden_effect, then wrap the entire block in custom_override_tooltip to achieve two-tier control: "display a friendly description while hiding all implementation details."
  • [custom_effect_tooltip](/wiki/effect/custom_effect_tooltip): When you only need to append an additional description to the normal tooltip flow (rather than completely replace it), use custom_effect_tooltip. The two commands form a complementary relationship of "complete override" versus "supplementary addition."
  • [effect_tooltip](/wiki/effect/effect_tooltip): Used outside of custom_override_tooltip to selectively simulate the tooltip display of a specific effect block. Combined with this command, you can precisely control which content is visible and which is suppressed.
  • [if](/wiki/effect/if): When nesting conditional branches inside custom_override_tooltip, the individual tooltips from each branch in the if statement are all covered by the unified outer tooltip, making it ideal for clean presentation of multi-condition reward logic.

Common Pitfalls

  1. Forgetting the tooltip field: If tooltip = ... is omitted in a custom_override_tooltip block, all effects within that block will display with no tooltip in the UI, leaving players with no feedback. The game may not even report an error, making this extremely difficult to troubleshoot.
  2. Mistakenly assuming it controls trigger-side tooltips: custom_override_tooltip only suppresses tooltips within effect blocks. If you want to achieve similar effects on the trigger/condition side, use [custom_override_tooltip](/wiki/trigger/custom_override_tooltip) instead. Mixing the two will result in unexpected tooltip behavior.