Wiki

effect · scoped_sound_effect

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Plays sound effect only on in current scope's player

实战 · 配合 · 坑

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

实战用法

scoped_sound_effect 常用于事件或决策触发时,仅让当前国家的人类玩家听到特定音效,而不打扰其他联机玩家或 AI——例如科技突破、外交成功、国家危机爆发等戏剧性节点的音效反馈。在多人联机 mod 中尤其有价值,因为它可以精确投递"属于这个国家"的声音提示。

country_event = {
    id = my_mod.1
    option = {
        name = my_mod.1.a
        # 仅让触发此事件的国家玩家听到胜利号角
        scoped_sound_effect = "my_mod_victory_fanfare"
    }
}

配合关系

  • [country_event](/wiki/effect/country_event) — 事件触发时搭配使用,在 option 块内为玩家播放对应情境的音效,增强叙事沉浸感。
  • [add_political_power](/wiki/effect/add_political_power) — 奖励政治点数的同时播放正向提示音,给玩家即时的听觉反馈。
  • [add_ideas](/wiki/effect/add_ideas) — 添加国策思潮/顾问时同步触发音效,强调"重要变化发生了"的感知信号。
  • [has_country_flag](/wiki/trigger/has_country_flag) — 用作播放音效的前置条件检查,防止在同一流程中重复触发音效。

常见坑

  1. 误用于 STATE 或 UNIT_LEADER 等非 COUNTRY scope:该 effect 仅在 COUNTRY scope 下有效,若在 every_owned_stateevery_unit_leader 等子块内调用,不会产生任何效果也不会报错,导致音效静默且难以排查。
  2. 误以为所有玩家都能听到:新手常把它当作"广播音效"使用,实际上它只播放给当前 scope 所对应国家的玩家,若需要让多个国家各自听到音效,必须分别进入对应 scope 再各自调用一次。

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

scoped_sound_effect is commonly used when events or decisions are triggered to play a specific sound effect only to the human player controlling the current nation, without disturbing other multiplayer players or AI—for example, audio feedback at dramatic moments like technology breakthroughs, diplomatic successes, or national crises. It is particularly valuable in multiplayer mods because it can precisely deliver sound cues that "belong to this nation."

country_event = {
    id = my_mod.1
    option = {
        name = my_mod.1.a
        # Play victory fanfare only to the player controlling the nation that triggered this event
        scoped_sound_effect = "my_mod_victory_fanfare"
    }
}

Synergy

  • [country_event](/wiki/effect/country_event) — Used alongside event triggers; within the option block, it plays sound effects appropriate to the narrative context, enhancing storytelling immersion.
  • [add_political_power](/wiki/effect/add_political_power) — Play a positive prompt sound while granting political power, providing immediate audio feedback to the player.
  • [add_ideas](/wiki/effect/add_ideas) — Synchronize sound effects when adding national focuses or advisors, emphasizing the perceptual signal that "an important change has occurred."
  • [has_country_flag](/wiki/trigger/has_country_flag) — Serves as a precondition check before playing sound effects, preventing accidental duplicate triggers of the same sound within a single sequence.

Common Pitfalls

  1. Misusing it in non-COUNTRY scopes like STATE or UNIT_LEADER: This effect only works within COUNTRY scope. If called within sub-blocks like every_owned_state or every_unit_leader, it produces no effect and raises no error, resulting in silent audio that is difficult to debug.
  2. Assuming all players hear it: Beginners often treat it as a "broadcast sound effect," but it only plays to the player controlling the nation in the current scope. If you need multiple nations to each hear their own sound effects, you must enter each scope separately and call the effect once per scope.