• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Can you make specific players hear different sounds at or around the same time?

Status
Not open for further replies.
Level 5
Joined
Aug 18, 2013
Messages
85
I want it so when one players hears a DEFEAT SOUND another player hears a VICTORY SOUND

Is this possible?

Currently I'm doing it like this


  • victory for dg
    • Events
      • Player - Player 11 (Dark Green) types a chat message containing -dgbeatgreen as An exact match
    • Conditions
    • Actions
      • Set Player = Player 11 (Dark Green)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Sound - Play victory <gen>
      • Sound - Destroy (Last played sound)
      • Custom script: endif
  • lose for green
    • Events
      • Player - Player 11 (Dark Green) types a chat message containing -dgbeatgreen as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -dgbeatorange as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -orangebeatdg as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -orangebeatgreen as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing hooraydg as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing hoorayorange as An exact match
    • Conditions
    • Actions
      • Set Player = Player 7 (Green)
      • Custom script: if GetLocalPlayer() == udg_Player then
      • Sound - Play lose01 <gen>
      • Sound - Destroy (Last played sound)
      • Custom script: endif
Currently I have them activated by texts commands because they don't seem to get activated if another trigger activates these triggers.

But this still doesn't seem to work. What's the problem? I tried putting "wait" in the triggers and it still doesn't work.
 
Remove the line "Sound - Destroy (Last played sound)". It is likely causing the sound to be destroyed before it finishes playing.

In general, you don't need to destroy sounds defined in the sound editor (unless you are absolutely certain that you will no longer use it). The function "Sound - Play sound" does not generate a new sound each time. It just uses a global that was created once on map initialization.
 
Level 5
Joined
Aug 18, 2013
Messages
85
>The function "Sound - Play sound" does not generate a new sound each time. It just uses a global that was created once on map initialization

What does that mean? Does it mean that you cannot simultaneously make 2 different players hear different sounds at the same time? That I'd have to put a WAIT and wait for the first sound to finish before the other player hears the lose sound?
 
Status
Not open for further replies.
Top