Wiki

trigger · custom_override_tooltip

Definition

  • Supported scope:any
  • Supported target:none

Description

An `AND` trigger that has an overridden custom tooltip.
A positive tooltip can be set with `tooltip` and the tooltip to be used inside a NOT can be set with `not_tooltip`.
If no positive tooltip is provided and the root key is a localization key (not a formatter, see [formatted localization](script_concept_documentation.md#formatted-localization)),
then a negative tooltip will be generated by appending `_NOT` to the root localization for the positive tooltip.
Both tooltip and `not_tooltip` are [bindable localizations](script_concept_documentation.md#bindable-localization).

### Examples

custom_override_tooltip = { tooltip = MY_TOOLTIP # Simple loc key tooltip not_tooltip = MY_TOOLTIP_NOT <other triggers> }

custom_override_tooltip = { tooltip = MY_TOOLTIP # Implicit: #not_tooltip = MY_TOOLTIP_NOT <other triggers> }

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 } # Implicit: # not_tooltip = { # localization_key = MY_TOOLTIP_NOT # IMPORTANT_QUESTION = { # localization_key = MEANING_OF_LIFE # ANSWER = "42" # } # JUST_AS_IMPORTANT = OR_NOT #} <other triggers> }

实战 · 配合 · 坑

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

实战用法

custom_override_tooltip 常用于将复杂的多条件判断合并成一条玩家友好的本地化提示,例如在国策的 available 块中隐藏内部逻辑、只展示一句话的解锁说明。也适合在科技或决议的 limit 中,将一组变量检查替换成带动态参数的可读文本,避免玩家看到一堆裸露的 check_variable 行。

available = {
    custom_override_tooltip = {
        tooltip = MY_FOCUS_REQUIREMENT_TT
        not_tooltip = MY_FOCUS_REQUIREMENT_NOT_TT
        check_variable = { var = my_mod_score value > 50 }
        has_global_flag = my_mod_prerequisite_flag
    }
}

配合关系

  • check_variable:最常被包裹在内的条件,通过覆盖 tooltip 把"变量 > 50"这类机器式判断换成可读描述。
  • custom_trigger_tooltip:二者功能相近但不同——custom_trigger_tooltip 只改显示文本且条件本身仍会展开,而 custom_override_tooltip 完全替换整个 AND 块的提示,需要根据是否要完全隐藏子条件来选择。
  • andcustom_override_tooltip 本身就是一个隐式 AND,理解这一点有助于判断何时用它来替代裸露的 and = { } 块同时附加提示。
  • custom_effect_tooltip:在 effect 侧做类似事情,常与本 trigger 成对出现,保持 trigger 和 effect 的提示风格一致。

常见坑

  1. 忘记提供 tooltip 键就直接填子条件:此时游戏不会自动生成任何提示,整个条件块在 UI 上可能显示为空或报错,必须至少指定一个 tooltip 键。
  2. 误以为它能单独隐藏子条件的勾/叉图标custom_override_tooltip 替换的是文本提示,但底层每个子条件是否满足仍会影响整体真假值;若想彻底隐藏子条件的视觉反馈,需配合 hidden_effect/逻辑重构,而不能只靠改 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 commonly used to consolidate complex multi-condition logic into a single player-friendly localized tooltip, such as hiding internal mechanics within a focus's available block and displaying only a concise unlock requirement. It is also useful in technology or decision limit blocks, where a group of variable checks can be replaced with readable text containing dynamic parameters, preventing players from seeing a pile of bare check_variable lines.

available = {
    custom_override_tooltip = {
        tooltip = MY_FOCUS_REQUIREMENT_TT
        not_tooltip = MY_FOCUS_REQUIREMENT_NOT_TT
        check_variable = { var = my_mod_score value > 50 }
        has_global_flag = my_mod_prerequisite_flag
    }
}

Synergy

  • check_variable: The most commonly wrapped condition; by overriding the tooltip, machine-like checks such as "variable > 50" are converted into readable descriptions.
  • custom_trigger_tooltip: The two serve similar but distinct purposes — custom_trigger_tooltip only changes the display text and the condition itself still expands, whereas custom_override_tooltip completely replaces the tooltip for the entire AND block. Choose based on whether you need to fully hide the sub-conditions.
  • and: custom_override_tooltip is itself an implicit AND. Understanding this helps determine when to use it to replace bare and = { } blocks while attaching a tooltip.
  • custom_effect_tooltip: Achieves a similar effect on the effect side; often paired with this trigger to maintain consistent tooltip styling between triggers and effects.

Common Pitfalls

  1. Forgetting to provide the tooltip key and directly filling sub-conditions: In this case, the game will not auto-generate any tooltip, and the entire condition block may appear empty or cause errors in the UI. You must specify at least one tooltip key.
  2. Mistakenly believing it can independently hide the checkmark/cross icons of sub-conditions: custom_override_tooltip replaces text tooltips, but whether each underlying sub-condition is satisfied still affects the overall truth value. To completely hide the visual feedback of sub-conditions, you need to combine hidden_effect or restructure the logic; simply changing the tooltip is insufficient.