HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Playing Sounds on Units

05-05-2006, 10:04 PM#1
moonliterhythm
I have a 3D sound that I want to play on a unit, but for some reason, I can't get it working. I'm using the following:
Collapse JASS:
call PlaySoundOnUnitBJ (soundClip, 100.0, u) 
where all the parameters are defined, but still nothing. I made sure that "soundClip" is 3D as well.

Any ideas?
05-06-2006, 07:48 AM#2
RaeVanMorlock
Quote:
Originally Posted by moonliterhythm
I have a 3D sound that I want to play on a unit, but for some reason, I can't get it working. I'm using the following:
Collapse JASS:
call PlaySoundOnUnitBJ (soundClip, 100.0, u) 
where all the parameters are defined, but still nothing. I made sure that "soundClip" is 3D as well.

Any ideas?


What is soundClip defined as?
What is u defined as?
Is the camera near the unit when the sound is played?
What event is firing to play the sound?
Where's the rest of the code?
05-06-2006, 12:23 PM#3
Anitarf
Quote:
Originally Posted by moonliterhythm
I have a 3D sound that I want to play on a unit, but for some reason, I can't get it working. I'm using the following:
Collapse JASS:
call PlaySoundOnUnitBJ (soundClip, 100.0, u) 
where all the parameters are defined, but still nothing. I made sure that "soundClip" is 3D as well.

Any ideas?
If soundClip is a global variable, you should call it udg_soundClip in Jass. Also, get rid of the space between the function name and the "(". That's all I can think of right now.
05-06-2006, 09:49 PM#4
PipeDream
If the sound was made in the sound editor, gg_snd_soundClip
05-07-2006, 03:24 PM#5
moonliterhythm
i'm sorry to confuse you guys, "soundClip" is just something i wrote there to stand for the variable in question, but, i am sure i'm using the right variable names. for example, one of my sound files are "gg_snd_AlchemistTaunt"

i have defined it as a 3D sound. I gave it a min distance of 100, a max distance of 1500. The trigger that makes it fire is if a player presses, up, have the alchemist play his channel animation, and play the sound on the alchemist. however, when i press up, the alchemist plays his channel animation, but i hear no sound.
05-07-2006, 11:31 PM#6
RaeVanMorlock
Quote:
Originally Posted by Anitarf
Also, get rid of the space between the function name and the "(".

That's perfectly legal, actually... I do it all the time.
05-08-2006, 04:17 AM#7
Pheonix-IV
I've never worked out how to get 3D sounds to work, if anyone can answer this, i'd love to know.
05-08-2006, 08:13 AM#8
Anitarf
The max distance of 1500 could be to blame, the default game camera's distance to target is 1650. Try a larger max distance, at least 3000.