Wiki

trigger · has_shine_effect_on_focus

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Check if country has shine effect on focus (either manually achieved or by being worked on).

Note that tooltips are only shown in debug mode.

### Example

has_shine_effect_on_focus = GER_prioritize_economic_growth

实战 · 配合 · 坑

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

实战用法

has_shine_effect_on_focus 常用于国策树 UI 逻辑中,判断某个国策当前是否处于高亮发光状态(无论是玩家手动激活还是正在被研究推进),从而决定是否显示相关提示、激活后续决议或触发事件。典型场景是在决议的 available 块中检查玩家是否已经在"努力推进"某国策,再解锁对应的辅助决议。

# 在某个决议的 available 块中,只有当苏联正在高亮推进该国策时才可用
available = {
    tag = SOV
    has_shine_effect_on_focus = SOV_collectivization_drive
}

配合关系

  • [activate_shine_on_focus](/wiki/effect/activate_shine_on_focus) — 最直接的搭档:先用此 effect 手动激活某国策的发光效果,再用 has_shine_effect_on_focus 检验该效果是否已生效,形成完整的"激活→验证"闭环。
  • [deactivate_shine_on_focus](/wiki/effect/deactivate_shine_on_focus) — 配合使用可实现"条件达成后关闭高亮"的逻辑,先用 trigger 确认效果存在,再在 effect 块中关闭它,避免重复操作。
  • [has_completed_focus](/wiki/trigger/has_completed_focus) — 常与之并列写在同一 trigger 块中,区分"国策仍在进行(有 shine)"与"国策已完成"两种状态,防止逻辑重叠。
  • [activate_decision](/wiki/effect/activate_decision) — 当 has_shine_effect_on_focus 返回真时,在 effect 块中激活对应决议,实现"推进特定国策 → 解锁额外选项"的联动设计。

常见坑

  1. 忘记 debug 模式才显示 tooltip:该 trigger 本身的文本提示仅在 debug 模式下可见,新手在正式发布的 mod 中依赖它向玩家传递信息时会发现界面上什么都不显示,需要自行用 custom_trigger_tooltip 包装来手动指定显示文本。
  2. scope 写错导致永远返回假has_shine_effect_on_focus 必须在 COUNTRY scope 下调用,若误写在 state 或 character scope 内(例如放在 any_owned_state 的子块里),游戏不会报错但结果始终为假,排查时极难发现。

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

has_shine_effect_on_focus is commonly used in focus tree UI logic to determine whether a particular focus is currently highlighted and glowing (whether activated manually by the player or actively being researched), thereby controlling whether to display related tooltips, activate follow-up decisions, or trigger events. A typical scenario is checking in a decision's available block whether the player is already "actively pursuing" a focus, then unlocking the corresponding auxiliary decision.

# In the available block of a decision, only usable when the Soviet Union is actively highlighting this focus
available = {
    tag = SOV
    has_shine_effect_on_focus = SOV_collectivization_drive
}

Synergy

  • [activate_shine_on_focus](/wiki/effect/activate_shine_on_focus) — The most direct companion: use this effect to manually activate a focus's glow effect, then use has_shine_effect_on_focus to verify the effect is active, forming a complete "activate → verify" loop.
  • [deactivate_shine_on_focus](/wiki/effect/deactivate_shine_on_focus) — When used together, enables the logic pattern "turn off highlight when conditions are met"; first verify the effect exists with the trigger, then disable it in the effect block, preventing duplicate operations.
  • [has_completed_focus](/wiki/trigger/has_completed_focus) — Often written alongside in the same trigger block to distinguish between "focus still in progress (has shine)" and "focus completed" states, avoiding logic overlap.
  • [activate_decision](/wiki/effect/activate_decision) — When has_shine_effect_on_focus returns true, activate the corresponding decision in the effect block, enabling the linked design of "pursue specific focus → unlock additional options."

Common Pitfalls

  1. Tooltip only visible in debug mode: The tooltip text for this trigger itself is only visible in debug mode. Newcomers relying on it to convey information to players in officially released mods will find nothing displays on screen—you need to manually wrap it with custom_trigger_tooltip to specify display text.
  2. Incorrect scope causes perpetual false returns: has_shine_effect_on_focus must be called within COUNTRY scope. If mistakenly written in state or character scope (for example, nested inside any_owned_state), the game will not error but the result will always be false, making it extremely difficult to debug.