Wiki

effect · scoped_sound_effect

Definition

  • Supported scope:COUNTRY
  • Supported target:none

Description

Plays sound effect only on in current scope's player

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.