• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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