effect · scoped_sound_effect
Definition
- Supported scope:
COUNTRY - Supported target:
none
Description
Plays sound effect only on in current scope's player
scoped_sound_effectCOUNTRYnonePlays 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) — 用作播放音效的前置条件检查,防止在同一流程中重复触发音效。every_owned_state 或 every_unit_leader 等子块内调用,不会产生任何效果也不会报错,导致音效静默且难以排查。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.
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"
}
}
[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.every_owned_state or every_unit_leader, it produces no effect and raises no error, resulting in silent audio that is difficult to debug.