• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

How to add a sound to be heard by others

Status
Not open for further replies.
Here is one way. Create a force (or "player group") variable named "SoundForce". Then make a sound variable called "TempSound".

This is how the trigger would look:
  • Set SoundForce = <Some Force>
  • Set TempSound = <Some Sound>
  • Custom script: if IsPlayerInForce(GetLocalPlayer(), udg_SoundForce) then
  • Custom script: call StartSound(udg_TempSound)
  • Custom script: endif
Just adjust "SoundForce" to the "Player Group" that should hear the sound (e.g. Allies of Player 1, and add Player 1 to it as well). Then set "TempSound" to the sound that should be heard.

The custom script will work if you copy it as it is. You should also be able to use "Sound - Play Sound" instead of the line "call StartSound()" if you'd like.

Note: For 3D sounds the process might be slightly different. You would instead use the function "Sound - Play Sound on Unit".
 
Level 4
Joined
Jan 21, 2013
Messages
42
It give me 2 errors , on costum script.

if IsPlayerInForce(GetLocalPlayer(), udg_SoundForce) then
(expected a name )

and then here
Custom script: endif
(expected code statement .... )

Here is one way. Create a force (or "player group") variable named "SoundForce". Then make a sound variable called "TempSound".

This is how the trigger would look:
  • Set SoundForce = <Some Force>
  • Set TempSound = <Some Sound>
  • Custom script: if IsPlayerInForce(GetLocalPlayer(), udg_SoundForce) then
  • Custom script: call StartSound(udg_TempSound)
  • Custom script: endif
Just adjust "SoundForce" to the "Player Group" that should hear the sound (e.g. Allies of Player 1, and add Player 1 to it as well). Then set "TempSound" to the sound that should be heard.

The custom script will work if you copy it as it is. You should also be able to use "Sound - Play Sound" instead of the line "call StartSound()" if you'd like.

Note: For 3D sounds the process might be slightly different. You would instead use the function "Sound - Play Sound on Unit".
 
Level 4
Joined
Jan 21, 2013
Messages
42
Untitled.png
 
Level 4
Joined
Jan 21, 2013
Messages
42
Variables were done first like u said, I'm pretty sure I'm doing someting else wrong or the script is wrong

You have to make a player group variable named "SoundForce". If you choose a different name for it, then you have to change "udg_SoundForce" to the name you have: "udg_<Insert Name Here>". For example, if you name it "SoundLala", it would be "udg_SoundLala" in the custom script.
 
Status
Not open for further replies.
Top